From fa65513ead1ecc12e357821697eb5bebd84df020 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 21 Oct 2020 01:57:38 +0000 Subject: [PATCH] Generated from 9b33d7ca67d424c5f35e9ad9de82ab51951682a2 --- .../azure/mgmt/containerservice/__init__.py | 19 +- .../mgmt/containerservice/_configuration.py | 68 +- .../_container_service_client.py | 178 +- .../{version.py => _version.py} | 0 .../version.py => aio/__init__.py} | 11 +- .../containerservice/aio/_configuration.py | 64 + .../aio/_container_service_client.py | 414 +++ .../azure/mgmt/containerservice/models.py | 2 +- .../azure/mgmt/containerservice/py.typed | 1 + .../containerservice/v2017_07_01/__init__.py | 19 +- .../v2017_07_01/_configuration.py | 81 +- .../v2017_07_01/_container_service_client.py | 67 +- .../v2017_07_01/_metadata.json | 60 + .../{version.py => aio/__init__.py} | 11 +- .../v2017_07_01/aio/_configuration.py | 65 + .../aio/_container_service_client.py | 63 + .../v2017_07_01/aio/operations/__init__.py | 13 + .../_container_services_operations.py | 549 ++++ .../v2017_07_01/models/__init__.py | 57 +- .../models/_container_service_client_enums.py | 416 +-- .../v2017_07_01/models/_models.py | 599 ++-- .../v2017_07_01/models/_models_py3.py | 626 ++-- .../v2017_07_01/models/_paged_models.py | 27 - .../v2017_07_01/operations/__init__.py | 7 +- .../_container_services_operations.py | 675 ++-- .../containerservice/v2017_07_01/py.typed | 1 + .../containerservice/v2018_03_31/__init__.py | 19 +- .../v2018_03_31/_configuration.py | 82 +- .../v2018_03_31/_container_service_client.py | 70 +- .../v2018_03_31/_metadata.json | 61 + .../aio/__init__.py} | 11 +- .../v2018_03_31/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 68 + .../v2018_03_31/aio/operations/__init__.py | 15 + .../_managed_clusters_operations.py | 1065 ++++++ .../v2018_03_31/aio/operations/_operations.py | 104 + .../v2018_03_31/models/__init__.py | 68 +- .../models/_container_service_client_enums.py | 444 +-- .../v2018_03_31/models/_models.py | 699 ++-- .../v2018_03_31/models/_models_py3.py | 735 +++-- .../v2018_03_31/models/_paged_models.py | 40 - .../v2018_03_31/operations/__init__.py | 7 +- .../_managed_clusters_operations.py | 1356 ++++---- .../v2018_03_31/operations/_operations.py | 119 +- .../containerservice/v2018_03_31/py.typed | 1 + .../v2018_08_01_preview/__init__.py | 19 +- .../v2018_08_01_preview/_configuration.py | 82 +- .../_container_service_client.py | 70 +- .../v2018_08_01_preview/_metadata.json | 61 + .../aio/__init__.py} | 11 +- .../v2018_08_01_preview/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 68 + .../aio/operations/__init__.py | 15 + .../_managed_clusters_operations.py | 1069 ++++++ .../aio/operations/_operations.py | 104 + .../v2018_08_01_preview/models/__init__.py | 75 +- .../models/_container_service_client_enums.py | 457 +-- .../v2018_08_01_preview/models/_models.py | 729 +++-- .../v2018_08_01_preview/models/_models_py3.py | 774 +++-- .../models/_paged_models.py | 40 - .../operations/__init__.py | 7 +- .../_managed_clusters_operations.py | 1363 ++++---- .../operations/_operations.py | 119 +- .../v2018_08_01_preview/py.typed | 1 + .../v2018_09_30_preview/__init__.py | 19 +- .../v2018_09_30_preview/_configuration.py | 82 +- .../_container_service_client.py | 68 +- .../v2018_09_30_preview/_metadata.json | 60 + .../v2018_09_30_preview/aio/__init__.py | 10 + .../v2018_09_30_preview/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 63 + .../aio/operations/__init__.py | 13 + ..._open_shift_managed_clusters_operations.py | 596 ++++ .../v2018_09_30_preview/models/__init__.py | 44 +- .../models/_container_service_client_enums.py | 128 +- .../v2018_09_30_preview/models/_models.py | 339 +- .../v2018_09_30_preview/models/_models_py3.py | 385 ++- .../models/_paged_models.py | 27 - .../operations/__init__.py | 7 +- ..._open_shift_managed_clusters_operations.py | 778 ++--- .../v2018_09_30_preview/py.typed | 1 + .../containerservice/v2019_02_01/__init__.py | 19 +- .../v2019_02_01/_configuration.py | 82 +- .../v2019_02_01/_container_service_client.py | 74 +- .../v2019_02_01/_metadata.json | 62 + .../v2019_02_01/aio/__init__.py | 10 + .../v2019_02_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 73 + .../v2019_02_01/aio/operations/__init__.py | 17 + .../aio/operations/_agent_pools_operations.py | 425 +++ .../_managed_clusters_operations.py | 1071 ++++++ .../v2019_02_01/aio/operations/_operations.py | 104 + .../v2019_02_01/models/__init__.py | 86 +- .../models/_container_service_client_enums.py | 460 +-- .../v2019_02_01/models/_models.py | 1101 +++---- .../v2019_02_01/models/_models_py3.py | 1182 ++++--- .../v2019_02_01/models/_paged_models.py | 53 - .../v2019_02_01/operations/__init__.py | 7 +- .../operations/_agent_pools_operations.py | 510 +-- .../_managed_clusters_operations.py | 1362 ++++---- .../v2019_02_01/operations/_operations.py | 119 +- .../containerservice/v2019_02_01/py.typed | 1 + .../containerservice/v2019_02_01/version.py | 13 - .../containerservice/v2019_04_01/__init__.py | 19 +- .../v2019_04_01/_configuration.py | 82 +- .../v2019_04_01/_container_service_client.py | 74 +- .../v2019_04_01/_metadata.json | 62 + .../v2019_04_01/aio/__init__.py | 10 + .../v2019_04_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 73 + .../v2019_04_01/aio/operations/__init__.py | 17 + .../aio/operations/_agent_pools_operations.py | 425 +++ .../_managed_clusters_operations.py | 1071 ++++++ .../v2019_04_01/aio/operations/_operations.py | 104 + .../v2019_04_01/models/__init__.py | 92 +- .../models/_container_service_client_enums.py | 489 +-- .../v2019_04_01/models/_models.py | 1144 +++---- .../v2019_04_01/models/_models_py3.py | 1237 +++---- .../v2019_04_01/models/_paged_models.py | 53 - .../v2019_04_01/operations/__init__.py | 7 +- .../operations/_agent_pools_operations.py | 510 +-- .../_managed_clusters_operations.py | 1362 ++++---- .../v2019_04_01/operations/_operations.py | 119 +- .../containerservice/v2019_04_01/py.typed | 1 + .../containerservice/v2019_04_01/version.py | 13 - .../containerservice/v2019_04_30/__init__.py | 19 +- .../v2019_04_30/_configuration.py | 82 +- .../v2019_04_30/_container_service_client.py | 68 +- .../v2019_04_30/_metadata.json | 60 + .../v2019_04_30/aio/__init__.py | 10 + .../v2019_04_30/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 63 + .../v2019_04_30/aio/operations/__init__.py | 13 + ..._open_shift_managed_clusters_operations.py | 596 ++++ .../v2019_04_30/models/__init__.py | 44 +- .../models/_container_service_client_enums.py | 128 +- .../v2019_04_30/models/_models.py | 335 +- .../v2019_04_30/models/_models_py3.py | 379 ++- .../v2019_04_30/models/_paged_models.py | 27 - .../v2019_04_30/operations/__init__.py | 7 +- ..._open_shift_managed_clusters_operations.py | 778 ++--- .../containerservice/v2019_04_30/py.typed | 1 + .../containerservice/v2019_04_30/version.py | 13 - .../containerservice/v2019_06_01/__init__.py | 19 +- .../v2019_06_01/_configuration.py | 82 +- .../v2019_06_01/_container_service_client.py | 74 +- .../v2019_06_01/_metadata.json | 62 + .../v2019_06_01/aio/__init__.py | 10 + .../v2019_06_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 73 + .../v2019_06_01/aio/operations/__init__.py | 17 + .../aio/operations/_agent_pools_operations.py | 550 ++++ .../_managed_clusters_operations.py | 1071 ++++++ .../v2019_06_01/aio/operations/_operations.py | 104 + .../v2019_06_01/models/__init__.py | 108 +- .../models/_container_service_client_enums.py | 516 +-- .../v2019_06_01/models/_models.py | 1260 ++++---- .../v2019_06_01/models/_models_py3.py | 1378 ++++---- .../v2019_06_01/models/_paged_models.py | 53 - .../v2019_06_01/operations/__init__.py | 7 +- .../operations/_agent_pools_operations.py | 657 ++-- .../_managed_clusters_operations.py | 1362 ++++---- .../v2019_06_01/operations/_operations.py | 119 +- .../containerservice/v2019_06_01/py.typed | 1 + .../containerservice/v2019_06_01/version.py | 13 - .../containerservice/v2019_08_01/__init__.py | 19 +- .../v2019_08_01/_configuration.py | 82 +- .../v2019_08_01/_container_service_client.py | 74 +- .../v2019_08_01/_metadata.json | 62 + .../v2019_08_01/aio/__init__.py | 10 + .../v2019_08_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 73 + .../v2019_08_01/aio/operations/__init__.py | 17 + .../aio/operations/_agent_pools_operations.py | 550 ++++ .../_managed_clusters_operations.py | 1175 +++++++ .../v2019_08_01/aio/operations/_operations.py | 104 + .../v2019_08_01/models/__init__.py | 124 +- .../models/_container_service_client_enums.py | 516 +-- .../v2019_08_01/models/_models.py | 1353 ++++---- .../v2019_08_01/models/_models_py3.py | 1492 +++++---- .../v2019_08_01/models/_paged_models.py | 53 - .../v2019_08_01/operations/__init__.py | 7 +- .../operations/_agent_pools_operations.py | 657 ++-- .../_managed_clusters_operations.py | 1491 +++++---- .../v2019_08_01/operations/_operations.py | 119 +- .../containerservice/v2019_08_01/py.typed | 1 + .../containerservice/v2019_08_01/version.py | 13 - .../v2019_09_30_preview/__init__.py | 19 +- .../v2019_09_30_preview/_configuration.py | 82 +- .../_container_service_client.py | 68 +- .../v2019_09_30_preview/_metadata.json | 60 + .../v2019_09_30_preview/aio/__init__.py | 10 + .../v2019_09_30_preview/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 63 + .../aio/operations/__init__.py | 13 + ..._open_shift_managed_clusters_operations.py | 596 ++++ .../v2019_09_30_preview/models/__init__.py | 46 +- .../models/_container_service_client_enums.py | 128 +- .../v2019_09_30_preview/models/_models.py | 353 +- .../v2019_09_30_preview/models/_models_py3.py | 401 ++- .../models/_paged_models.py | 27 - .../operations/__init__.py | 7 +- ..._open_shift_managed_clusters_operations.py | 778 ++--- .../v2019_09_30_preview/py.typed | 1 + .../v2019_09_30_preview/version.py | 13 - .../containerservice/v2019_10_01/__init__.py | 19 +- .../v2019_10_01/_configuration.py | 82 +- .../v2019_10_01/_container_service_client.py | 74 +- .../v2019_10_01/_metadata.json | 62 + .../v2019_10_01/aio/__init__.py | 10 + .../v2019_10_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 73 + .../v2019_10_01/aio/operations/__init__.py | 17 + .../aio/operations/_agent_pools_operations.py | 550 ++++ .../_managed_clusters_operations.py | 1236 +++++++ .../v2019_10_01/aio/operations/_operations.py | 104 + .../v2019_10_01/models/__init__.py | 124 +- .../models/_container_service_client_enums.py | 516 +-- .../v2019_10_01/models/_models.py | 1353 ++++---- .../v2019_10_01/models/_models_py3.py | 1492 +++++---- .../v2019_10_01/models/_paged_models.py | 53 - .../v2019_10_01/operations/__init__.py | 7 +- .../operations/_agent_pools_operations.py | 657 ++-- .../_managed_clusters_operations.py | 1566 ++++----- .../v2019_10_01/operations/_operations.py | 119 +- .../containerservice/v2019_10_01/py.typed | 1 + .../containerservice/v2019_10_01/version.py | 13 - .../v2019_10_27_preview/__init__.py | 19 +- .../v2019_10_27_preview/_configuration.py | 82 +- .../_container_service_client.py | 68 +- .../v2019_10_27_preview/_metadata.json | 60 + .../v2019_10_27_preview/aio/__init__.py | 10 + .../v2019_10_27_preview/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 63 + .../aio/operations/__init__.py | 13 + ..._open_shift_managed_clusters_operations.py | 596 ++++ .../v2019_10_27_preview/models/__init__.py | 48 +- .../models/_container_service_client_enums.py | 128 +- .../v2019_10_27_preview/models/_models.py | 357 +- .../v2019_10_27_preview/models/_models_py3.py | 407 ++- .../models/_paged_models.py | 27 - .../operations/__init__.py | 7 +- ..._open_shift_managed_clusters_operations.py | 778 ++--- .../v2019_10_27_preview/py.typed | 1 + .../v2019_10_27_preview/version.py | 13 - .../containerservice/v2019_11_01/__init__.py | 19 +- .../v2019_11_01/_configuration.py | 82 +- .../v2019_11_01/_container_service_client.py | 74 +- .../v2019_11_01/_metadata.json | 62 + .../v2019_11_01/aio/__init__.py | 10 + .../v2019_11_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 73 + .../v2019_11_01/aio/operations/__init__.py | 17 + .../aio/operations/_agent_pools_operations.py | 550 ++++ .../_managed_clusters_operations.py | 1236 +++++++ .../v2019_11_01/aio/operations/_operations.py | 104 + .../v2019_11_01/models/__init__.py | 130 +- .../models/_container_service_client_enums.py | 528 +-- .../v2019_11_01/models/_models.py | 1437 +++++---- .../v2019_11_01/models/_models_py3.py | 1594 +++++---- .../v2019_11_01/models/_paged_models.py | 53 - .../v2019_11_01/operations/__init__.py | 7 +- .../operations/_agent_pools_operations.py | 657 ++-- .../_managed_clusters_operations.py | 1566 ++++----- .../v2019_11_01/operations/_operations.py | 119 +- .../containerservice/v2019_11_01/py.typed | 1 + .../containerservice/v2019_11_01/version.py | 13 - .../containerservice/v2020_01_01/__init__.py | 19 +- .../v2020_01_01/_configuration.py | 82 +- .../v2020_01_01/_container_service_client.py | 74 +- .../v2020_01_01/_metadata.json | 62 + .../v2020_01_01/aio/__init__.py | 10 + .../v2020_01_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 73 + .../v2020_01_01/aio/operations/__init__.py | 17 + .../aio/operations/_agent_pools_operations.py | 550 ++++ .../_managed_clusters_operations.py | 1236 +++++++ .../v2020_01_01/aio/operations/_operations.py | 104 + .../v2020_01_01/models/__init__.py | 130 +- .../models/_container_service_client_enums.py | 528 +-- .../v2020_01_01/models/_models.py | 1441 +++++---- .../v2020_01_01/models/_models_py3.py | 1599 +++++---- .../v2020_01_01/models/_paged_models.py | 53 - .../v2020_01_01/operations/__init__.py | 7 +- .../operations/_agent_pools_operations.py | 657 ++-- .../_managed_clusters_operations.py | 1566 ++++----- .../v2020_01_01/operations/_operations.py | 119 +- .../containerservice/v2020_01_01/py.typed | 1 + .../containerservice/v2020_01_01/version.py | 13 - .../containerservice/v2020_02_01/__init__.py | 19 +- .../v2020_02_01/_configuration.py | 82 +- .../v2020_02_01/_container_service_client.py | 74 +- .../v2020_02_01/_metadata.json | 62 + .../v2020_02_01/aio/__init__.py | 10 + .../v2020_02_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 73 + .../v2020_02_01/aio/operations/__init__.py | 17 + .../aio/operations/_agent_pools_operations.py | 550 ++++ .../_managed_clusters_operations.py | 1236 +++++++ .../v2020_02_01/aio/operations/_operations.py | 104 + .../v2020_02_01/models/__init__.py | 136 +- .../models/_container_service_client_enums.py | 543 ++-- .../v2020_02_01/models/_models.py | 1483 ++++----- .../v2020_02_01/models/_models_py3.py | 1651 ++++++---- .../v2020_02_01/models/_paged_models.py | 53 - .../v2020_02_01/operations/__init__.py | 7 +- .../operations/_agent_pools_operations.py | 657 ++-- .../_managed_clusters_operations.py | 1566 ++++----- .../v2020_02_01/operations/_operations.py | 119 +- .../containerservice/v2020_02_01/py.typed | 1 + .../containerservice/v2020_02_01/version.py | 13 - .../containerservice/v2020_03_01/__init__.py | 19 +- .../v2020_03_01/_configuration.py | 82 +- .../v2020_03_01/_container_service_client.py | 74 +- .../v2020_03_01/_metadata.json | 62 + .../v2020_03_01/aio/__init__.py | 10 + .../v2020_03_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 73 + .../v2020_03_01/aio/operations/__init__.py | 17 + .../aio/operations/_agent_pools_operations.py | 550 ++++ .../_managed_clusters_operations.py | 1236 +++++++ .../v2020_03_01/aio/operations/_operations.py | 104 + .../v2020_03_01/models/__init__.py | 157 +- .../models/_container_service_client_enums.py | 580 ++-- .../v2020_03_01/models/_models.py | 1676 +++++----- .../v2020_03_01/models/_models_py3.py | 1876 ++++++----- .../v2020_03_01/models/_paged_models.py | 53 - .../v2020_03_01/operations/__init__.py | 7 +- .../operations/_agent_pools_operations.py | 657 ++-- .../_managed_clusters_operations.py | 1566 ++++----- .../v2020_03_01/operations/_operations.py | 119 +- .../containerservice/v2020_03_01/py.typed | 1 + .../containerservice/v2020_03_01/version.py | 13 - .../containerservice/v2020_04_01/__init__.py | 16 + .../v2020_04_01/_configuration.py | 70 + .../v2020_04_01/_container_service_client.py | 79 + .../v2020_04_01/_metadata.json | 62 + .../v2020_04_01/aio/__init__.py | 10 + .../v2020_04_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 73 + .../v2020_04_01/aio/operations/__init__.py | 17 + .../aio/operations/_agent_pools_operations.py | 550 ++++ .../_managed_clusters_operations.py | 1239 +++++++ .../v2020_04_01/aio/operations/_operations.py | 104 + .../v2020_04_01/models/__init__.py | 189 ++ .../models/_container_service_client_enums.py | 317 ++ .../v2020_04_01/models/_models.py | 2247 +++++++++++++ .../v2020_04_01/models/_models_py3.py | 2496 ++++++++++++++ .../v2020_04_01/operations/__init__.py | 17 + .../operations/_agent_pools_operations.py | 562 ++++ .../_managed_clusters_operations.py | 1263 ++++++++ .../v2020_04_01/operations/_operations.py | 109 + .../containerservice/v2020_04_01/py.typed | 1 + .../containerservice/v2020_06_01/__init__.py | 16 + .../v2020_06_01/_configuration.py | 70 + .../v2020_06_01/_container_service_client.py | 84 + .../v2020_06_01/_metadata.json | 63 + .../v2020_06_01/aio/__init__.py | 10 + .../v2020_06_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 78 + .../v2020_06_01/aio/operations/__init__.py | 19 + .../aio/operations/_agent_pools_operations.py | 550 ++++ .../_managed_clusters_operations.py | 1239 +++++++ .../v2020_06_01/aio/operations/_operations.py | 104 + ...private_endpoint_connections_operations.py | 350 ++ .../v2020_06_01/models/__init__.py | 208 ++ .../models/_container_service_client_enums.py | 336 ++ .../v2020_06_01/models/_models.py | 2415 ++++++++++++++ .../v2020_06_01/models/_models_py3.py | 2679 +++++++++++++++ .../v2020_06_01/operations/__init__.py | 19 + .../operations/_agent_pools_operations.py | 562 ++++ .../_managed_clusters_operations.py | 1263 ++++++++ .../v2020_06_01/operations/_operations.py | 109 + ...private_endpoint_connections_operations.py | 359 +++ .../containerservice/v2020_06_01/py.typed | 1 + .../containerservice/v2020_07_01/__init__.py | 16 + .../v2020_07_01/_configuration.py | 70 + .../v2020_07_01/_container_service_client.py | 84 + .../v2020_07_01/_metadata.json | 63 + .../v2020_07_01/aio/__init__.py | 10 + .../v2020_07_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 78 + .../v2020_07_01/aio/operations/__init__.py | 19 + .../aio/operations/_agent_pools_operations.py | 668 ++++ .../_managed_clusters_operations.py | 1239 +++++++ .../v2020_07_01/aio/operations/_operations.py | 104 + ...private_endpoint_connections_operations.py | 350 ++ .../v2020_07_01/models/__init__.py | 210 ++ .../models/_container_service_client_enums.py | 344 ++ .../v2020_07_01/models/_models.py | 2423 ++++++++++++++ .../v2020_07_01/models/_models_py3.py | 2685 ++++++++++++++++ .../v2020_07_01/operations/__init__.py | 19 + .../operations/_agent_pools_operations.py | 682 ++++ .../_managed_clusters_operations.py | 1263 ++++++++ .../v2020_07_01/operations/_operations.py | 109 + ...private_endpoint_connections_operations.py | 359 +++ .../containerservice/v2020_07_01/py.typed | 1 + .../containerservice/v2020_09_01/__init__.py | 16 + .../v2020_09_01/_configuration.py | 70 + .../v2020_09_01/_container_service_client.py | 94 + .../v2020_09_01/_metadata.json | 65 + .../v2020_09_01/aio/__init__.py | 10 + .../v2020_09_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 88 + .../v2020_09_01/aio/operations/__init__.py | 23 + .../aio/operations/_agent_pools_operations.py | 668 ++++ .../_managed_clusters_operations.py | 1447 +++++++++ .../v2020_09_01/aio/operations/_operations.py | 104 + ...private_endpoint_connections_operations.py | 350 ++ .../_private_link_resources_operations.py | 102 + ...olve_private_link_service_id_operations.py | 110 + .../v2020_09_01/models/__init__.py | 225 ++ .../models/_container_service_client_enums.py | 364 +++ .../v2020_09_01/models/_models.py | 2577 +++++++++++++++ .../v2020_09_01/models/_models_py3.py | 2859 +++++++++++++++++ .../v2020_09_01/operations/__init__.py | 23 + .../operations/_agent_pools_operations.py | 682 ++++ .../_managed_clusters_operations.py | 1475 +++++++++ .../v2020_09_01/operations/_operations.py | 109 + ...private_endpoint_connections_operations.py | 359 +++ .../_private_link_resources_operations.py | 107 + ...olve_private_link_service_id_operations.py | 115 + .../containerservice/v2020_09_01/py.typed | 1 + .../azure-mgmt-containerservice/setup.py | 4 +- 424 files changed, 107127 insertions(+), 33143 deletions(-) rename sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/{version.py => _version.py} (100%) rename sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/{v2018_09_30_preview/version.py => aio/__init__.py} (73%) create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/py.typed create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json rename sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/{version.py => aio/__init__.py} (73%) create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/_container_services_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/py.typed create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_metadata.json rename sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/{v2018_08_01_preview/version.py => v2018_03_31/aio/__init__.py} (73%) create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/py.typed create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_metadata.json rename sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/{v2018_03_31/version.py => v2018_08_01_preview/aio/__init__.py} (73%) create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/py.typed create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/py.typed create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/_open_shift_managed_clusters_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/_open_shift_managed_clusters_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_operations.py delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_paged_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/py.typed delete mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_container_service_client_enums.py create 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_04_01/models/_models_py3.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/py.typed create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_container_service_client_enums.py create 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_06_01/models/_models_py3.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/py.typed create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_container_service_client_enums.py create 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_07_01/models/_models_py3.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/py.typed create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_resolve_private_link_service_id_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_container_service_client_enums.py create 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_09_01/models/_models_py3.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_link_resources_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/py.typed diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/__init__.py index b7cb9d01cb16..eb3d7ba7a265 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/__init__.py @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..b1841aa34011 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_configuration.py @@ -8,43 +8,59 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration +from typing import Any -from .version import VERSION +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(ContainerServiceClientConfiguration, self).__init__(base_url) + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'azure-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 = policies.BearerTokenCredentialPolicy(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 616c4879aa2c..fc5d9bf72a0b 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 @@ -9,44 +9,44 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient +from azure.mgmt.core import ARMPipelineClient from msrest import Serializer, Deserializer from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin from ._configuration import ContainerServiceClientConfiguration +class _SDKClient(object): + def __init__(self, *args, **kwargs): + """This is a fake class to support current implemetation of MultiApiClientMixin." + Will be removed in final version of multiapi azure-core based client + """ + pass - -class ContainerServiceClient(MultiApiClientMixin, SDKClient): +class ContainerServiceClient(MultiApiClientMixin, _SDKClient): """The Container Service Client. - This ready contains multiple API versions, to help you deal with all Azure clouds + This ready contains multiple API versions, to help you deal with all of the Azure clouds (Azure Stack, Azure Government, Azure China, etc.). - By default, uses latest API version available on public Azure. - For production, you should stick a particular api-version and/or profile. - The profile sets a mapping between the operation group and an API version. + By default, it uses the latest API version available on public Azure. + For production, you should stick to a particular api-version and/or profile. + The profile sets a mapping between an operation group and its API version. The api-version parameter sets the default API version if the operation group is not described in the profile. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str api_version: API version to use if no profile is provided, or if missing in profile. :param str base_url: Service URL :param profile: A profile definition, from KnownProfiles to dict. :type profile: azure.profiles.KnownProfiles + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2020-03-01' + DEFAULT_API_VERSION = '2020-09-01' _PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -57,11 +57,20 @@ class ContainerServiceClient(MultiApiClientMixin, SDKClient): _PROFILE_TAG + " latest" ) - def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + api_version=None, + base_url=None, + profile=KnownProfiles.default, + **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__( - credentials, - self.config, api_version=api_version, profile=profile ) @@ -90,6 +99,10 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-01-01: :mod:`v2020_01_01.models` * 2020-02-01: :mod:`v2020_02_01.models` * 2020-03-01: :mod:`v2020_03_01.models` + * 2020-04-01: :mod:`v2020_04_01.models` + * 2020-06-01: :mod:`v2020_06_01.models` + * 2020-07-01: :mod:`v2020_07_01.models` + * 2020-09-01: :mod:`v2020_09_01.models` """ if api_version == '2017-07-01': from .v2017_07_01 import models @@ -139,7 +152,19 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-03-01': from .v2020_03_01 import models return models - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + elif api_version == '2020-04-01': + from .v2020_04_01 import models + return models + elif api_version == '2020-06-01': + from .v2020_06_01 import models + return models + elif api_version == '2020-07-01': + from .v2020_07_01 import models + return models + elif api_version == '2020-09-01': + from .v2020_09_01 import models + return models + raise ValueError("API version {} is not available".format(api_version)) @property def agent_pools(self): @@ -154,6 +179,10 @@ def agent_pools(self): * 2020-01-01: :class:`AgentPoolsOperations` * 2020-02-01: :class:`AgentPoolsOperations` * 2020-03-01: :class:`AgentPoolsOperations` + * 2020-04-01: :class:`AgentPoolsOperations` + * 2020-06-01: :class:`AgentPoolsOperations` + * 2020-07-01: :class:`AgentPoolsOperations` + * 2020-09-01: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -174,9 +203,17 @@ def agent_pools(self): from .v2020_02_01.operations import AgentPoolsOperations as OperationClass elif api_version == '2020-03-01': from .v2020_03_01.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-04-01': + from .v2020_04_01.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import AgentPoolsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + 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))) @property def container_services(self): @@ -188,8 +225,8 @@ def container_services(self): if api_version == '2017-07-01': from .v2017_07_01.operations import ContainerServicesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + raise ValueError("API version {} does not have operation group 'container_services'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def managed_clusters(self): @@ -206,6 +243,10 @@ def managed_clusters(self): * 2020-01-01: :class:`ManagedClustersOperations` * 2020-02-01: :class:`ManagedClustersOperations` * 2020-03-01: :class:`ManagedClustersOperations` + * 2020-04-01: :class:`ManagedClustersOperations` + * 2020-06-01: :class:`ManagedClustersOperations` + * 2020-07-01: :class:`ManagedClustersOperations` + * 2020-09-01: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -230,9 +271,17 @@ def managed_clusters(self): from .v2020_02_01.operations import ManagedClustersOperations as OperationClass elif api_version == '2020-03-01': from .v2020_03_01.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-04-01': + from .v2020_04_01.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import ManagedClustersOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + 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))) @property def open_shift_managed_clusters(self): @@ -253,8 +302,8 @@ def open_shift_managed_clusters(self): elif api_version == '2019-10-27-preview': from .v2019_10_27_preview.operations import OpenShiftManagedClustersOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + raise ValueError("API version {} does not have operation group 'open_shift_managed_clusters'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def operations(self): @@ -271,6 +320,10 @@ def operations(self): * 2020-01-01: :class:`Operations` * 2020-02-01: :class:`Operations` * 2020-03-01: :class:`Operations` + * 2020-04-01: :class:`Operations` + * 2020-06-01: :class:`Operations` + * 2020-07-01: :class:`Operations` + * 2020-09-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -295,6 +348,67 @@ def operations(self): from .v2020_02_01.operations import Operations as OperationClass elif api_version == '2020-03-01': from .v2020_03_01.operations import Operations as OperationClass + elif api_version == '2020-04-01': + from .v2020_04_01.operations import Operations as OperationClass + elif api_version == '2020-06-01': + from .v2020_06_01.operations import Operations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import Operations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.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))) + + @property + def private_endpoint_connections(self): + """Instance depends on the API version: + + * 2020-06-01: :class:`PrivateEndpointConnectionsOperations` + * 2020-07-01: :class:`PrivateEndpointConnectionsOperations` + * 2020-09-01: :class:`PrivateEndpointConnectionsOperations` + """ + api_version = self._get_api_version('private_endpoint_connections') + if api_version == '2020-06-01': + from .v2020_06_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from .v2020_07_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2020-09-01': + from .v2020_09_01.operations import PrivateEndpointConnectionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + 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))) + + @property + def private_link_resources(self): + """Instance depends on the API version: + + * 2020-09-01: :class:`PrivateLinkResourcesOperations` + """ + api_version = self._get_api_version('private_link_resources') + if api_version == '2020-09-01': + from .v2020_09_01.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))) + + @property + def resolve_private_link_service_id(self): + """Instance depends on the API version: + + * 2020-09-01: :class:`ResolvePrivateLinkServiceIdOperations` + """ + api_version = self._get_api_version('resolve_private_link_service_id') + if api_version == '2020-09-01': + from .v2020_09_01.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))) + + def close(self): + self._client.close() + def __enter__(self): + self._client.__enter__() + return self + def __exit__(self, *exc_details): + self._client.__exit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py similarity index 100% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/__init__.py similarity index 73% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/version.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/__init__.py index c48085a263da..4ad2bb20096a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/__init__.py @@ -1,13 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2018-09-30-preview" - +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..c144ffb222cf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_configuration.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + + +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, # type: "AsyncTokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'azure-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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..22abffb7ee0f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py @@ -0,0 +1,414 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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.mgmt.core import AsyncARMPipelineClient +from msrest import Serializer, Deserializer + +from azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin +from ._configuration import ContainerServiceClientConfiguration + +class _SDKClient(object): + def __init__(self, *args, **kwargs): + """This is a fake class to support current implemetation of MultiApiClientMixin." + Will be removed in final version of multiapi azure-core based client + """ + pass + +class ContainerServiceClient(MultiApiClientMixin, _SDKClient): + """The Container Service Client. + + This ready contains multiple API versions, to help you deal with all of the Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, it uses the latest API version available on public Azure. + For production, you should stick to a particular api-version and/or profile. + The profile sets a mapping between an operation group and its API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :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 str api_version: API version to use if no profile is provided, or if + missing in profile. + :param str base_url: Service URL + :param profile: A profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + DEFAULT_API_VERSION = '2020-09-01' + _PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + 'container_services': '2017-07-01', + 'open_shift_managed_clusters': '2019-04-30', + }}, + _PROFILE_TAG + " latest" + ) + + def __init__( + self, + credential, # type: "AsyncTokenCredential" + subscription_id, # type: str + api_version=None, + base_url=None, + profile=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__( + api_version=api_version, + profile=profile + ) + + @classmethod + def _models_dict(cls, api_version): + return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + + @classmethod + def models(cls, api_version=DEFAULT_API_VERSION): + """Module depends on the API version: + + * 2017-07-01: :mod:`v2017_07_01.models` + * 2018-03-31: :mod:`v2018_03_31.models` + * 2018-08-01-preview: :mod:`v2018_08_01_preview.models` + * 2018-09-30-preview: :mod:`v2018_09_30_preview.models` + * 2019-02-01: :mod:`v2019_02_01.models` + * 2019-04-01: :mod:`v2019_04_01.models` + * 2019-04-30: :mod:`v2019_04_30.models` + * 2019-06-01: :mod:`v2019_06_01.models` + * 2019-08-01: :mod:`v2019_08_01.models` + * 2019-09-30-preview: :mod:`v2019_09_30_preview.models` + * 2019-10-01: :mod:`v2019_10_01.models` + * 2019-10-27-preview: :mod:`v2019_10_27_preview.models` + * 2019-11-01: :mod:`v2019_11_01.models` + * 2020-01-01: :mod:`v2020_01_01.models` + * 2020-02-01: :mod:`v2020_02_01.models` + * 2020-03-01: :mod:`v2020_03_01.models` + * 2020-04-01: :mod:`v2020_04_01.models` + * 2020-06-01: :mod:`v2020_06_01.models` + * 2020-07-01: :mod:`v2020_07_01.models` + * 2020-09-01: :mod:`v2020_09_01.models` + """ + if api_version == '2017-07-01': + from ..v2017_07_01 import models + return models + elif api_version == '2018-03-31': + from ..v2018_03_31 import models + return models + elif api_version == '2018-08-01-preview': + from ..v2018_08_01_preview import models + return models + elif api_version == '2018-09-30-preview': + from ..v2018_09_30_preview import models + return models + elif api_version == '2019-02-01': + from ..v2019_02_01 import models + return models + elif api_version == '2019-04-01': + from ..v2019_04_01 import models + return models + elif api_version == '2019-04-30': + from ..v2019_04_30 import models + return models + elif api_version == '2019-06-01': + from ..v2019_06_01 import models + return models + elif api_version == '2019-08-01': + from ..v2019_08_01 import models + return models + elif api_version == '2019-09-30-preview': + from ..v2019_09_30_preview import models + return models + elif api_version == '2019-10-01': + from ..v2019_10_01 import models + return models + elif api_version == '2019-10-27-preview': + from ..v2019_10_27_preview import models + return models + elif api_version == '2019-11-01': + from ..v2019_11_01 import models + return models + elif api_version == '2020-01-01': + from ..v2020_01_01 import models + return models + elif api_version == '2020-02-01': + from ..v2020_02_01 import models + return models + elif api_version == '2020-03-01': + from ..v2020_03_01 import models + return models + elif api_version == '2020-04-01': + from ..v2020_04_01 import models + return models + elif api_version == '2020-06-01': + from ..v2020_06_01 import models + return models + elif api_version == '2020-07-01': + from ..v2020_07_01 import models + return models + elif api_version == '2020-09-01': + from ..v2020_09_01 import models + return models + raise ValueError("API version {} is not available".format(api_version)) + + @property + def agent_pools(self): + """Instance depends on the API version: + + * 2019-02-01: :class:`AgentPoolsOperations` + * 2019-04-01: :class:`AgentPoolsOperations` + * 2019-06-01: :class:`AgentPoolsOperations` + * 2019-08-01: :class:`AgentPoolsOperations` + * 2019-10-01: :class:`AgentPoolsOperations` + * 2019-11-01: :class:`AgentPoolsOperations` + * 2020-01-01: :class:`AgentPoolsOperations` + * 2020-02-01: :class:`AgentPoolsOperations` + * 2020-03-01: :class:`AgentPoolsOperations` + * 2020-04-01: :class:`AgentPoolsOperations` + * 2020-06-01: :class:`AgentPoolsOperations` + * 2020-07-01: :class:`AgentPoolsOperations` + * 2020-09-01: :class:`AgentPoolsOperations` + """ + api_version = self._get_api_version('agent_pools') + if api_version == '2019-02-01': + from ..v2019_02_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2019-04-01': + from ..v2019_04_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2019-06-01': + from ..v2019_06_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2019-08-01': + from ..v2019_08_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2019-10-01': + from ..v2019_10_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2019-11-01': + from ..v2019_11_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-01-01': + from ..v2020_01_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-02-01': + from ..v2020_02_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-03-01': + from ..v2020_03_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-04-01': + from ..v2020_04_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.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))) + + @property + def container_services(self): + """Instance depends on the API version: + + * 2017-07-01: :class:`ContainerServicesOperations` + """ + api_version = self._get_api_version('container_services') + if api_version == '2017-07-01': + from ..v2017_07_01.aio.operations import ContainerServicesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'container_services'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def managed_clusters(self): + """Instance depends on the API version: + + * 2018-03-31: :class:`ManagedClustersOperations` + * 2018-08-01-preview: :class:`ManagedClustersOperations` + * 2019-02-01: :class:`ManagedClustersOperations` + * 2019-04-01: :class:`ManagedClustersOperations` + * 2019-06-01: :class:`ManagedClustersOperations` + * 2019-08-01: :class:`ManagedClustersOperations` + * 2019-10-01: :class:`ManagedClustersOperations` + * 2019-11-01: :class:`ManagedClustersOperations` + * 2020-01-01: :class:`ManagedClustersOperations` + * 2020-02-01: :class:`ManagedClustersOperations` + * 2020-03-01: :class:`ManagedClustersOperations` + * 2020-04-01: :class:`ManagedClustersOperations` + * 2020-06-01: :class:`ManagedClustersOperations` + * 2020-07-01: :class:`ManagedClustersOperations` + * 2020-09-01: :class:`ManagedClustersOperations` + """ + api_version = self._get_api_version('managed_clusters') + if api_version == '2018-03-31': + from ..v2018_03_31.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2018-08-01-preview': + from ..v2018_08_01_preview.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2019-02-01': + from ..v2019_02_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2019-04-01': + from ..v2019_04_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2019-06-01': + from ..v2019_06_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2019-08-01': + from ..v2019_08_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2019-10-01': + from ..v2019_10_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2019-11-01': + from ..v2019_11_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-01-01': + from ..v2020_01_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-02-01': + from ..v2020_02_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-03-01': + from ..v2020_03_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-04-01': + from ..v2020_04_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.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))) + + @property + def open_shift_managed_clusters(self): + """Instance depends on the API version: + + * 2018-09-30-preview: :class:`OpenShiftManagedClustersOperations` + * 2019-04-30: :class:`OpenShiftManagedClustersOperations` + * 2019-09-30-preview: :class:`OpenShiftManagedClustersOperations` + * 2019-10-27-preview: :class:`OpenShiftManagedClustersOperations` + """ + api_version = self._get_api_version('open_shift_managed_clusters') + if api_version == '2018-09-30-preview': + from ..v2018_09_30_preview.aio.operations import OpenShiftManagedClustersOperations as OperationClass + elif api_version == '2019-04-30': + from ..v2019_04_30.aio.operations import OpenShiftManagedClustersOperations as OperationClass + elif api_version == '2019-09-30-preview': + from ..v2019_09_30_preview.aio.operations import OpenShiftManagedClustersOperations as OperationClass + elif api_version == '2019-10-27-preview': + from ..v2019_10_27_preview.aio.operations import OpenShiftManagedClustersOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'open_shift_managed_clusters'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def operations(self): + """Instance depends on the API version: + + * 2018-03-31: :class:`Operations` + * 2018-08-01-preview: :class:`Operations` + * 2019-02-01: :class:`Operations` + * 2019-04-01: :class:`Operations` + * 2019-06-01: :class:`Operations` + * 2019-08-01: :class:`Operations` + * 2019-10-01: :class:`Operations` + * 2019-11-01: :class:`Operations` + * 2020-01-01: :class:`Operations` + * 2020-02-01: :class:`Operations` + * 2020-03-01: :class:`Operations` + * 2020-04-01: :class:`Operations` + * 2020-06-01: :class:`Operations` + * 2020-07-01: :class:`Operations` + * 2020-09-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2018-03-31': + from ..v2018_03_31.aio.operations import Operations as OperationClass + elif api_version == '2018-08-01-preview': + from ..v2018_08_01_preview.aio.operations import Operations as OperationClass + elif api_version == '2019-02-01': + from ..v2019_02_01.aio.operations import Operations as OperationClass + elif api_version == '2019-04-01': + from ..v2019_04_01.aio.operations import Operations as OperationClass + elif api_version == '2019-06-01': + from ..v2019_06_01.aio.operations import Operations as OperationClass + elif api_version == '2019-08-01': + from ..v2019_08_01.aio.operations import Operations as OperationClass + elif api_version == '2019-10-01': + from ..v2019_10_01.aio.operations import Operations as OperationClass + elif api_version == '2019-11-01': + from ..v2019_11_01.aio.operations import Operations as OperationClass + elif api_version == '2020-01-01': + from ..v2020_01_01.aio.operations import Operations as OperationClass + elif api_version == '2020-02-01': + from ..v2020_02_01.aio.operations import Operations as OperationClass + elif api_version == '2020-03-01': + from ..v2020_03_01.aio.operations import Operations as OperationClass + elif api_version == '2020-04-01': + from ..v2020_04_01.aio.operations import Operations as OperationClass + elif api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import Operations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import Operations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.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))) + + @property + def private_endpoint_connections(self): + """Instance depends on the API version: + + * 2020-06-01: :class:`PrivateEndpointConnectionsOperations` + * 2020-07-01: :class:`PrivateEndpointConnectionsOperations` + * 2020-09-01: :class:`PrivateEndpointConnectionsOperations` + """ + api_version = self._get_api_version('private_endpoint_connections') + if api_version == '2020-06-01': + from ..v2020_06_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2020-07-01': + from ..v2020_07_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2020-09-01': + from ..v2020_09_01.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))) + + @property + def private_link_resources(self): + """Instance depends on the API version: + + * 2020-09-01: :class:`PrivateLinkResourcesOperations` + """ + api_version = self._get_api_version('private_link_resources') + if api_version == '2020-09-01': + from ..v2020_09_01.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))) + + @property + def resolve_private_link_service_id(self): + """Instance depends on the API version: + + * 2020-09-01: :class:`ResolvePrivateLinkServiceIdOperations` + """ + api_version = self._get_api_version('resolve_private_link_service_id') + if api_version == '2020-09-01': + from ..v2020_09_01.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))) + + async def close(self): + await self._client.close() + async def __aenter__(self): + await self._client.__aenter__() + return self + async def __aexit__(self, *exc_details): + await self._client.__aexit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py index d5a885e72e9b..c3a9a326a8fb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py @@ -6,4 +6,4 @@ # -------------------------------------------------------------------------- from .v2017_07_01.models import * from .v2019_04_30.models import * -from .v2020_03_01.models import * +from .v2020_09_01.models import * diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..085ca045efae 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 @@ -1,50 +1,69 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + 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 = policies.BearerTokenCredentialPolicy(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 7fd4f304e2c1..e3e244d70f85 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 @@ -1,50 +1,69 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import ContainerServicesOperations from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - - :ivar container_services: ContainerServices operations + :ivar container_services: ContainerServicesOperations operations :vartype container_services: azure.mgmt.containerservice.v2017_07_01.operations.ContainerServicesOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.container_services = ContainerServicesOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2017_07_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json new file mode 100644 index 000000000000..15336600c85a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_metadata.json @@ -0,0 +1,60 @@ +{ + "chosen_version": "2017-07-01", + "total_api_version_list": ["2017-07-01", "2019-04-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "container_services": "ContainerServicesOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/__init__.py similarity index 73% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/version.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/__init__.py index 53a203f32aaf..4ad2bb20096a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/__init__.py @@ -1,13 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "" - +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..fc5eb9216303 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..a60c8455969a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_container_service_client.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import ContainerServicesOperations +from .. import models + + +class ContainerServiceClient(object): + """The Container Service Client. + + :ivar container_services: ContainerServicesOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.container_services = ContainerServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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/v2017_07_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/__init__.py new file mode 100644 index 000000000000..db0e90a3a5aa --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_services_operations import ContainerServicesOperations + +__all__ = [ + 'ContainerServicesOperations', +] 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 new file mode 100644 index 000000000000..c81a5cd62d67 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/operations/_container_services_operations.py @@ -0,0 +1,549 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ContainerServicesOperations: + """ContainerServicesOperations 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.v2017_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.ContainerServiceListResult"]: + """Gets a list of container services in the specified subscription. + + Gets a list of container services in the specified subscription. The operation returns + properties of each container service including state, orchestrator, number of masters and + 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] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerServiceListResult"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ContainerServiceListResult', 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/containerServices'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + container_service_name: str, + parameters: "models.ContainerService", + **kwargs + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [200, 201, 202]: + 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('ContainerService', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ContainerService', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ContainerService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + container_service_name: str, + parameters: "models.ContainerService", + **kwargs + ) -> AsyncLROPoller["models.ContainerService"]: + """Creates or updates a container service. + + Creates or updates a container service with the specified configuration of orchestrator, + masters, and agents. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param container_service_name: The name of the container service in the specified subscription + and resource group. + :type container_service_name: str + :param parameters: Parameters supplied to the Create or Update a Container Service operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerService"] + lro_delay = kwargs.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, + container_service_name=container_service_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ContainerService', 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/containerServices/{containerServiceName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + container_service_name: str, + **kwargs + ) -> "models.ContainerService": + """Gets the properties of the specified container service. + + Gets the properties of the specified container service in the specified subscription and + resource group. The operation returns the properties including state, orchestrator, number of + masters and agents, and FQDNs of masters and agents. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param container_service_name: The name of the container service in the specified subscription + and resource group. + :type container_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContainerService, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerService + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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" + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ContainerService', pipeline_response) + + if cls: + 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, + container_service_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + container_service_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes the specified container service. + + Deletes the specified container service in the specified subscription and resource group. The + operation does not delete other resources created as part of creating a container service, + including storage accounts, VMs, and availability sets. All the other resources created with + the container service are part of the same resource group and can be deleted individually. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param container_service_name: The name of the container service in the specified subscription + and resource group. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + container_service_name=container_service_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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/containerServices/{containerServiceName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + operation returns properties of each container service including state, orchestrator, number of + masters and agents, and FQDNs of masters and agents. + + :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] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerServiceListResult"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ContainerServiceListResult', 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/containerServices'} # type: ignore + + async def list_orchestrators( + self, + location: str, + resource_type: Optional[str] = None, + **kwargs + ) -> "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 + properties of each orchestrator including version, available upgrades and whether that version + or upgrades are in preview. + + :param location: The name of a supported Azure region. + :type location: str + :param resource_type: resource type for which the list of orchestrators needs to be returned. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OrchestratorVersionProfileListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorVersionProfileListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OrchestratorVersionProfileListResult"] + 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.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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OrchestratorVersionProfileListResult', pipeline_response) + + if cls: + 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 5dde1bef5161..756ee52d39f6 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 @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- try: @@ -15,9 +12,10 @@ 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 ContainerServiceServicePrincipalProfile + from ._models_py3 import ContainerServicePrincipalProfile from ._models_py3 import ContainerServiceSshConfiguration from ._models_py3 import ContainerServiceSshPublicKey from ._models_py3 import ContainerServiceVMDiagnostics @@ -28,28 +26,30 @@ from ._models_py3 import OrchestratorVersionProfileListResult from ._models_py3 import Resource except (SyntaxError, ImportError): - from ._models import ContainerService - from ._models import ContainerServiceAgentPoolProfile - from ._models import ContainerServiceCustomProfile - from ._models import ContainerServiceDiagnosticsProfile - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceOrchestratorProfile - from ._models import ContainerServiceServicePrincipalProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import ContainerServiceWindowsProfile - from ._models import KeyVaultSecretRef - from ._models import OrchestratorProfile - from ._models import OrchestratorVersionProfile - from ._models import OrchestratorVersionProfileListResult - from ._models import Resource -from ._paged_models import ContainerServicePaged + 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 ._container_service_client_enums import ( + ContainerServiceOrchestratorTypes, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - ContainerServiceOrchestratorTypes, + Count, OSType, ) @@ -59,9 +59,10 @@ 'ContainerServiceCustomProfile', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', + 'ContainerServiceListResult', 'ContainerServiceMasterProfile', 'ContainerServiceOrchestratorProfile', - 'ContainerServiceServicePrincipalProfile', + 'ContainerServicePrincipalProfile', 'ContainerServiceSshConfiguration', 'ContainerServiceSshPublicKey', 'ContainerServiceVMDiagnostics', @@ -71,9 +72,9 @@ 'OrchestratorVersionProfile', 'OrchestratorVersionProfileListResult', 'Resource', - 'ContainerServicePaged', + 'ContainerServiceOrchestratorTypes', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'ContainerServiceOrchestratorTypes', + 'Count', 'OSType', ] 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 d35c6bd6a364..a14dea47c37f 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 @@ -1,211 +1,241 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) -class ContainerServiceStorageProfileTypes(str, Enum): + 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) - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" +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. + """ -class ContainerServiceVMSizeTypes(str, Enum): + KUBERNETES = "Kubernetes" + SWARM = "Swarm" + DCOS = "DCOS" + DOCKER_CE = "DockerCE" + CUSTOM = "Custom" - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" +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. + """ + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" -class ContainerServiceOrchestratorTypes(str, Enum): +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ - kubernetes = "Kubernetes" - swarm = "Swarm" - dcos = "DCOS" - docker_ce = "DockerCE" - custom = "Custom" + 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. + """ -class OSType(str, Enum): + ONE = 1 + THREE = 3 + FIVE = 5 - linux = "Linux" - windows = "Windows" +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" 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 index f0233fd4b406..f4993afd77c5 100644 --- 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 @@ -1,42 +1,30 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +import msrest.serialization -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -55,65 +43,62 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :ivar provisioning_state: The current deployment or provisioning state, which only appears in + the response. :vartype provisioning_state: str - :param orchestrator_profile: Required. Profile for the container service - orchestrator. + :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. + :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. + :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.ContainerServiceServicePrincipalProfile - :param master_profile: Required. Profile for the container service master. + ~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. + :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: Required. Profile for Linux VMs in the container - service cluster. + :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. + :param diagnostics_profile: Profile for diagnostics in the container service cluster. :type diagnostics_profile: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceDiagnosticsProfile """ @@ -124,9 +109,6 @@ class ContainerService(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, - 'orchestrator_profile': {'required': True}, - 'master_profile': {'required': True}, - 'linux_profile': {'required': True}, } _attribute_map = { @@ -138,7 +120,7 @@ class ContainerService(Resource): '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': 'ContainerServiceServicePrincipalProfile'}, + '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'}, @@ -146,7 +128,10 @@ class ContainerService(Resource): 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'ContainerServiceDiagnosticsProfile'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerService, self).__init__(**kwargs) self.provisioning_state = None self.orchestrator_profile = kwargs.get('orchestrator_profile', None) @@ -159,106 +144,87 @@ def __init__(self, **kwargs): self.diagnostics_profile = kwargs.get('diagnostics_profile', None) -class ContainerServiceAgentPoolProfile(Model): +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. + Variables are only 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. + :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. . Default value: 1 . + :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' + :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. + :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. + :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. + :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' + :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. + :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 + :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}, } @@ -275,11 +241,14 @@ class ContainerServiceAgentPoolProfile(Model): 'os_type': {'key': 'osType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] self.count = kwargs.get('count', 1) - self.vm_size = kwargs.get('vm_size', None) + 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 @@ -289,7 +258,7 @@ def __init__(self, **kwargs): self.os_type = kwargs.get('os_type', "Linux") -class ContainerServiceCustomProfile(Model): +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. @@ -306,18 +275,20 @@ class ContainerServiceCustomProfile(Model): 'orchestrator': {'key': 'orchestrator', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceCustomProfile, self).__init__(**kwargs) - self.orchestrator = kwargs.get('orchestrator', None) + self.orchestrator = kwargs['orchestrator'] -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMDiagnostics """ @@ -330,23 +301,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -359,93 +330,108 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + 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}, + } -class ContainerServiceMasterProfile(Model): + _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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -455,6 +441,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -469,11 +456,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -481,20 +471,18 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceOrchestratorProfile(Model): +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' + :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". + :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 """ @@ -507,28 +495,26 @@ class ContainerServiceOrchestratorProfile(Model): 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceOrchestratorProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs.get('orchestrator_type', None) + self.orchestrator_type = kwargs['orchestrator_type'] self.orchestrator_version = kwargs.get('orchestrator_version', None) -class ContainerServiceServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. Either secret or keyVaultSecretRef must be - specified. +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. + :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 + :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 = { @@ -541,20 +527,23 @@ class ContainerServiceServicePrincipalProfile(Model): 'key_vault_secret_ref': {'key': 'keyVaultSecretRef', 'type': 'KeyVaultSecretRef'}, } - def __init__(self, **kwargs): - super(ContainerServiceServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + 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(Model): +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. + :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] """ @@ -567,19 +556,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -591,24 +582,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -622,22 +613,23 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class ContainerServiceWindowsProfile(Model): +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. + :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. + :param admin_password: Required. The administrator password to use for Windows VMs. :type admin_password: str """ @@ -651,13 +643,16 @@ class ContainerServiceWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.admin_password = kwargs.get('admin_password', None) + self.admin_username = kwargs['admin_username'] + self.admin_password = kwargs['admin_password'] -class KeyVaultSecretRef(Model): +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. @@ -681,22 +676,24 @@ class KeyVaultSecretRef(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(KeyVaultSecretRef, self).__init__(**kwargs) - self.vault_id = kwargs.get('vault_id', None) - self.secret_name = kwargs.get('secret_name', None) + self.vault_id = kwargs['vault_id'] + self.secret_name = kwargs['secret_name'] self.version = kwargs.get('version', None) -class OrchestratorProfile(Model): +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). + :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 @@ -712,30 +709,31 @@ class OrchestratorProfile(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = kwargs.get('orchestrator_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.orchestrator_version = kwargs['orchestrator_version'] self.is_preview = kwargs.get('is_preview', None) -class OrchestratorVersionProfile(Model): +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). + :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] + :type upgrades: list[~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorProfile] """ _validation = { @@ -751,20 +749,22 @@ class OrchestratorVersionProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[OrchestratorProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OrchestratorVersionProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs.get('orchestrator_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) + 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(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -793,9 +793,12 @@ class OrchestratorVersionProfileListResult(Model): 'orchestrators': {'key': 'properties.orchestrators', 'type': '[OrchestratorVersionProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OrchestratorVersionProfileListResult, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.orchestrators = kwargs.get('orchestrators', 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 84be95168fa0..ee4699aca38d 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 @@ -1,42 +1,34 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from typing import Dict, List, Optional, Union +import msrest.serialization -class CloudError(Model): - """CloudError. - """ +from ._container_service_client_enums import * - _attribute_map = { - } - -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -55,7 +47,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -67,53 +65,47 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ContainerService(Resource): """Container service. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :ivar provisioning_state: The current deployment or provisioning state, which only appears in + the response. :vartype provisioning_state: str - :param orchestrator_profile: Required. Profile for the container service - orchestrator. + :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. + :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. + :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.ContainerServiceServicePrincipalProfile - :param master_profile: Required. Profile for the container service master. + ~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. + :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: Required. Profile for Linux VMs in the container - service cluster. + :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. + :param diagnostics_profile: Profile for diagnostics in the container service cluster. :type diagnostics_profile: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceDiagnosticsProfile """ @@ -124,9 +116,6 @@ class ContainerService(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, - 'orchestrator_profile': {'required': True}, - 'master_profile': {'required': True}, - 'linux_profile': {'required': True}, } _attribute_map = { @@ -138,7 +127,7 @@ class ContainerService(Resource): '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': 'ContainerServiceServicePrincipalProfile'}, + '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'}, @@ -146,7 +135,21 @@ class ContainerService(Resource): 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'ContainerServiceDiagnosticsProfile'}, } - def __init__(self, *, location: str, orchestrator_profile, master_profile, linux_profile, tags=None, custom_profile=None, service_principal_profile=None, agent_pool_profiles=None, windows_profile=None, diagnostics_profile=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + orchestrator_profile: Optional["ContainerServiceOrchestratorProfile"] = None, + custom_profile: Optional["ContainerServiceCustomProfile"] = None, + service_principal_profile: Optional["ContainerServicePrincipalProfile"] = None, + master_profile: Optional["ContainerServiceMasterProfile"] = None, + agent_pool_profiles: Optional[List["ContainerServiceAgentPoolProfile"]] = None, + windows_profile: Optional["ContainerServiceWindowsProfile"] = None, + linux_profile: Optional["ContainerServiceLinuxProfile"] = None, + diagnostics_profile: Optional["ContainerServiceDiagnosticsProfile"] = None, + **kwargs + ): super(ContainerService, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.orchestrator_profile = orchestrator_profile @@ -159,106 +162,87 @@ def __init__(self, *, location: str, orchestrator_profile, master_profile, linux self.diagnostics_profile = diagnostics_profile -class ContainerServiceAgentPoolProfile(Model): +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. + Variables are only 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. + :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. . Default value: 1 . + :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' + :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. + :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. + :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. + :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' + :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. + :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 + :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}, } @@ -275,7 +259,20 @@ class ContainerServiceAgentPoolProfile(Model): 'os_type': {'key': 'osType', 'type': 'str'}, } - def __init__(self, *, name: str, vm_size, count: int=1, os_disk_size_gb: int=None, dns_prefix: str=None, ports=None, storage_profile=None, vnet_subnet_id: str=None, os_type="Linux", **kwargs) -> None: + def __init__( + self, + *, + name: str, + vm_size: Union[str, "ContainerServiceVMSizeTypes"], + count: Optional[int] = 1, + os_disk_size_gb: Optional[int] = None, + dns_prefix: Optional[str] = None, + ports: Optional[List[int]] = None, + storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, + vnet_subnet_id: Optional[str] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + **kwargs + ): super(ContainerServiceAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -289,7 +286,7 @@ def __init__(self, *, name: str, vm_size, count: int=1, os_disk_size_gb: int=Non self.os_type = os_type -class ContainerServiceCustomProfile(Model): +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. @@ -306,18 +303,22 @@ class ContainerServiceCustomProfile(Model): 'orchestrator': {'key': 'orchestrator', 'type': 'str'}, } - def __init__(self, *, orchestrator: str, **kwargs) -> None: + def __init__( + self, + *, + orchestrator: str, + **kwargs + ): super(ContainerServiceCustomProfile, self).__init__(**kwargs) self.orchestrator = orchestrator -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMDiagnostics """ @@ -330,23 +331,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -359,93 +362,113 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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, + *, + value: Optional[List["ContainerService"]] = None, + **kwargs + ): + super(ContainerServiceListResult, self).__init__(**kwargs) + self.value = value + 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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -455,6 +478,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -469,7 +493,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -481,20 +516,18 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceOrchestratorProfile(Model): +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' + :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". + :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 """ @@ -507,28 +540,29 @@ class ContainerServiceOrchestratorProfile(Model): 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, } - def __init__(self, *, orchestrator_type, orchestrator_version: str=None, **kwargs) -> None: + def __init__( + self, + *, + orchestrator_type: Union[str, "ContainerServiceOrchestratorTypes"], + orchestrator_version: Optional[str] = None, + **kwargs + ): super(ContainerServiceOrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version -class ContainerServiceServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. Either secret or keyVaultSecretRef must be - specified. +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. + :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 + :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 = { @@ -541,20 +575,27 @@ class ContainerServiceServicePrincipalProfile(Model): 'key_vault_secret_ref': {'key': 'keyVaultSecretRef', 'type': 'KeyVaultSecretRef'}, } - def __init__(self, *, client_id: str, secret: str=None, key_vault_secret_ref=None, **kwargs) -> None: - super(ContainerServiceServicePrincipalProfile, self).__init__(**kwargs) + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + key_vault_secret_ref: Optional["KeyVaultSecretRef"] = None, + **kwargs + ): + super(ContainerServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret self.key_vault_secret_ref = key_vault_secret_ref -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -567,19 +608,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -591,24 +636,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -622,22 +669,25 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class ContainerServiceWindowsProfile(Model): +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. + :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. + :param admin_password: Required. The administrator password to use for Windows VMs. :type admin_password: str """ @@ -651,13 +701,19 @@ class ContainerServiceWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: str, + **kwargs + ): super(ContainerServiceWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class KeyVaultSecretRef(Model): +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. @@ -681,22 +737,28 @@ class KeyVaultSecretRef(Model): 'version': {'key': 'version', 'type': 'str'}, } - def __init__(self, *, vault_id: str, secret_name: str, version: str=None, **kwargs) -> None: + def __init__( + self, + *, + vault_id: str, + secret_name: str, + version: Optional[str] = None, + **kwargs + ): super(KeyVaultSecretRef, self).__init__(**kwargs) self.vault_id = vault_id self.secret_name = secret_name self.version = version -class OrchestratorProfile(Model): +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). + :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 @@ -712,30 +774,35 @@ class OrchestratorProfile(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, orchestrator_version: str, orchestrator_type: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + orchestrator_version: str, + orchestrator_type: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version self.is_preview = is_preview -class OrchestratorVersionProfile(Model): +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). + :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] + :type upgrades: list[~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorProfile] """ _validation = { @@ -751,7 +818,16 @@ class OrchestratorVersionProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[OrchestratorProfile]'}, } - def __init__(self, *, orchestrator_type: str, orchestrator_version: str, default: bool=None, is_preview: bool=None, upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + orchestrator_type: str, + orchestrator_version: str, + default: Optional[bool] = None, + is_preview: Optional[bool] = None, + upgrades: Optional[List["OrchestratorProfile"]] = None, + **kwargs + ): super(OrchestratorVersionProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version @@ -760,11 +836,10 @@ def __init__(self, *, orchestrator_type: str, orchestrator_version: str, default self.upgrades = upgrades -class OrchestratorVersionProfileListResult(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -793,7 +868,12 @@ class OrchestratorVersionProfileListResult(Model): 'orchestrators': {'key': 'properties.orchestrators', 'type': '[OrchestratorVersionProfile]'}, } - def __init__(self, *, orchestrators, **kwargs) -> None: + def __init__( + self, + *, + orchestrators: List["OrchestratorVersionProfile"], + **kwargs + ): 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/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_paged_models.py deleted file mode 100644 index c01ddcc4c9e5..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/models/_paged_models.py +++ /dev/null @@ -1,27 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ContainerServicePaged(Paged): - """ - A paging container for iterating over a list of :class:`ContainerService ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ContainerService]'} - } - - def __init__(self, *args, **kwargs): - - super(ContainerServicePaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/__init__.py index bb6a811e4427..db0e90a3a5aa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._container_services_operations import ContainerServicesOperations 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 459db70d613e..e7baee5ae24d 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 @@ -1,28 +1,38 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ContainerServicesOperations(object): """ContainerServicesOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2017_07_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -32,501 +42,520 @@ class ContainerServicesOperations(object): models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each container service including state, - orchestrator, number of masters and agents, and FQDNs of masters and - agents. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ContainerService - :rtype: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServicePaged[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] - :raises: :class:`CloudError` + Gets a list of container services in the specified subscription. The operation returns + properties of each container service including state, orchestrator, number of masters and + 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] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerServiceListResult"] + error_map = { + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} + query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('ContainerServiceListResult', 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ContainerServicePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices'} + return pipeline_response + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices'} # type: ignore def _create_or_update_initial( - self, resource_group_name, container_service_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + container_service_name, # type: str + parameters, # type: "models.ContainerService" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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') + '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 = {} + query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ContainerService') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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('ContainerService', response) + deserialized = self._deserialize('ContainerService', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ContainerService', response) + deserialized = self._deserialize('ContainerService', pipeline_response) + if response.status_code == 202: - deserialized = self._deserialize('ContainerService', response) + deserialized = self._deserialize('ContainerService', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, container_service_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore + + 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"] """Creates or updates a container service. - Creates or updates a container service with the specified configuration - of orchestrator, masters, and agents. + Creates or updates a container service with the specified configuration of orchestrator, + masters, and agents. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param container_service_name: The name of the container service in - the specified subscription and resource group. + :param container_service_name: The name of the container service in the specified subscription + and resource group. :type container_service_name: str - :param parameters: Parameters supplied to the Create or Update a - Container Service operation. - :type parameters: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerService - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Container Service operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ContainerService or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - container_service_name=container_service_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ContainerService', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + container_service_name=container_service_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ContainerService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} + 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/containerServices/{containerServiceName}'} # type: ignore def get( - self, resource_group_name, container_service_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + container_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ContainerService" """Gets the properties of the specified container service. - Gets the properties of the specified container service in the specified - subscription and resource group. The operation returns the properties - including state, orchestrator, number of masters and agents, and FQDNs - of masters and agents. . + Gets the properties of the specified container service in the specified subscription and + resource group. The operation returns the properties including state, orchestrator, number of + masters and agents, and FQDNs of masters and agents. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param container_service_name: The name of the container service in - the specified subscription and resource group. + :param container_service_name: The name of the container service in the specified subscription + and resource group. :type container_service_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ContainerService or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerService or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContainerService, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerService + :raises: ~azure.core.exceptions.HttpResponseError """ + 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" + accept = "application/json" # Construct URL - url = self.get.metadata['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') + '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 = {} + query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ContainerService', response) + deserialized = self._deserialize('ContainerService', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore def _delete_initial( - self, resource_group_name, container_service_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + container_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) api_version = "2017-07-01" # Construct URL - url = self.delete.metadata['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') + '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 = {} + query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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, {}) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} # type: ignore - def delete( - self, resource_group_name, container_service_name, custom_headers=None, raw=False, polling=True, **operation_config): + def begin_delete( + self, + resource_group_name, # type: str + container_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes the specified container service. - Deletes the specified container service in the specified subscription - and resource group. The operation does not delete other resources - created as part of creating a container service, including storage - accounts, VMs, and availability sets. All the other resources created - with the container service are part of the same resource group and can - be deleted individually. + Deletes the specified container service in the specified subscription and resource group. The + operation does not delete other resources created as part of creating a container service, + including storage accounts, VMs, and availability sets. All the other resources created with + the container service are part of the same resource group and can be deleted individually. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param container_service_name: The name of the container service in - the specified subscription and resource group. + :param container_service_name: The name of the container service in the specified subscription + and resource group. :type container_service_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - container_service_name=container_service_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + container_service_name=container_service_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'} + 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/containerServices/{containerServiceName}'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 operation returns properties of each container - service including state, orchestrator, number of masters and agents, - and FQDNs of masters and agents. + Gets a list of container services in the specified subscription and resource group. The + operation returns properties of each container service including state, orchestrator, number of + masters and agents, and FQDNs of masters and agents. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ContainerService - :rtype: - ~azure.mgmt.containerservice.v2017_07_01.models.ContainerServicePaged[~azure.mgmt.containerservice.v2017_07_01.models.ContainerService] - :raises: :class:`CloudError` + :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] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ContainerServiceListResult"] + error_map = { + 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'] + 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') + '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 = {} + query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('ContainerServiceListResult', 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ContainerServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices'} # type: ignore def list_orchestrators( - self, location, resource_type=None, custom_headers=None, raw=False, **operation_config): + self, + location, # type: str + resource_type=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "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 properties of each orchestrator including - version, available upgrades and whether that version or upgrades are in - preview. + Gets a list of supported orchestrators in the specified subscription. The operation returns + properties of each orchestrator including version, available upgrades and whether that version + or upgrades are in preview. :param location: The name of a supported Azure region. :type location: str - :param resource_type: resource type for which the list of - orchestrators needs to be returned + :param resource_type: resource type for which the list of orchestrators needs to be returned. :type resource_type: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OrchestratorVersionProfileListResult or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorVersionProfileListResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OrchestratorVersionProfileListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorVersionProfileListResult + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OrchestratorVersionProfileListResult"] + 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.list_orchestrators.metadata['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') + '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 = {} + 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 = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('OrchestratorVersionProfileListResult', response) + deserialized = self._deserialize('OrchestratorVersionProfileListResult', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - list_orchestrators.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators'} + 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/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..a872f97a5b73 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2018-03-31" + 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 = policies.BearerTokenCredentialPolicy(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 345301cbe8a8..a69f766d36f6 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -18,39 +23,52 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2018_03_31.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2018_03_31.operations.ManagedClustersOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2018-03-31' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2018_03_31/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_metadata.json new file mode 100644 index 000000000000..75995e495458 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_metadata.json @@ -0,0 +1,61 @@ +{ + "chosen_version": "2018-03-31", + "total_api_version_list": ["2018-03-31"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/__init__.py similarity index 73% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/version.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/__init__.py index 391827c689e9..4ad2bb20096a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/__init__.py @@ -1,13 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2018-08-01-preview" - +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..4d7a9d2af15e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2018-03-31" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..ac2eef1b850b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_container_service_client.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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/v2018_03_31/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/__init__.py new file mode 100644 index 000000000000..77613c407d74 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/__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 ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', +] 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 new file mode 100644 index 000000000000..4317444c267b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1065 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2018_03_31.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2018_03_31.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2018_03_31.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2018_03_31.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2018_03_31.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2018_03_31.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + 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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + 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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 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 new file mode 100644 index 000000000000..c361c6e09f35 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2018_03_31.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2018_03_31/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/__init__.py index 676d1e95d221..385fd0835eab 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 @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- try: @@ -25,44 +22,48 @@ 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 - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import ContainerServiceWindowsProfile - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterUpgradeProfile - from ._models import OperationValue - from ._models import OrchestratorProfile - from ._models import Resource - from ._models import TagsObject -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, + Count, NetworkPlugin, NetworkPolicy, + OSType, ) __all__ = [ @@ -81,18 +82,19 @@ 'ManagedClusterAccessProfile', 'ManagedClusterAddonProfile', 'ManagedClusterAgentPoolProfile', + 'ManagedClusterListResult', 'ManagedClusterPoolUpgradeProfile', 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', + 'OperationListResult', 'OperationValue', 'OrchestratorProfile', 'Resource', 'TagsObject', - 'OperationValuePaged', - 'ManagedClusterPaged', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', + 'Count', 'NetworkPlugin', 'NetworkPolicy', + 'OSType', ] 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 85b62a2c1805..0ad42f25cc34 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 @@ -1,213 +1,243 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class 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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network policy used for building Kubernetes network. + """ + + CALICO = "calico" + +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" 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 index f9b40c38cd0a..f6f3b9bc5b08 100644 --- 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 @@ -1,32 +1,20 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +import msrest.serialization -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMDiagnostics """ @@ -39,23 +27,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceSshConfiguration """ _validation = { @@ -68,93 +56,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -164,6 +138,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -178,11 +153,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -190,32 +168,25 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 """ @@ -235,7 +206,10 @@ class ContainerServiceNetworkProfile(Model): 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -245,13 +219,13 @@ def __init__(self, **kwargs): self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -264,19 +238,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -288,24 +264,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -319,22 +295,23 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class ContainerServiceWindowsProfile(Model): +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. + :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. + :param admin_password: Required. The administrator password to use for Windows VMs. :type admin_password: str """ @@ -348,17 +325,19 @@ class ContainerServiceWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.admin_password = kwargs.get('admin_password', None) + self.admin_username = kwargs['admin_username'] + self.admin_password = kwargs['admin_password'] -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -376,21 +355,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2018_03_31.models.CredentialResult] """ _validation = { @@ -401,28 +381,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -441,70 +423,67 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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. + :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. + :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. + :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. + :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 + :type aad_profile: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAADProfile """ _validation = { @@ -537,7 +516,10 @@ class ManagedCluster(Resource): 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedCluster, self).__init__(**kwargs) self.provisioning_state = None self.kubernetes_version = kwargs.get('kubernetes_version', None) @@ -553,7 +535,7 @@ def __init__(self, **kwargs): self.aad_profile = kwargs.get('aad_profile', None) -class ManagedClusterAADProfile(Model): +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. @@ -564,8 +546,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -581,10 +563,13 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) + 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) @@ -592,20 +577,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -627,12 +611,15 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. @@ -652,105 +639,90 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) -class ManagedClusterAgentPoolProfile(Model): +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. + Variables are only 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. + :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. . Default value: 1 . + :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' + :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. + :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' + :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. + :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 + :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}, } @@ -765,11 +737,14 @@ class ManagedClusterAgentPoolProfile(Model): 'os_type': {'key': 'osType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] self.count = kwargs.get('count', 1) - self.vm_size = kwargs.get('vm_size', None) + 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) @@ -777,23 +752,48 @@ def __init__(self, **kwargs): self.os_type = kwargs.get('os_type', "Linux") -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -809,24 +809,25 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -839,17 +840,19 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -859,12 +862,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -885,20 +887,47 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', 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(Model): +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. + 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 @@ -932,7 +961,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -942,15 +974,14 @@ def __init__(self, **kwargs): self.provider = None -class OrchestratorProfile(Model): +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). + :param orchestrator_version: Required. Orchestrator version (major, minor, patch). :type orchestrator_version: str """ @@ -964,16 +995,19 @@ class OrchestratorProfile(Model): 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OrchestratorProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs.get('orchestrator_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.orchestrator_type = kwargs['orchestrator_type'] + self.orchestrator_version = kwargs['orchestrator_version'] -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -981,6 +1015,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 1defb9f546fb..061214a2b5d3 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 @@ -1,32 +1,24 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from typing import Dict, List, Optional, Union +import msrest.serialization -class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } +from ._container_service_client_enums import * -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMDiagnostics """ @@ -39,23 +31,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceSshConfiguration """ _validation = { @@ -68,93 +62,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -164,6 +147,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -178,7 +162,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -190,32 +185,25 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 """ @@ -235,7 +223,17 @@ class ContainerServiceNetworkProfile(Model): 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", **kwargs) -> None: + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = 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", + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -245,13 +243,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: s self.docker_bridge_cidr = docker_bridge_cidr -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -264,19 +262,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -288,24 +290,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -319,22 +323,25 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class ContainerServiceWindowsProfile(Model): +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. + :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. + :param admin_password: Required. The administrator password to use for Windows VMs. :type admin_password: str """ @@ -348,17 +355,22 @@ class ContainerServiceWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: str, + **kwargs + ): super(ContainerServiceWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -376,21 +388,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2018_03_31.models.CredentialResult] """ _validation = { @@ -401,28 +414,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -441,7 +456,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -453,58 +474,52 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ManagedCluster(Resource): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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. + :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. + :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. + :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. + :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 + :type aad_profile: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAADProfile """ _validation = { @@ -537,7 +552,22 @@ class ManagedCluster(Resource): 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, } - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, service_principal_profile=None, addon_profiles=None, enable_rbac: bool=None, network_profile=None, aad_profile=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: Optional[str] = None, + agent_pool_profiles: Optional[List["ManagedClusterAgentPoolProfile"]] = None, + linux_profile: Optional["ContainerServiceLinuxProfile"] = None, + service_principal_profile: Optional["ManagedClusterServicePrincipalProfile"] = None, + addon_profiles: Optional[Dict[str, "ManagedClusterAddonProfile"]] = None, + enable_rbac: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + **kwargs + ): super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.kubernetes_version = kubernetes_version @@ -553,7 +583,7 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.aad_profile = aad_profile -class ManagedClusterAADProfile(Model): +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. @@ -564,8 +594,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -581,7 +611,15 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_app_id: str, + server_app_id: str, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -592,20 +630,19 @@ def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -627,12 +664,19 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. @@ -652,105 +696,93 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config -class ManagedClusterAgentPoolProfile(Model): +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. + Variables are only 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. + :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. . Default value: 1 . + :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' + :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. + :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' + :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. + :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 + :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}, } @@ -765,7 +797,18 @@ class ManagedClusterAgentPoolProfile(Model): 'os_type': {'key': 'osType', 'type': 'str'}, } - def __init__(self, *, name: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", **kwargs) -> None: + def __init__( + self, + *, + name: str, + vm_size: Union[str, "ContainerServiceVMSizeTypes"], + count: Optional[int] = 1, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -777,23 +820,50 @@ def __init__(self, *, name: str, vm_size, count: int=1, os_disk_size_gb: int=Non self.os_type = os_type -class ManagedClusterPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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). + :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. + :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] """ @@ -809,7 +879,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[str]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List[str]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -817,16 +895,14 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -839,17 +915,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -859,12 +940,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -885,7 +965,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -894,11 +980,35 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class OperationValue(Model): +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. + 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 @@ -932,7 +1042,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -942,15 +1055,14 @@ def __init__(self, **kwargs) -> None: self.provider = None -class OrchestratorProfile(Model): +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). + :param orchestrator_version: Required. Orchestrator version (major, minor, patch). :type orchestrator_version: str """ @@ -964,16 +1076,22 @@ class OrchestratorProfile(Model): 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, } - def __init__(self, *, orchestrator_type: str, orchestrator_version: str, **kwargs) -> None: + def __init__( + self, + *, + orchestrator_type: str, + orchestrator_version: str, + **kwargs + ): super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -981,6 +1099,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_paged_models.py deleted file mode 100644 index 6e911420f098..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models/_paged_models.py +++ /dev/null @@ -1,40 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/__init__.py index 79e636fac619..77613c407d74 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 87450fc91d44..795f84b75bda 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 @@ -1,677 +1,696 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2018_03_31.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. - :ivar api_version: Client Api Version. Constant value: "2018-03-31". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-31" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2018_03_31.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', {})) + api_version = "2018-03-31" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2018_03_31.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', {})) + api_version = "2018-03-31" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2018_03_31.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2018_03_31.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', {})) + api_version = "2018-03-31" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2018_03_31.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2018_03_31.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', {})) + api_version = "2018-03-31" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true + :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.v2018_03_31.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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', {})) + api_version = "2018-03-31" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -680,88 +699,108 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-03-31" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -770,85 +809,109 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-03-31" + content_type = kwargs.pop("content_type", "application/json") # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -857,90 +920,113 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-03-31" + content_type = kwargs.pop("content_type", "application/json") + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -949,40 +1035,52 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} + 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 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 dd4daed460d3..a33632834670 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2018_03_31.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. - :ivar api_version: Client Api Version. Constant value: "2018-03-31". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-03-31" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2018_03_31.models.OperationValuePaged[~azure.mgmt.containerservice.v2018_03_31.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2018_03_31/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..7e911e15153f 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2018-08-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 = policies.BearerTokenCredentialPolicy(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 eeb8d0e1b1fd..fc0f33a90ad5 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -18,39 +23,52 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2018_08_01_preview.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2018_08_01_preview.operations.ManagedClustersOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2018-08-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2018_08_01_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_metadata.json new file mode 100644 index 000000000000..0b92e57bc172 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_metadata.json @@ -0,0 +1,61 @@ +{ + "chosen_version": "2018-08-01-preview", + "total_api_version_list": ["2018-08-01-preview"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/__init__.py similarity index 73% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/version.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/__init__.py index f11baca339b2..4ad2bb20096a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/__init__.py @@ -1,13 +1,10 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2018-03-31" - +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..a1c6f5c83665 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2018-08-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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..13413b43c5dd --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_container_service_client.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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/v2018_08_01_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..77613c407d74 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/__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 ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', +] 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 new file mode 100644 index 000000000000..db95ff38d305 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1069 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2018_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2018_08_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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2018_08_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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2018_08_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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2018_08_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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2018_08_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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 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 new file mode 100644 index 000000000000..b142692452f4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2018_08_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2018_08_01_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/__init__.py index 10e9310d7559..5db8537cc98f 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 @@ -1,15 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -25,48 +23,54 @@ 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 - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import ContainerServiceWindowsProfile - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterUpgradeProfile - from ._models import OperationValue - from ._models import OrchestratorProfile - from ._models import Resource - from ._models import TagsObject -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( + AgentPoolType, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, - AgentPoolType, + Count, NetworkPlugin, NetworkPolicy, + OSType, ) __all__ = [ + 'CloudErrorBody', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', 'ContainerServiceMasterProfile', @@ -82,19 +86,20 @@ 'ManagedClusterAccessProfile', 'ManagedClusterAddonProfile', 'ManagedClusterAgentPoolProfile', + 'ManagedClusterListResult', 'ManagedClusterPoolUpgradeProfile', 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', + 'OperationListResult', 'OperationValue', 'OrchestratorProfile', 'Resource', 'TagsObject', - 'OperationValuePaged', - 'ManagedClusterPaged', + 'AgentPoolType', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', - 'AgentPoolType', + 'Count', 'NetworkPlugin', 'NetworkPolicy', + 'OSType', ] 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 f6d7bf60bf47..fd8069165b50 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 @@ -1,219 +1,250 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class AgentPoolType(str, Enum): - - virtual_machine_scale_sets = "VirtualMachineScaleSets" - availability_set = "AvailabilitySet" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class 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)): + """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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network policy used for building Kubernetes network. + """ + + CALICO = "calico" + +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" 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 index 975cb7720b53..5318c751c63f 100644 --- 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 @@ -1,62 +1,28 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class CloudError(Model): +class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2018_08_01_preview.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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.CloudErrorBody] """ _attribute_map = { @@ -66,7 +32,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -74,13 +43,12 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMDiagnostics """ @@ -93,21 +61,22 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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. + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. :type ssh: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceSshConfiguration """ @@ -122,93 +91,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -218,6 +173,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -232,11 +188,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -244,32 +203,27 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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" . + :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' + :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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 """ @@ -289,7 +243,10 @@ class ContainerServiceNetworkProfile(Model): 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -299,13 +256,13 @@ def __init__(self, **kwargs): self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -318,19 +275,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -342,24 +301,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -373,22 +332,23 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class ContainerServiceWindowsProfile(Model): +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. + :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. + :param admin_password: Required. The administrator password to use for Windows VMs. :type admin_password: str """ @@ -402,17 +362,19 @@ class ContainerServiceWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.admin_password = kwargs.get('admin_password', None) + self.admin_username = kwargs['admin_username'] + self.admin_password = kwargs['admin_password'] -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -430,17 +392,19 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. :vartype kubeconfigs: @@ -455,28 +419,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -495,38 +461,39 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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 @@ -535,22 +502,19 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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: @@ -590,7 +554,10 @@ class ManagedCluster(Resource): 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedCluster, self).__init__(**kwargs) self.provisioning_state = None self.kubernetes_version = kwargs.get('kubernetes_version', None) @@ -606,7 +573,7 @@ def __init__(self, **kwargs): self.aad_profile = kwargs.get('aad_profile', None) -class ManagedClusterAADProfile(Model): +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. @@ -617,8 +584,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -634,10 +601,13 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) + 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) @@ -645,20 +615,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -680,12 +649,15 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. @@ -705,107 +677,93 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) -class ManagedClusterAgentPoolProfile(Model): +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. + :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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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 + :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 = { @@ -822,11 +780,14 @@ class ManagedClusterAgentPoolProfile(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] self.count = kwargs.get('count', 1) - self.vm_size = kwargs.get('vm_size', None) + 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) @@ -837,23 +798,48 @@ def __init__(self, **kwargs): self.type = kwargs.get('type', None) -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -869,24 +855,25 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -899,17 +886,19 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -919,12 +908,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -945,20 +933,47 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', 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(Model): +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. + 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 @@ -992,7 +1007,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1002,15 +1020,14 @@ def __init__(self, **kwargs): self.provider = None -class OrchestratorProfile(Model): +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). + :param orchestrator_version: Required. Orchestrator version (major, minor, patch). :type orchestrator_version: str """ @@ -1024,16 +1041,19 @@ class OrchestratorProfile(Model): 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OrchestratorProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs.get('orchestrator_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.orchestrator_type = kwargs['orchestrator_type'] + self.orchestrator_version = kwargs['orchestrator_version'] -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1041,6 +1061,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 99d95c327918..2d648536be39 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 @@ -1,62 +1,32 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) +from ._container_service_client_enums import * -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2018_08_01_preview.models.CloudErrorBody] """ _attribute_map = { @@ -66,7 +36,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -74,13 +52,12 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceVMDiagnostics """ @@ -93,21 +70,24 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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. + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. :type ssh: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ContainerServiceSshConfiguration """ @@ -122,93 +102,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -218,6 +187,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -232,7 +202,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -244,32 +225,27 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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" . + :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' + :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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 """ @@ -289,7 +265,17 @@ class ContainerServiceNetworkProfile(Model): 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", **kwargs) -> None: + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = 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", + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -299,13 +285,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: s self.docker_bridge_cidr = docker_bridge_cidr -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -318,19 +304,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -342,24 +332,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -373,22 +365,25 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class ContainerServiceWindowsProfile(Model): +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. + :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. + :param admin_password: Required. The administrator password to use for Windows VMs. :type admin_password: str """ @@ -402,17 +397,22 @@ class ContainerServiceWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: str, + **kwargs + ): super(ContainerServiceWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -430,17 +430,19 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. :vartype kubeconfigs: @@ -455,28 +457,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -495,7 +499,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -507,26 +517,24 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ManagedCluster(Resource): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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 @@ -535,22 +543,19 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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: @@ -590,7 +595,22 @@ class ManagedCluster(Resource): 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, } - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, service_principal_profile=None, addon_profiles=None, enable_rbac: bool=None, network_profile=None, aad_profile=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: Optional[str] = None, + agent_pool_profiles: Optional[List["ManagedClusterAgentPoolProfile"]] = None, + linux_profile: Optional["ContainerServiceLinuxProfile"] = None, + service_principal_profile: Optional["ManagedClusterServicePrincipalProfile"] = None, + addon_profiles: Optional[Dict[str, "ManagedClusterAddonProfile"]] = None, + enable_rbac: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + **kwargs + ): super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.kubernetes_version = kubernetes_version @@ -606,7 +626,7 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.aad_profile = aad_profile -class ManagedClusterAADProfile(Model): +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. @@ -617,8 +637,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -634,7 +654,15 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_app_id: str, + server_app_id: str, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -645,20 +673,19 @@ def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -680,12 +707,19 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. @@ -705,107 +739,96 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config -class ManagedClusterAgentPoolProfile(Model): +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. + :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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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 + :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 = { @@ -822,7 +845,22 @@ class ManagedClusterAgentPoolProfile(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, name: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: int = 1, + vm_size: Union[str, "ContainerServiceVMSizeTypes"], + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -837,23 +875,50 @@ def __init__(self, *, name: str, vm_size, count: int=1, os_disk_size_gb: int=Non self.type = type -class ManagedClusterPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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). + :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. + :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] """ @@ -869,7 +934,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[str]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List[str]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -877,16 +950,14 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -899,17 +970,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -919,12 +995,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -945,7 +1020,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -954,11 +1035,35 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class OperationValue(Model): +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. + 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 @@ -992,7 +1097,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1002,15 +1110,14 @@ def __init__(self, **kwargs) -> None: self.provider = None -class OrchestratorProfile(Model): +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). + :param orchestrator_version: Required. Orchestrator version (major, minor, patch). :type orchestrator_version: str """ @@ -1024,16 +1131,22 @@ class OrchestratorProfile(Model): 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, } - def __init__(self, *, orchestrator_type: str, orchestrator_version: str, **kwargs) -> None: + def __init__( + self, + *, + orchestrator_type: str, + orchestrator_version: str, + **kwargs + ): super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1041,6 +1154,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_paged_models.py deleted file mode 100644 index 14542403fd51..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/models/_paged_models.py +++ /dev/null @@ -1,40 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/__init__.py index 79e636fac619..77613c407d74 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 c93a09bd59a2..087932712fe1 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 @@ -1,678 +1,696 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2018_08_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. - :ivar api_version: Client Api Version. Constant value: "2018-08-01-preview". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-08-01-preview" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2018_08_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', {})) + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2018_08_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', {})) + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResults - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2018_08_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', {})) + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResults - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2018_08_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', {})) + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2018_08_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', {})) + api_version = "2018-08-01-preview" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -681,88 +699,108 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-08-01-preview" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -771,85 +809,111 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -858,90 +922,115 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-08-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -950,40 +1039,52 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} + 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 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 4f3585541df9..e103322530ba 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2018_08_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. - :ivar api_version: Client Api Version. Constant value: "2018-08-01-preview". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-08-01-preview" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2018_08_01_preview.models.OperationValuePaged[~azure.mgmt.containerservice.v2018_08_01_preview.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2018_08_01_preview/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..a16842a6223e 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2018-09-30-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 = policies.BearerTokenCredentialPolicy(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 b1e29d8a34d3..90f5315070f8 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 @@ -1,51 +1,69 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - - :ivar open_shift_managed_clusters: OpenShiftManagedClusters operations + :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2018_09_30_preview.operations.OpenShiftManagedClustersOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2018-09-30-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2018_09_30_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_metadata.json new file mode 100644 index 000000000000..19c80f29acce --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_metadata.json @@ -0,0 +1,60 @@ +{ + "chosen_version": "2018-09-30-preview", + "total_api_version_list": ["2018-09-30-preview"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "open_shift_managed_clusters": "OpenShiftManagedClustersOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..3e4dda8d5954 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2018-09-30-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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..e3808f65c2af --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_container_service_client.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import OpenShiftManagedClustersOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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/v2018_09_30_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..45d890441cd5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations + +__all__ = [ + 'OpenShiftManagedClustersOperations', +] 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 new file mode 100644 index 000000000000..162c91770471 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py @@ -0,0 +1,596 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OpenShiftManagedClustersOperations: + """OpenShiftManagedClustersOperations 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.v2018_09_30_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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/openShiftManagedClusters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + operation returns properties of each OpenShift managed cluster. + + :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] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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/openShiftManagedClusters'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.OpenShiftManagedCluster": + """Gets a OpenShift managed cluster. + + Gets the details of the managed OpenShift cluster with a specified resource group and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OpenShiftManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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" + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + 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, + resource_name: str, + parameters: "models.OpenShiftManagedCluster", + **kwargs + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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('OpenShiftManagedCluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.OpenShiftManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.OpenShiftManagedCluster"]: + """Creates or updates an OpenShift managed cluster. + + Creates or updates a OpenShift managed cluster with the specified configuration for agents and + OpenShift version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', 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/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.OpenShiftManagedCluster"]: + """Updates tags on an OpenShift managed cluster. + + Updates an OpenShift managed cluster with the specified tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', 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/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an OpenShift managed cluster. + + Deletes the OpenShift managed cluster with a specified resource group and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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/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 f675c3f2c0bd..68a09f6ce11d 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 @@ -1,15 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -17,32 +15,36 @@ 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 NetworkProfile - from ._models import OpenShiftManagedCluster - from ._models import OpenShiftManagedClusterAADIdentityProvider - from ._models import OpenShiftManagedClusterAgentPoolProfile - from ._models import OpenShiftManagedClusterAuthProfile - from ._models import OpenShiftManagedClusterBaseIdentityProvider - from ._models import OpenShiftManagedClusterIdentityProvider - from ._models import OpenShiftManagedClusterMasterPoolProfile - from ._models import OpenShiftRouterProfile - from ._models import PurchasePlan - from ._models import Resource - from ._models import TagsObject -from ._paged_models import OpenShiftManagedClusterPaged + 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 ._container_service_client_enums import ( OSType, - OpenShiftContainerServiceVMSize, OpenShiftAgentPoolProfileRole, + OpenShiftContainerServiceVMSize, ) __all__ = [ + 'CloudErrorBody', 'NetworkProfile', 'OpenShiftManagedCluster', 'OpenShiftManagedClusterAADIdentityProvider', @@ -50,13 +52,13 @@ 'OpenShiftManagedClusterAuthProfile', 'OpenShiftManagedClusterBaseIdentityProvider', 'OpenShiftManagedClusterIdentityProvider', + 'OpenShiftManagedClusterListResult', 'OpenShiftManagedClusterMasterPoolProfile', 'OpenShiftRouterProfile', 'PurchasePlan', 'Resource', 'TagsObject', - 'OpenShiftManagedClusterPaged', 'OSType', - 'OpenShiftContainerServiceVMSize', 'OpenShiftAgentPoolProfileRole', + 'OpenShiftContainerServiceVMSize', ] 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 237179cc909e..05a77b92092e 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 @@ -1,61 +1,79 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class OpenShiftContainerServiceVMSize(str, Enum): - - standard_d2s_v3 = "Standard_D2s_v3" - standard_d4s_v3 = "Standard_D4s_v3" - standard_d8s_v3 = "Standard_D8s_v3" - standard_d16s_v3 = "Standard_D16s_v3" - standard_d32s_v3 = "Standard_D32s_v3" - standard_d64s_v3 = "Standard_D64s_v3" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_f8s_v2 = "Standard_F8s_v2" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8s = "Standard_F8s" - standard_f16s = "Standard_F16s" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_e16s_v3 = "Standard_E16s_v3" - standard_e20s_v3 = "Standard_E20s_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - - -class OpenShiftAgentPoolProfileRole(str, Enum): - - compute = "compute" - infra = "infra" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class OpenShiftAgentPoolProfileRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """OpenShiftAgentPoolProfileRole represents the role of the AgentPoolProfile. + """ + + COMPUTE = "compute" + INFRA = "infra" + +class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of OpenShift VMs. + """ + + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E20_S_V3 = "Standard_E20s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + +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" 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 index eed7ceccc10d..6bd682db6861 100644 --- 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 @@ -1,62 +1,28 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class CloudError(Model): +class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2018_09_30_preview.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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2018_09_30_preview.models.CloudErrorBody] """ _attribute_map = { @@ -66,7 +32,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -74,11 +43,10 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class NetworkProfile(Model): +class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. Default value: "10.0.0.0/8" - . + :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 @@ -89,29 +57,31 @@ class NetworkProfile(Model): 'peer_vnet_id': {'key': 'peerVnetId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -130,52 +100,48 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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: Required. Version of OpenShift specified when - creating the cluster. + :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. + :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. + :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 + :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] @@ -196,7 +162,6 @@ class OpenShiftManagedCluster(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, - 'open_shift_version': {'required': True}, } _attribute_map = { @@ -217,7 +182,10 @@ class OpenShiftManagedCluster(Resource): 'auth_profile': {'key': 'properties.authProfile', 'type': 'OpenShiftManagedClusterAuthProfile'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedCluster, self).__init__(**kwargs) self.plan = kwargs.get('plan', None) self.provisioning_state = None @@ -231,15 +199,15 @@ def __init__(self, **kwargs): self.auth_profile = kwargs.get('auth_profile', None) -class OpenShiftManagedClusterBaseIdentityProvider(Model): +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 + sub-classes are: OpenShiftManagedClusterAADIdentityProvider. All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :param kind: Required. The kind of the provider.Constant filled by server. :type kind: str """ @@ -255,9 +223,12 @@ class OpenShiftManagedClusterBaseIdentityProvider(Model): 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None + self.kind = None # type: Optional[str] class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): @@ -265,7 +236,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :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 @@ -273,8 +244,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden :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. + :param customer_admin_group_id: The groupId to be granted cluster admin role. :type customer_admin_group_id: str """ @@ -290,48 +260,45 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) - self.kind = 'AADIdentityProvider' -class OpenShiftManagedClusterAgentPoolProfile(Model): +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. + :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' + :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. Default value: - "10.0.0.0/24" . + :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' + :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 """ @@ -351,17 +318,20 @@ class OpenShiftManagedClusterAgentPoolProfile(Model): 'role': {'key': 'role', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) + 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(Model): +class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. :param identity_providers: Type of authentication profile to use. @@ -373,14 +343,16 @@ class OpenShiftManagedClusterAuthProfile(Model): 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = kwargs.get('identity_providers', None) -class OpenShiftManagedClusterIdentityProvider(Model): - """Defines the configuration of the identity providers to be used in the - OpenShift cluster. +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 @@ -394,44 +366,71 @@ class OpenShiftManagedClusterIdentityProvider(Model): 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.provider = kwargs.get('provider', None) -class OpenShiftManagedClusterMasterPoolProfile(Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for - OpenShift master VMs. +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. + :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. + :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' + :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 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 = { @@ -447,20 +446,22 @@ class OpenShiftManagedClusterMasterPoolProfile(Model): 'os_type': {'key': 'osType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.name = kwargs.get('name', None) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', 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(Model): +class OpenShiftRouterProfile(msrest.serialization.Model): """Represents an OpenShift router. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -480,21 +481,23 @@ class OpenShiftRouterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + 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(Model): - """Used for establishing the purchase context of any 3rd Party artifact - through MarketPlace. +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. + :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 @@ -509,7 +512,10 @@ class PurchasePlan(Model): 'publisher': {'key': 'publisher', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(PurchasePlan, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.product = kwargs.get('product', None) @@ -517,10 +523,10 @@ def __init__(self, **kwargs): self.publisher = kwargs.get('publisher', None) -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -528,6 +534,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 69a8d55898b4..dba1ae7343c8 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 @@ -1,62 +1,32 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2018_09_30_preview.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) +from ._container_service_client_enums import * -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2018_09_30_preview.models.CloudErrorBody] """ _attribute_map = { @@ -66,7 +36,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -74,11 +52,10 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class NetworkProfile(Model): +class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. Default value: "10.0.0.0/8" - . + :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 @@ -89,29 +66,34 @@ class NetworkProfile(Model): 'peer_vnet_id': {'key': 'peerVnetId', 'type': 'str'}, } - def __init__(self, *, vnet_cidr: str="10.0.0.0/8", peer_vnet_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + vnet_cidr: Optional[str] = "10.0.0.0/8", + peer_vnet_id: Optional[str] = None, + **kwargs + ): super(NetworkProfile, self).__init__(**kwargs) self.vnet_cidr = vnet_cidr self.peer_vnet_id = peer_vnet_id -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -130,7 +112,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -142,40 +130,33 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class OpenShiftManagedCluster(Resource): """OpenShift Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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: Required. Version of OpenShift specified when - creating the cluster. + :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. + :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. + :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 + :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] @@ -196,7 +177,6 @@ class OpenShiftManagedCluster(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, - 'open_shift_version': {'required': True}, } _attribute_map = { @@ -217,7 +197,22 @@ class OpenShiftManagedCluster(Resource): 'auth_profile': {'key': 'properties.authProfile', 'type': 'OpenShiftManagedClusterAuthProfile'}, } - def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=None, public_hostname: str=None, fqdn: str=None, network_profile=None, router_profiles=None, master_pool_profile=None, agent_pool_profiles=None, auth_profile=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + plan: Optional["PurchasePlan"] = None, + open_shift_version: Optional[str] = None, + public_hostname: Optional[str] = None, + fqdn: Optional[str] = None, + network_profile: Optional["NetworkProfile"] = None, + router_profiles: Optional[List["OpenShiftRouterProfile"]] = None, + master_pool_profile: Optional["OpenShiftManagedClusterMasterPoolProfile"] = None, + agent_pool_profiles: Optional[List["OpenShiftManagedClusterAgentPoolProfile"]] = None, + auth_profile: Optional["OpenShiftManagedClusterAuthProfile"] = None, + **kwargs + ): super(OpenShiftManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.plan = plan self.provisioning_state = None @@ -231,15 +226,15 @@ def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=No self.auth_profile = auth_profile -class OpenShiftManagedClusterBaseIdentityProvider(Model): +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 + sub-classes are: OpenShiftManagedClusterAADIdentityProvider. All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :param kind: Required. The kind of the provider.Constant filled by server. :type kind: str """ @@ -255,9 +250,12 @@ class OpenShiftManagedClusterBaseIdentityProvider(Model): 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None + self.kind = None # type: Optional[str] class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): @@ -265,7 +263,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :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 @@ -273,8 +271,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden :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. + :param customer_admin_group_id: The groupId to be granted cluster admin role. :type customer_admin_group_id: str """ @@ -290,48 +287,50 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, } - def __init__(self, *, client_id: str=None, secret: str=None, tenant_id: str=None, customer_admin_group_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: Optional[str] = None, + secret: Optional[str] = None, + tenant_id: Optional[str] = None, + customer_admin_group_id: Optional[str] = None, + **kwargs + ): super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) + self.kind = 'AADIdentityProvider' # type: str self.client_id = client_id self.secret = secret self.tenant_id = tenant_id self.customer_admin_group_id = customer_admin_group_id - self.kind = 'AADIdentityProvider' -class OpenShiftManagedClusterAgentPoolProfile(Model): +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. + :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' + :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. Default value: - "10.0.0.0/24" . + :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' + :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 """ @@ -351,7 +350,17 @@ class OpenShiftManagedClusterAgentPoolProfile(Model): 'role': {'key': 'role', 'type': 'str'}, } - def __init__(self, *, name: str, count: int, vm_size, subnet_cidr: str="10.0.0.0/24", os_type="Linux", role=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: int, + vm_size: Union[str, "OpenShiftContainerServiceVMSize"], + subnet_cidr: Optional[str] = "10.0.0.0/24", + os_type: Optional[Union[str, "OSType"]] = "Linux", + role: Optional[Union[str, "OpenShiftAgentPoolProfileRole"]] = None, + **kwargs + ): super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -361,7 +370,7 @@ def __init__(self, *, name: str, count: int, vm_size, subnet_cidr: str="10.0.0.0 self.role = role -class OpenShiftManagedClusterAuthProfile(Model): +class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. :param identity_providers: Type of authentication profile to use. @@ -373,14 +382,18 @@ class OpenShiftManagedClusterAuthProfile(Model): 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, } - def __init__(self, *, identity_providers=None, **kwargs) -> None: + def __init__( + self, + *, + identity_providers: Optional[List["OpenShiftManagedClusterIdentityProvider"]] = None, + **kwargs + ): super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = identity_providers -class OpenShiftManagedClusterIdentityProvider(Model): - """Defines the configuration of the identity providers to be used in the - OpenShift cluster. +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 @@ -394,44 +407,76 @@ class OpenShiftManagedClusterIdentityProvider(Model): 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, } - def __init__(self, *, name: str=None, provider=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + provider: Optional["OpenShiftManagedClusterBaseIdentityProvider"] = None, + **kwargs + ): super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = name self.provider = provider -class OpenShiftManagedClusterMasterPoolProfile(Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for - OpenShift master VMs. +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, + *, + value: Optional[List["OpenShiftManagedCluster"]] = None, + **kwargs + ): + super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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. + :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. + :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' + :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 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 = { @@ -447,7 +492,16 @@ class OpenShiftManagedClusterMasterPoolProfile(Model): 'os_type': {'key': 'osType', 'type': 'str'}, } - def __init__(self, *, count: int, vm_size, name: str=None, subnet_cidr: str=None, os_type="Linux", **kwargs) -> None: + def __init__( + self, + *, + count: int, + vm_size: Union[str, "OpenShiftContainerServiceVMSize"], + name: Optional[str] = None, + subnet_cidr: Optional[str] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + **kwargs + ): super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -456,11 +510,10 @@ def __init__(self, *, count: int, vm_size, name: str=None, subnet_cidr: str=None self.os_type = os_type -class OpenShiftRouterProfile(Model): +class OpenShiftRouterProfile(msrest.serialization.Model): """Represents an OpenShift router. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -480,21 +533,26 @@ class OpenShiftRouterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, name: str=None, public_subdomain: str=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + public_subdomain: Optional[str] = None, + **kwargs + ): super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = name self.public_subdomain = public_subdomain self.fqdn = None -class PurchasePlan(Model): - """Used for establishing the purchase context of any 3rd Party artifact - through MarketPlace. +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. + :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 @@ -509,7 +567,15 @@ class PurchasePlan(Model): 'publisher': {'key': 'publisher', 'type': 'str'}, } - def __init__(self, *, name: str=None, product: str=None, promotion_code: str=None, publisher: str=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + product: Optional[str] = None, + promotion_code: Optional[str] = None, + publisher: Optional[str] = None, + **kwargs + ): super(PurchasePlan, self).__init__(**kwargs) self.name = name self.product = product @@ -517,10 +583,10 @@ def __init__(self, *, name: str=None, product: str=None, promotion_code: str=Non self.publisher = publisher -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -528,6 +594,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_paged_models.py deleted file mode 100644 index c2ed81303b23..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/models/_paged_models.py +++ /dev/null @@ -1,27 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OpenShiftManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`OpenShiftManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OpenShiftManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(OpenShiftManagedClusterPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/__init__.py index fa983c289926..45d890441cd5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations 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 08ecde917631..bfd6ef2250be 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 @@ -1,549 +1,609 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class OpenShiftManagedClustersOperations(object): """OpenShiftManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2018_09_30_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. - :ivar api_version: Client Api Version. Constant value: "2018-09-30-preview". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-09-30-preview" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): - """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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OpenShiftManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] - :raises: :class:`CloudError` + self, + **kwargs # type: Any + ): + # type: (...) -> 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] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists OpenShift managed clusters in the specified subscription and - resource group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 operation returns properties of each OpenShift - managed cluster. + Lists OpenShift managed clusters in the specified subscription and resource group. The + operation returns properties of each OpenShift managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OpenShiftManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] - :raises: :class:`CloudError` + :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] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OpenShiftManagedCluster" """Gets a OpenShift managed cluster. - Gets the details of the managed OpenShift cluster with a specified - resource group and name. + Gets the details of the managed OpenShift cluster with a specified resource group and name. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OpenShiftManagedCluster or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OpenShiftManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError """ + 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" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.OpenShiftManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates an OpenShift managed cluster. - Creates or updates a OpenShift managed cluster with the specified - configuration for agents and OpenShift version. + Creates or updates a OpenShift managed cluster with the specified configuration for agents and + OpenShift version. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns OpenShiftManagedCluster - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('OpenShiftManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + 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/openShiftManagedClusters/{resourceName}'} # type: ignore def _update_tags_initial( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns OpenShiftManagedCluster - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('OpenShiftManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + 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/openShiftManagedClusters/{resourceName}'} # type: ignore def _delete_initial( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-09-30-preview" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an OpenShift managed cluster. - Deletes the OpenShift managed cluster with a specified resource group - and name. + Deletes the OpenShift managed cluster with a specified resource group and name. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} + 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/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..39568b66c96e 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2019-02-01" + 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 = policies.BearerTokenCredentialPolicy(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 6a2bd18e0675..c07649088ca4 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -19,43 +24,56 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_02_01.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2019_02_01.operations.ManagedClustersOperations - :ivar agent_pools: AgentPools operations + :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_02_01.operations.AgentPoolsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2019-02-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_02_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_metadata.json new file mode 100644 index 000000000000..a43b0ab87474 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2019-02-01", + "total_api_version_list": ["2019-02-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..3ecee8107f10 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2019-02-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..aac6559973b3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_container_service_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2019_02_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..25f318905b52 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,425 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + managed_cluster_name: str, + **kwargs + ) -> 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. The operation returns properties + of each agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param managed_cluster_name: The name of the managed cluster resource. + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/{managedClusterName}/agentPools'} # type: ignore + + async def get( + self, + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param managed_cluster_name: The name of the managed cluster resource. + :type managed_cluster_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.v2019_02_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + 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, + managed_cluster_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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 managed_cluster_name: The name of the managed cluster resource. + :type managed_cluster_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param parameters: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + managed_cluster_name=managed_cluster_name, + agent_pool_name=agent_pool_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + managed_cluster_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param managed_cluster_name: The name of the managed cluster resource. + :type managed_cluster_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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + managed_cluster_name=managed_cluster_name, + agent_pool_name=agent_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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/{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 new file mode 100644 index 000000000000..2f6bcf0cf8a6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1071 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2019_02_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2019_02_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_02_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_02_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2019_02_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 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 new file mode 100644 index 000000000000..299a3c5a2eed --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2019_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2019_02_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/__init__.py index ff8ff4e69cdd..c92042d8196f 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 @@ -1,16 +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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -27,54 +26,61 @@ 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 - from ._models import ContainerServiceDiagnosticsProfile - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import ContainerServiceWindowsProfile - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterAgentPoolProfileProperties - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterUpgradeProfile - from ._models import OperationValue - from ._models import OrchestratorProfile - from ._models import Resource - from ._models import SubResource - from ._models import TagsObject -from ._paged_models import AgentPoolPaged -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( + AgentPoolType, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, - AgentPoolType, + Count, NetworkPlugin, NetworkPolicy, + OSType, ) __all__ = [ 'AgentPool', + 'AgentPoolListResult', + 'CloudErrorBody', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', 'ContainerServiceMasterProfile', @@ -91,21 +97,21 @@ 'ManagedClusterAddonProfile', 'ManagedClusterAgentPoolProfile', 'ManagedClusterAgentPoolProfileProperties', + 'ManagedClusterListResult', 'ManagedClusterPoolUpgradeProfile', 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', + 'OperationListResult', 'OperationValue', 'OrchestratorProfile', 'Resource', 'SubResource', 'TagsObject', - 'OperationValuePaged', - 'ManagedClusterPaged', - 'AgentPoolPaged', + 'AgentPoolType', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', - 'AgentPoolType', + 'Count', 'NetworkPlugin', 'NetworkPolicy', + 'OSType', ] 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 f317ac627e89..9e903be4cb15 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 @@ -1,220 +1,252 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class AgentPoolType(str, Enum): - - virtual_machine_scale_sets = "VirtualMachineScaleSets" - availability_set = "AvailabilitySet" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" - azure = "azure" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """AgentPoolType represents types of an agent pool. VirtualMachineScaleSets type is still in + PREVIEW. + """ + + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + AVAILABILITY_SET = "AvailabilitySet" + +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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + """ + + LINUX = "Linux" + WINDOWS = "Windows" 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 index 2287f761d477..e4ae73f1af93 100644 --- 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 @@ -1,30 +1,25 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class SubResource(Model): +class SubResource(msrest.serialization.Model): """Reference to another subresource. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +35,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,107 +48,87 @@ def __init__(self, **kwargs): class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. :type availability_zones: list[str] """ @@ -158,8 +136,8 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'count': {'maximum': 100, 'minimum': 1}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -176,13 +154,16 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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): + def __init__( + self, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = kwargs.get('count', 1) self.vm_size = kwargs.get('vm_size', None) @@ -193,56 +174,55 @@ def __init__(self, **kwargs): 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.agent_pool_type = kwargs.get('agent_pool_type', 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 CloudError(Model): - """An error response from the Container service. +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 error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_02_01.models.CloudErrorBody + :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 """ - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + _validation = { + 'next_link': {'readonly': True}, } - def __init__(self, **kwargs): - super(CloudError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): + _attribute_map = { + 'value': {'key': 'value', 'type': '[AgentPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + def __init__( + self, + **kwargs + ): + super(AgentPoolListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_02_01.models.CloudErrorBody] """ _attribute_map = { @@ -252,7 +232,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -260,13 +243,12 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMDiagnostics """ @@ -279,23 +261,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -308,93 +290,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -404,6 +372,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -418,11 +387,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -430,32 +402,25 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 """ @@ -475,7 +440,10 @@ class ContainerServiceNetworkProfile(Model): 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -485,13 +453,13 @@ def __init__(self, **kwargs): self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -504,19 +472,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -528,24 +498,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -559,22 +529,23 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class ContainerServiceWindowsProfile(Model): +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. + :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. + :param admin_password: Required. The administrator password to use for Windows VMs. :type admin_password: str """ @@ -588,17 +559,19 @@ class ContainerServiceWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.admin_password = kwargs.get('admin_password', None) + self.admin_username = kwargs['admin_username'] + self.admin_password = kwargs['admin_password'] -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -616,21 +589,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_02_01.models.CredentialResult] """ _validation = { @@ -641,28 +615,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -681,38 +657,39 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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 @@ -721,34 +698,31 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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] """ @@ -784,7 +758,10 @@ class ManagedCluster(Resource): 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedCluster, self).__init__(**kwargs) self.provisioning_state = None self.kubernetes_version = kwargs.get('kubernetes_version', None) @@ -802,7 +779,7 @@ def __init__(self, **kwargs): self.api_server_authorized_ip_ranges = kwargs.get('api_server_authorized_ip_ranges', None) -class ManagedClusterAADProfile(Model): +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. @@ -813,8 +790,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -830,10 +807,13 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) + 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) @@ -841,20 +821,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -876,12 +855,15 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. @@ -901,115 +883,100 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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}, } @@ -1029,10 +996,13 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = kwargs.get('count', 1) - self.vm_size = kwargs.get('vm_size', None) + 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) @@ -1049,109 +1019,91 @@ def __init__(self, **kwargs): 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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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. + :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}$'}, } @@ -1173,28 +1125,56 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] + +class ManagedClusterListResult(msrest.serialization.Model): + """The response from the List Managed Clusters operation. -class ManagedClusterPoolUpgradeProfile(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 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). + :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. + :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] """ @@ -1210,24 +1190,25 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1240,17 +1221,19 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1260,12 +1243,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1286,20 +1268,47 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', 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. -class OperationValue(Model): + 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. + 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 @@ -1333,7 +1342,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1343,15 +1355,14 @@ def __init__(self, **kwargs): self.provider = None -class OrchestratorProfile(Model): +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). + :param orchestrator_version: Required. Orchestrator version (major, minor, patch). :type orchestrator_version: str """ @@ -1365,16 +1376,19 @@ class OrchestratorProfile(Model): 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OrchestratorProfile, self).__init__(**kwargs) - self.orchestrator_type = kwargs.get('orchestrator_type', None) - self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.orchestrator_type = kwargs['orchestrator_type'] + self.orchestrator_version = kwargs['orchestrator_version'] -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1382,6 +1396,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 997e0807b9dc..bbcbec92ff65 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 @@ -1,30 +1,29 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class SubResource(Model): +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. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +39,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,107 +52,87 @@ def __init__(self, **kwargs) -> None: class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. :type availability_zones: list[str] """ @@ -158,8 +140,8 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'count': {'maximum': 100, 'minimum': 1}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -176,13 +158,29 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, agent_pool_type=None, orchestrator_version: str=None, availability_zones=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = 1, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -193,56 +191,57 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub self.max_count = max_count self.min_count = min_count self.enable_auto_scaling = enable_auto_scaling - self.agent_pool_type = agent_pool_type + self.type_properties_type = type_properties_type self.orchestrator_version = orchestrator_version self.provisioning_state = None self.availability_zones = availability_zones -class CloudError(Model): - """An error response from the Container service. +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 error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_02_01.models.CloudErrorBody + :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 """ - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + _validation = { + 'next_link': {'readonly': True}, } - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): + _attribute_map = { + 'value': {'key': 'value', 'type': '[AgentPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + def __init__( + self, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + super(AgentPoolListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_02_01.models.CloudErrorBody] """ _attribute_map = { @@ -252,7 +251,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -260,13 +267,12 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceVMDiagnostics """ @@ -279,23 +285,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_02_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -308,93 +316,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -404,6 +401,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -418,7 +416,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -430,32 +439,25 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 """ @@ -475,7 +477,17 @@ class ContainerServiceNetworkProfile(Model): 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", **kwargs) -> None: + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = 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", + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -485,13 +497,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: s self.docker_bridge_cidr = docker_bridge_cidr -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -504,19 +516,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -528,24 +544,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -559,22 +577,25 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class ContainerServiceWindowsProfile(Model): +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. + :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. + :param admin_password: Required. The administrator password to use for Windows VMs. :type admin_password: str """ @@ -588,17 +609,22 @@ class ContainerServiceWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: str, + **kwargs + ): super(ContainerServiceWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -616,21 +642,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_02_01.models.CredentialResult] """ _validation = { @@ -641,28 +668,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -681,7 +710,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -693,26 +728,24 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ManagedCluster(Resource): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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 @@ -721,34 +754,31 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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] """ @@ -784,7 +814,24 @@ class ManagedCluster(Resource): 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, } - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, service_principal_profile=None, addon_profiles=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_authorized_ip_ranges=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: Optional[str] = None, + agent_pool_profiles: Optional[List["ManagedClusterAgentPoolProfile"]] = None, + linux_profile: Optional["ContainerServiceLinuxProfile"] = None, + service_principal_profile: Optional["ManagedClusterServicePrincipalProfile"] = None, + addon_profiles: Optional[Dict[str, "ManagedClusterAddonProfile"]] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + api_server_authorized_ip_ranges: Optional[List[str]] = None, + **kwargs + ): super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.kubernetes_version = kubernetes_version @@ -802,7 +849,7 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.api_server_authorized_ip_ranges = api_server_authorized_ip_ranges -class ManagedClusterAADProfile(Model): +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. @@ -813,8 +860,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -830,7 +877,15 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_app_id: str, + server_app_id: str, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -841,20 +896,19 @@ def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -876,12 +930,19 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. @@ -901,115 +962,103 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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}, } @@ -1029,7 +1078,23 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, } - def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, **kwargs) -> None: + def __init__( + self, + *, + count: int = 1, + vm_size: Union[str, "ContainerServiceVMSizeTypes"], + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1049,109 +1114,91 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub 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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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. + :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}$'}, } @@ -1173,28 +1220,72 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, vm_size, name: str, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, **kwargs) -> None: + def __init__( + self, + *, + count: int = 1, + vm_size: Union[str, "ContainerServiceVMSizeTypes"], + name: str, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + **kwargs + ): 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 -class ManagedClusterPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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). + :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. + :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] """ @@ -1210,7 +1301,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[str]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List[str]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1218,16 +1317,14 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1240,17 +1337,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1260,12 +1362,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1286,7 +1387,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1295,11 +1402,35 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class OperationValue(Model): +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. + 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 @@ -1333,7 +1464,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1343,15 +1477,14 @@ def __init__(self, **kwargs) -> None: self.provider = None -class OrchestratorProfile(Model): +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). + :param orchestrator_version: Required. Orchestrator version (major, minor, patch). :type orchestrator_version: str """ @@ -1365,16 +1498,22 @@ class OrchestratorProfile(Model): 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, } - def __init__(self, *, orchestrator_type: str, orchestrator_version: str, **kwargs) -> None: + def __init__( + self, + *, + orchestrator_type: str, + orchestrator_version: str, + **kwargs + ): super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1382,6 +1521,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_paged_models.py deleted file mode 100644 index 533519e847e8..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/_paged_models.py +++ /dev/null @@ -1,53 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) -class AgentPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`AgentPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AgentPool]'} - } - - def __init__(self, *args, **kwargs): - - super(AgentPoolPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/__init__.py index d1b67f7888b7..5aac40228eec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 45b8ac182c2e..466f85f0fd39 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 @@ -1,127 +1,141 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class AgentPoolsOperations(object): """AgentPoolsOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_02_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-02-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-02-01" - - self.config = config + self._config = config def list( - self, resource_group_name, managed_cluster_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + managed_cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 of each agent pool. + Gets a list of agent pools in the specified managed cluster. The operation returns properties + of each agent pool. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param managed_cluster_name: The name of the managed cluster resource. :type managed_cluster_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AgentPool - :rtype: - ~azure.mgmt.containerservice.v2019_02_01.models.AgentPoolPaged[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.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') + 'managedClusterName': self._serialize.url("managed_cluster_name", managed_cluster_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools'} # type: ignore def get( - self, resource_group_name, managed_cluster_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + managed_cluster_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" """Gets the agent pool. - Gets the details of the agent pool by managed cluster and resource - group. + Gets the details of the agent pool by managed cluster and resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -129,115 +143,122 @@ def get( :type managed_cluster_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.AgentPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_02_01.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', {})) + api_version = "2019-02-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.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') + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} - + 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, managed_cluster_name, agent_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + 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" + 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.metadata['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'), + 'subscriptionId': self._serialize.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') + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AgentPool') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('AgentPool', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, managed_cluster_name, agent_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + + 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"] """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -248,92 +269,114 @@ def create_or_update( :type managed_cluster_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param parameters: Parameters supplied to the Create or Update an - agent pool operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_02_01.models.AgentPool - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns AgentPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_02_01.models.AgentPool]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - managed_cluster_name=managed_cluster_name, - agent_pool_name=agent_pool_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('AgentPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + managed_cluster_name=managed_cluster_name, + agent_pool_name=agent_pool_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} - + 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/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore def _delete_initial( - self, resource_group_name, managed_cluster_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + managed_cluster_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-02-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.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') + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, managed_cluster_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + 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/{managedClusterName}/agentPools/{agentPoolName}'} # type: ignore + + 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] """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -344,36 +387,49 @@ def delete( :type managed_cluster_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_cluster_name=managed_cluster_name, - agent_pool_name=agent_pool_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + managed_cluster_name=managed_cluster_name, + agent_pool_name=agent_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}'} + 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/{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 01bf244c0f48..b4946ff71745 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 @@ -1,677 +1,696 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_02_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-02-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-02-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_02_01.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', {})) + api_version = "2019-02-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_02_01.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', {})) + api_version = "2019-02-01" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_02_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_02_01.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', {})) + api_version = "2019-02-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_02_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_02_01.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', {})) + api_version = "2019-02-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true + :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.v2019_02_01.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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', {})) + api_version = "2019-02-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -680,88 +699,110 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-02-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -770,85 +811,111 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -857,90 +924,115 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -949,40 +1041,52 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} + 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 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 4d88458ff7f9..6d75dc223dba 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_02_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-02-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-02-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2019_02_01.models.OperationValuePaged[~azure.mgmt.containerservice.v2019_02_01.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2019_02_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/version.py deleted file mode 100644 index fc241ef662d7..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2019-02-01" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..838d4fe4a5c3 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2019-04-01" + 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 = policies.BearerTokenCredentialPolicy(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 989cd660de45..057f0cf21713 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -19,43 +24,56 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_04_01.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2019_04_01.operations.ManagedClustersOperations - :ivar agent_pools: AgentPools operations + :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_04_01.operations.AgentPoolsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2019-04-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_04_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_metadata.json new file mode 100644 index 000000000000..bf8722cde3f4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2019-04-01", + "total_api_version_list": ["2019-04-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..6e83b5c77162 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2019-04-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..c6450299143e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_container_service_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2019_04_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..c0ba49a10e60 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,425 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_04_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2019_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..b7c200a559bb --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1071 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_04_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2019_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2019_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2019_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 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 new file mode 100644 index 000000000000..270c66a8ae5c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2019_04_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2019_04_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/__init__.py index daefc2243fd9..1a2e8eac6703 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 @@ -1,16 +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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -27,58 +26,65 @@ 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 - from ._models import ContainerServiceDiagnosticsProfile - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterAgentPoolProfileProperties - from ._models import ManagedClusterIdentity - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterUpgradeProfile - from ._models import ManagedClusterWindowsProfile - from ._models import OperationValue - from ._models import Resource - from ._models import SubResource - from ._models import TagsObject -from ._paged_models import AgentPoolPaged -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( + AgentPoolType, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, - AgentPoolType, + Count, + LoadBalancerSku, NetworkPlugin, NetworkPolicy, - LoadBalancerSku, + OSType, ResourceIdentityType, ) __all__ = [ 'AgentPool', + 'AgentPoolListResult', + 'CloudErrorBody', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', 'ContainerServiceMasterProfile', @@ -95,24 +101,24 @@ 'ManagedClusterAgentPoolProfile', 'ManagedClusterAgentPoolProfileProperties', 'ManagedClusterIdentity', + 'ManagedClusterListResult', 'ManagedClusterPoolUpgradeProfile', 'ManagedClusterPoolUpgradeProfileUpgradesItem', 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', 'ManagedClusterWindowsProfile', + 'OperationListResult', 'OperationValue', 'Resource', 'SubResource', 'TagsObject', - 'OperationValuePaged', - 'ManagedClusterPaged', - 'AgentPoolPaged', + 'AgentPoolType', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', - 'AgentPoolType', + 'Count', + 'LoadBalancerSku', 'NetworkPlugin', 'NetworkPolicy', - 'LoadBalancerSku', + 'OSType', 'ResourceIdentityType', ] 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 08f49fc4a07c..02e7ae312cdb 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 @@ -1,232 +1,269 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class AgentPoolType(str, Enum): - - virtual_machine_scale_sets = "VirtualMachineScaleSets" - availability_set = "AvailabilitySet" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" - azure = "azure" - - -class LoadBalancerSku(str, Enum): - - standard = "standard" - basic = "basic" - - -class ResourceIdentityType(str, Enum): - - system_assigned = "SystemAssigned" - none = "None" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """AgentPoolType represents types of an agent pool. VirtualMachineScaleSets type is still in + PREVIEW. + """ + + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + AVAILABILITY_SET = "AvailabilitySet" + +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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """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)): + """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. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" 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 index 5c47696b9dcc..cd6097fba73e 100644 --- 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 @@ -1,30 +1,25 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class SubResource(Model): +class SubResource(msrest.serialization.Model): """Reference to another subresource. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +35,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,107 +48,87 @@ def __init__(self, **kwargs): class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. :type availability_zones: list[str] """ @@ -158,8 +136,8 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'count': {'maximum': 100, 'minimum': 1}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -176,13 +154,16 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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): + def __init__( + self, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = kwargs.get('count', 1) self.vm_size = kwargs.get('vm_size', None) @@ -193,56 +174,55 @@ def __init__(self, **kwargs): 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.agent_pool_type = kwargs.get('agent_pool_type', 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 CloudError(Model): - """An error response from the Container service. +class AgentPoolListResult(msrest.serialization.Model): + """The response from the List Agent Pools operation. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_04_01.models.CloudErrorBody + 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 """ - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + _validation = { + 'next_link': {'readonly': True}, } - def __init__(self, **kwargs): - super(CloudError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): + _attribute_map = { + 'value': {'key': 'value', 'type': '[AgentPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + def __init__( + self, + **kwargs + ): + super(AgentPoolListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_04_01.models.CloudErrorBody] """ _attribute_map = { @@ -252,7 +232,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -260,13 +243,12 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMDiagnostics """ @@ -279,23 +261,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -308,93 +290,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -404,6 +372,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -418,11 +387,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -430,37 +402,29 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 + :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 = { @@ -480,7 +444,10 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -491,13 +458,13 @@ def __init__(self, **kwargs): self.load_balancer_sku = kwargs.get('load_balancer_sku', None) -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -510,19 +477,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -534,24 +503,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -565,17 +534,19 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -593,21 +564,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_04_01.models.CredentialResult] """ _validation = { @@ -618,28 +590,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -658,41 +632,43 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -701,42 +677,35 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterIdentity """ _validation = { @@ -755,6 +724,7 @@ class ManagedCluster(Resource): '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'}, @@ -771,11 +741,14 @@ class ManagedCluster(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, } - def __init__(self, **kwargs): + 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) @@ -792,10 +765,9 @@ def __init__(self, **kwargs): 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) - self.identity = kwargs.get('identity', None) -class ManagedClusterAADProfile(Model): +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. @@ -806,8 +778,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -823,10 +795,13 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) + 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) @@ -834,20 +809,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -869,12 +843,15 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. @@ -894,115 +871,100 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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}, } @@ -1022,10 +984,13 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = kwargs.get('count', 1) - self.vm_size = kwargs.get('vm_size', None) + 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) @@ -1042,109 +1007,91 @@ def __init__(self, **kwargs): 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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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. + :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}$'}, } @@ -1166,31 +1113,30 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] -class ManagedClusterIdentity(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1201,33 +1147,61 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = kwargs.get('type', None) -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1244,15 +1218,18 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1266,22 +1243,23 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1294,17 +1272,19 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1314,12 +1294,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1340,22 +1319,24 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.control_plane_profile = kwargs['control_plane_profile'] + self.agent_pool_profiles = kwargs['agent_pool_profiles'] -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1371,17 +1352,44 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) + self.admin_username = kwargs['admin_username'] self.admin_password = kwargs.get('admin_password', None) -class OperationValue(Model): +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. + 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 @@ -1415,7 +1423,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1425,10 +1436,10 @@ def __init__(self, **kwargs): self.provider = None -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1436,6 +1447,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 a63061cf6318..371d47dc8a6f 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 @@ -1,30 +1,29 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class SubResource(Model): +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. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +39,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,107 +52,87 @@ def __init__(self, **kwargs) -> None: class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :param availability_zones: (PREVIEW) Availability zones for nodes. Must use + VirtualMachineScaleSets AgentPoolType. :type availability_zones: list[str] """ @@ -158,8 +140,8 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'count': {'maximum': 100, 'minimum': 1}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -176,13 +158,29 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, agent_pool_type=None, orchestrator_version: str=None, availability_zones=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = 1, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -193,56 +191,57 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub self.max_count = max_count self.min_count = min_count self.enable_auto_scaling = enable_auto_scaling - self.agent_pool_type = agent_pool_type + self.type_properties_type = type_properties_type self.orchestrator_version = orchestrator_version self.provisioning_state = None self.availability_zones = availability_zones -class CloudError(Model): - """An error response from the Container service. +class AgentPoolListResult(msrest.serialization.Model): + """The response from the List Agent Pools operation. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_04_01.models.CloudErrorBody + 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 """ - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + _validation = { + 'next_link': {'readonly': True}, } - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): + _attribute_map = { + 'value': {'key': 'value', 'type': '[AgentPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + def __init__( + self, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + super(AgentPoolListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_04_01.models.CloudErrorBody] """ _attribute_map = { @@ -252,7 +251,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -260,13 +267,12 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMDiagnostics """ @@ -279,23 +285,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -308,93 +316,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -404,6 +401,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -418,7 +416,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -430,37 +439,29 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 + :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 = { @@ -480,7 +481,18 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", load_balancer_sku=None, **kwargs) -> None: + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = 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", + load_balancer_sku: Optional[Union[str, "LoadBalancerSku"]] = None, + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -491,13 +503,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: s self.load_balancer_sku = load_balancer_sku -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -510,19 +522,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -534,24 +550,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -565,17 +583,21 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -593,21 +615,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_04_01.models.CredentialResult] """ _validation = { @@ -618,28 +641,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -658,7 +683,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -670,29 +701,28 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ManagedCluster(Resource): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -701,42 +731,35 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterIdentity """ _validation = { @@ -755,6 +778,7 @@ class ManagedCluster(Resource): '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'}, @@ -771,11 +795,31 @@ class ManagedCluster(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, } - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, node_resource_group: str=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_authorized_ip_ranges=None, identity=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + api_server_authorized_ip_ranges: Optional[List[str]] = None, + **kwargs + ): super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity self.provisioning_state = None self.max_agent_pools = None self.kubernetes_version = kubernetes_version @@ -792,10 +836,9 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.network_profile = network_profile self.aad_profile = aad_profile self.api_server_authorized_ip_ranges = api_server_authorized_ip_ranges - self.identity = identity -class ManagedClusterAADProfile(Model): +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. @@ -806,8 +849,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -823,7 +866,15 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_app_id: str, + server_app_id: str, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -834,20 +885,19 @@ def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -869,12 +919,19 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. @@ -894,115 +951,103 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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}, } @@ -1022,7 +1067,23 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, } - def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, **kwargs) -> None: + def __init__( + self, + *, + count: int = 1, + vm_size: Union[str, "ContainerServiceVMSizeTypes"], + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1042,109 +1103,91 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub 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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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. + :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}$'}, } @@ -1166,31 +1209,44 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, vm_size, name: str, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, **kwargs) -> None: + def __init__( + self, + *, + count: int = 1, + vm_size: Union[str, "ContainerServiceVMSizeTypes"], + name: str, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + **kwargs + ): 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 -class ManagedClusterIdentity(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1201,33 +1257,65 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type -class ManagedClusterPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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). + :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. + :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] """ @@ -1244,7 +1332,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1252,7 +1348,7 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1266,22 +1362,26 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1294,17 +1394,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1314,12 +1419,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1340,7 +1444,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1349,13 +1459,12 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1371,17 +1480,47 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str=None, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class OperationValue(Model): +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. + 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 @@ -1415,7 +1554,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1425,10 +1567,10 @@ def __init__(self, **kwargs) -> None: self.provider = None -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1436,6 +1578,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_paged_models.py deleted file mode 100644 index 97b32fc74be8..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_paged_models.py +++ /dev/null @@ -1,53 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) -class AgentPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`AgentPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AgentPool]'} - } - - def __init__(self, *args, **kwargs): - - super(AgentPoolPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/__init__.py index d1b67f7888b7..5aac40228eec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 a666ca594dbd..530cdafcd1a8 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 @@ -1,127 +1,141 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class AgentPoolsOperations(object): """AgentPoolsOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_04_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-04-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config + self._config = config def list( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 of each agent pool. + Gets a list of agent pools in the specified managed cluster. The operation returns properties + of each 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AgentPool - :rtype: - ~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolPaged[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore def get( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" """Gets the agent pool. - Gets the details of the agent pool by managed cluster and resource - group. + Gets the details of the agent pool by managed cluster and resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -129,115 +143,122 @@ def get( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.AgentPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_04_01.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', {})) + api_version = "2019-04-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + 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" + 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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AgentPool') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('AgentPool', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + 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"] """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -248,92 +269,114 @@ def create_or_update( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param parameters: Parameters supplied to the Create or Update an - agent pool operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_04_01.models.AgentPool - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns AgentPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_04_01.models.AgentPool]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - 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, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('AgentPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-04-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -344,36 +387,49 @@ def delete( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} + 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 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 77642ec8250e..39024609b6bc 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 @@ -1,677 +1,696 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_04_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-04-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_04_01.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', {})) + api_version = "2019-04-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_04_01.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', {})) + api_version = "2019-04-01" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_04_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_04_01.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', {})) + api_version = "2019-04-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_04_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_04_01.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', {})) + api_version = "2019-04-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true + :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.v2019_04_01.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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', {})) + api_version = "2019-04-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -680,88 +699,110 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-04-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -770,85 +811,111 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -857,90 +924,115 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-04-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -949,40 +1041,52 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} + 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 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 addb36c77027..8ed0a316a1de 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_04_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-04-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2019_04_01.models.OperationValuePaged[~azure.mgmt.containerservice.v2019_04_01.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2019_04_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/version.py deleted file mode 100644 index fe4b0545122f..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2019-04-01" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..e3955647eb73 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2019-04-30" + 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 = policies.BearerTokenCredentialPolicy(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 d0803bd80801..e93157dc98c0 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 @@ -1,51 +1,69 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - - :ivar open_shift_managed_clusters: OpenShiftManagedClusters operations + :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2019_04_30.operations.OpenShiftManagedClustersOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2019-04-30' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_04_30/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_metadata.json new file mode 100644 index 000000000000..12c69f381cd2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_metadata.json @@ -0,0 +1,60 @@ +{ + "chosen_version": "2019-04-30", + "total_api_version_list": ["2019-04-30"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "open_shift_managed_clusters": "OpenShiftManagedClustersOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..bbfc8adba6c3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2019-04-30" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..38bb3823d67f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_container_service_client.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import OpenShiftManagedClustersOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_04_30/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/__init__.py new file mode 100644 index 000000000000..45d890441cd5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations + +__all__ = [ + 'OpenShiftManagedClustersOperations', +] 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 new file mode 100644 index 000000000000..7f084d69f242 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/_open_shift_managed_clusters_operations.py @@ -0,0 +1,596 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OpenShiftManagedClustersOperations: + """OpenShiftManagedClustersOperations 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.v2019_04_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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/openShiftManagedClusters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + operation returns properties of each OpenShift managed cluster. + + :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] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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/openShiftManagedClusters'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.OpenShiftManagedCluster": + """Gets a OpenShift managed cluster. + + Gets the details of the managed OpenShift cluster with a specified resource group and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OpenShiftManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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" + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + 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, + resource_name: str, + parameters: "models.OpenShiftManagedCluster", + **kwargs + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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('OpenShiftManagedCluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.OpenShiftManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.OpenShiftManagedCluster"]: + """Creates or updates an OpenShift managed cluster. + + Creates or updates a OpenShift managed cluster with the specified configuration for agents and + OpenShift version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Create or Update an OpenShift Managed Cluster + operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', 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/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.OpenShiftManagedCluster"]: + """Updates tags on an OpenShift managed cluster. + + Updates an OpenShift managed cluster with the specified tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', 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/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an OpenShift managed cluster. + + Deletes the OpenShift managed cluster with a specified resource group and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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/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 f675c3f2c0bd..68a09f6ce11d 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 @@ -1,15 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -17,32 +15,36 @@ 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 NetworkProfile - from ._models import OpenShiftManagedCluster - from ._models import OpenShiftManagedClusterAADIdentityProvider - from ._models import OpenShiftManagedClusterAgentPoolProfile - from ._models import OpenShiftManagedClusterAuthProfile - from ._models import OpenShiftManagedClusterBaseIdentityProvider - from ._models import OpenShiftManagedClusterIdentityProvider - from ._models import OpenShiftManagedClusterMasterPoolProfile - from ._models import OpenShiftRouterProfile - from ._models import PurchasePlan - from ._models import Resource - from ._models import TagsObject -from ._paged_models import OpenShiftManagedClusterPaged + 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 ._container_service_client_enums import ( OSType, - OpenShiftContainerServiceVMSize, OpenShiftAgentPoolProfileRole, + OpenShiftContainerServiceVMSize, ) __all__ = [ + 'CloudErrorBody', 'NetworkProfile', 'OpenShiftManagedCluster', 'OpenShiftManagedClusterAADIdentityProvider', @@ -50,13 +52,13 @@ 'OpenShiftManagedClusterAuthProfile', 'OpenShiftManagedClusterBaseIdentityProvider', 'OpenShiftManagedClusterIdentityProvider', + 'OpenShiftManagedClusterListResult', 'OpenShiftManagedClusterMasterPoolProfile', 'OpenShiftRouterProfile', 'PurchasePlan', 'Resource', 'TagsObject', - 'OpenShiftManagedClusterPaged', 'OSType', - 'OpenShiftContainerServiceVMSize', 'OpenShiftAgentPoolProfileRole', + 'OpenShiftContainerServiceVMSize', ] 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 237179cc909e..05a77b92092e 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 @@ -1,61 +1,79 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class OpenShiftContainerServiceVMSize(str, Enum): - - standard_d2s_v3 = "Standard_D2s_v3" - standard_d4s_v3 = "Standard_D4s_v3" - standard_d8s_v3 = "Standard_D8s_v3" - standard_d16s_v3 = "Standard_D16s_v3" - standard_d32s_v3 = "Standard_D32s_v3" - standard_d64s_v3 = "Standard_D64s_v3" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_f8s_v2 = "Standard_F8s_v2" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8s = "Standard_F8s" - standard_f16s = "Standard_F16s" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_e16s_v3 = "Standard_E16s_v3" - standard_e20s_v3 = "Standard_E20s_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - - -class OpenShiftAgentPoolProfileRole(str, Enum): - - compute = "compute" - infra = "infra" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class OpenShiftAgentPoolProfileRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """OpenShiftAgentPoolProfileRole represents the role of the AgentPoolProfile. + """ + + COMPUTE = "compute" + INFRA = "infra" + +class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of OpenShift VMs. + """ + + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E20_S_V3 = "Standard_E20s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + +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" 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 index fde076e5b4ce..667208918b44 100644 --- 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 @@ -1,62 +1,28 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class CloudError(Model): +class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_04_30.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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_04_30.models.CloudErrorBody] """ _attribute_map = { @@ -66,7 +32,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -74,11 +43,10 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class NetworkProfile(Model): +class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. Default value: "10.0.0.0/8" - . + :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 @@ -92,30 +60,32 @@ class NetworkProfile(Model): 'vnet_id': {'key': 'vnetId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -134,53 +104,50 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 + :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. + :ivar provisioning_state: The current deployment or provisioning state, which only appears in + the response. :vartype provisioning_state: str - :param open_shift_version: Required. Version of OpenShift specified when - creating the cluster. + :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. + :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. + :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 + :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] @@ -201,7 +168,6 @@ class OpenShiftManagedCluster(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, - 'open_shift_version': {'required': True}, 'cluster_version': {'readonly': True}, 'public_hostname': {'readonly': True}, 'fqdn': {'readonly': True}, @@ -226,7 +192,10 @@ class OpenShiftManagedCluster(Resource): 'auth_profile': {'key': 'properties.authProfile', 'type': 'OpenShiftManagedClusterAuthProfile'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedCluster, self).__init__(**kwargs) self.plan = kwargs.get('plan', None) self.provisioning_state = None @@ -241,15 +210,15 @@ def __init__(self, **kwargs): self.auth_profile = kwargs.get('auth_profile', None) -class OpenShiftManagedClusterBaseIdentityProvider(Model): +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 + sub-classes are: OpenShiftManagedClusterAADIdentityProvider. All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :param kind: Required. The kind of the provider.Constant filled by server. :type kind: str """ @@ -265,9 +234,12 @@ class OpenShiftManagedClusterBaseIdentityProvider(Model): 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None + self.kind = None # type: Optional[str] class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): @@ -275,7 +247,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :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 @@ -283,8 +255,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden :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. + :param customer_admin_group_id: The groupId to be granted cluster admin role. :type customer_admin_group_id: str """ @@ -300,48 +271,45 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) - self.kind = 'AADIdentityProvider' -class OpenShiftManagedClusterAgentPoolProfile(Model): +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. + :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' + :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. Default value: - "10.0.0.0/24" . + :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' + :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 """ @@ -361,17 +329,20 @@ class OpenShiftManagedClusterAgentPoolProfile(Model): 'role': {'key': 'role', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) + 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(Model): +class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. :param identity_providers: Type of authentication profile to use. @@ -383,14 +354,16 @@ class OpenShiftManagedClusterAuthProfile(Model): 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = kwargs.get('identity_providers', None) -class OpenShiftManagedClusterIdentityProvider(Model): - """Defines the configuration of the identity providers to be used in the - OpenShift cluster. +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 @@ -404,44 +377,70 @@ class OpenShiftManagedClusterIdentityProvider(Model): 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.provider = kwargs.get('provider', None) -class OpenShiftManagedClusterMasterPoolProfile(Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for - OpenShift master VMs. +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. + :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. + :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' + :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 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 = { @@ -457,20 +456,22 @@ class OpenShiftManagedClusterMasterPoolProfile(Model): 'os_type': {'key': 'osType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.name = kwargs.get('name', None) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', 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(Model): +class OpenShiftRouterProfile(msrest.serialization.Model): """Represents an OpenShift router. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -491,21 +492,23 @@ class OpenShiftRouterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.public_subdomain = None self.fqdn = None -class PurchasePlan(Model): - """Used for establishing the purchase context of any 3rd Party artifact - through MarketPlace. +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. + :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 @@ -520,7 +523,10 @@ class PurchasePlan(Model): 'publisher': {'key': 'publisher', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(PurchasePlan, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.product = kwargs.get('product', None) @@ -528,10 +534,10 @@ def __init__(self, **kwargs): self.publisher = kwargs.get('publisher', None) -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -539,6 +545,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 3526d106a5ca..dc31d6dfd597 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 @@ -1,62 +1,32 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_04_30.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) +from ._container_service_client_enums import * -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_04_30.models.CloudErrorBody] """ _attribute_map = { @@ -66,7 +36,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -74,11 +52,10 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class NetworkProfile(Model): +class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. Default value: "10.0.0.0/8" - . + :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 @@ -92,30 +69,36 @@ class NetworkProfile(Model): 'vnet_id': {'key': 'vnetId', 'type': 'str'}, } - def __init__(self, *, vnet_cidr: str="10.0.0.0/8", peer_vnet_id: str=None, vnet_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + vnet_cidr: Optional[str] = "10.0.0.0/8", + peer_vnet_id: Optional[str] = None, + vnet_id: Optional[str] = None, + **kwargs + ): super(NetworkProfile, self).__init__(**kwargs) self.vnet_cidr = vnet_cidr self.peer_vnet_id = peer_vnet_id self.vnet_id = vnet_id -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -134,7 +117,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -146,41 +135,35 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class OpenShiftManagedCluster(Resource): """OpenShift Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 + :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. + :ivar provisioning_state: The current deployment or provisioning state, which only appears in + the response. :vartype provisioning_state: str - :param open_shift_version: Required. Version of OpenShift specified when - creating the cluster. + :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. + :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. + :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 + :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] @@ -201,7 +184,6 @@ class OpenShiftManagedCluster(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, - 'open_shift_version': {'required': True}, 'cluster_version': {'readonly': True}, 'public_hostname': {'readonly': True}, 'fqdn': {'readonly': True}, @@ -226,7 +208,20 @@ class OpenShiftManagedCluster(Resource): 'auth_profile': {'key': 'properties.authProfile', 'type': 'OpenShiftManagedClusterAuthProfile'}, } - def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=None, network_profile=None, router_profiles=None, master_pool_profile=None, agent_pool_profiles=None, auth_profile=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + plan: Optional["PurchasePlan"] = None, + open_shift_version: Optional[str] = None, + network_profile: Optional["NetworkProfile"] = None, + router_profiles: Optional[List["OpenShiftRouterProfile"]] = None, + master_pool_profile: Optional["OpenShiftManagedClusterMasterPoolProfile"] = None, + agent_pool_profiles: Optional[List["OpenShiftManagedClusterAgentPoolProfile"]] = None, + auth_profile: Optional["OpenShiftManagedClusterAuthProfile"] = None, + **kwargs + ): super(OpenShiftManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.plan = plan self.provisioning_state = None @@ -241,15 +236,15 @@ def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=No self.auth_profile = auth_profile -class OpenShiftManagedClusterBaseIdentityProvider(Model): +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 + sub-classes are: OpenShiftManagedClusterAADIdentityProvider. All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :param kind: Required. The kind of the provider.Constant filled by server. :type kind: str """ @@ -265,9 +260,12 @@ class OpenShiftManagedClusterBaseIdentityProvider(Model): 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None + self.kind = None # type: Optional[str] class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): @@ -275,7 +273,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :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 @@ -283,8 +281,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden :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. + :param customer_admin_group_id: The groupId to be granted cluster admin role. :type customer_admin_group_id: str """ @@ -300,48 +297,50 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, } - def __init__(self, *, client_id: str=None, secret: str=None, tenant_id: str=None, customer_admin_group_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: Optional[str] = None, + secret: Optional[str] = None, + tenant_id: Optional[str] = None, + customer_admin_group_id: Optional[str] = None, + **kwargs + ): super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) + self.kind = 'AADIdentityProvider' # type: str self.client_id = client_id self.secret = secret self.tenant_id = tenant_id self.customer_admin_group_id = customer_admin_group_id - self.kind = 'AADIdentityProvider' -class OpenShiftManagedClusterAgentPoolProfile(Model): +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. + :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' + :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. Default value: - "10.0.0.0/24" . + :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' + :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 """ @@ -361,7 +360,17 @@ class OpenShiftManagedClusterAgentPoolProfile(Model): 'role': {'key': 'role', 'type': 'str'}, } - def __init__(self, *, name: str, count: int, vm_size, subnet_cidr: str="10.0.0.0/24", os_type="Linux", role=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: int, + vm_size: Union[str, "OpenShiftContainerServiceVMSize"], + subnet_cidr: Optional[str] = "10.0.0.0/24", + os_type: Optional[Union[str, "OSType"]] = "Linux", + role: Optional[Union[str, "OpenShiftAgentPoolProfileRole"]] = None, + **kwargs + ): super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -371,7 +380,7 @@ def __init__(self, *, name: str, count: int, vm_size, subnet_cidr: str="10.0.0.0 self.role = role -class OpenShiftManagedClusterAuthProfile(Model): +class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. :param identity_providers: Type of authentication profile to use. @@ -383,14 +392,18 @@ class OpenShiftManagedClusterAuthProfile(Model): 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, } - def __init__(self, *, identity_providers=None, **kwargs) -> None: + def __init__( + self, + *, + identity_providers: Optional[List["OpenShiftManagedClusterIdentityProvider"]] = None, + **kwargs + ): super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = identity_providers -class OpenShiftManagedClusterIdentityProvider(Model): - """Defines the configuration of the identity providers to be used in the - OpenShift cluster. +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 @@ -404,44 +417,75 @@ class OpenShiftManagedClusterIdentityProvider(Model): 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, } - def __init__(self, *, name: str=None, provider=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + provider: Optional["OpenShiftManagedClusterBaseIdentityProvider"] = None, + **kwargs + ): super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = name self.provider = provider -class OpenShiftManagedClusterMasterPoolProfile(Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for - OpenShift master VMs. +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, + *, + value: Optional[List["OpenShiftManagedCluster"]] = None, + **kwargs + ): + super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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. + :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. + :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' + :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 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 = { @@ -457,7 +501,16 @@ class OpenShiftManagedClusterMasterPoolProfile(Model): 'os_type': {'key': 'osType', 'type': 'str'}, } - def __init__(self, *, count: int, vm_size, name: str=None, subnet_cidr: str=None, os_type="Linux", **kwargs) -> None: + def __init__( + self, + *, + count: int, + vm_size: Union[str, "OpenShiftContainerServiceVMSize"], + name: Optional[str] = None, + subnet_cidr: Optional[str] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + **kwargs + ): super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -466,11 +519,10 @@ def __init__(self, *, count: int, vm_size, name: str=None, subnet_cidr: str=None self.os_type = os_type -class OpenShiftRouterProfile(Model): +class OpenShiftRouterProfile(msrest.serialization.Model): """Represents an OpenShift router. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -491,21 +543,25 @@ class OpenShiftRouterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, name: str=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + **kwargs + ): super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = name self.public_subdomain = None self.fqdn = None -class PurchasePlan(Model): - """Used for establishing the purchase context of any 3rd Party artifact - through MarketPlace. +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. + :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 @@ -520,7 +576,15 @@ class PurchasePlan(Model): 'publisher': {'key': 'publisher', 'type': 'str'}, } - def __init__(self, *, name: str=None, product: str=None, promotion_code: str=None, publisher: str=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + product: Optional[str] = None, + promotion_code: Optional[str] = None, + publisher: Optional[str] = None, + **kwargs + ): super(PurchasePlan, self).__init__(**kwargs) self.name = name self.product = product @@ -528,10 +592,10 @@ def __init__(self, *, name: str=None, product: str=None, promotion_code: str=Non self.publisher = publisher -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -539,6 +603,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_paged_models.py deleted file mode 100644 index 40c5cfe4ab38..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/_paged_models.py +++ /dev/null @@ -1,27 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OpenShiftManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`OpenShiftManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OpenShiftManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(OpenShiftManagedClusterPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/__init__.py index fa983c289926..45d890441cd5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations 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 6afed0625896..372841c89d82 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 @@ -1,549 +1,609 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class OpenShiftManagedClustersOperations(object): """OpenShiftManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_04_30.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. - :ivar api_version: Client Api Version. Constant value: "2019-04-30". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-04-30" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): - """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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OpenShiftManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] - :raises: :class:`CloudError` + self, + **kwargs # type: Any + ): + # type: (...) -> 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] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists OpenShift managed clusters in the specified subscription and - resource group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 operation returns properties of each OpenShift - managed cluster. + Lists OpenShift managed clusters in the specified subscription and resource group. The + operation returns properties of each OpenShift managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OpenShiftManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] - :raises: :class:`CloudError` + :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] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OpenShiftManagedCluster" """Gets a OpenShift managed cluster. - Gets the details of the managed OpenShift cluster with a specified - resource group and name. + Gets the details of the managed OpenShift cluster with a specified resource group and name. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OpenShiftManagedCluster or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OpenShiftManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError """ + 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" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.OpenShiftManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates an OpenShift managed cluster. - Creates or updates a OpenShift managed cluster with the specified - configuration for agents and OpenShift version. + Creates or updates a OpenShift managed cluster with the specified configuration for agents and + OpenShift version. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param parameters: Parameters supplied to the Create or Update an - OpenShift Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update an OpenShift Managed Cluster + operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns OpenShiftManagedCluster - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('OpenShiftManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + 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/openShiftManagedClusters/{resourceName}'} # type: ignore def _update_tags_initial( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns OpenShiftManagedCluster - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('OpenShiftManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + 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/openShiftManagedClusters/{resourceName}'} # type: ignore def _delete_initial( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-04-30" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an OpenShift managed cluster. - Deletes the OpenShift managed cluster with a specified resource group - and name. + Deletes the OpenShift managed cluster with a specified resource group and name. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} + 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/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/version.py deleted file mode 100644 index c5d161575be0..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2019-04-30" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..28442efd1478 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2019-06-01" + 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 = policies.BearerTokenCredentialPolicy(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 635127e3e69b..e6f0ee45a662 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -19,43 +24,56 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_06_01.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2019_06_01.operations.ManagedClustersOperations - :ivar agent_pools: AgentPools operations + :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_06_01.operations.AgentPoolsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2019-06-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_06_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_metadata.json new file mode 100644 index 000000000000..01b8d0b845fe --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2019-06-01", + "total_api_version_list": ["2019-06-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..a93e9ab153d1 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2019-06-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..6ffbe691d859 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_container_service_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2019_06_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..cec950e56491 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2019_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2019_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2019_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..82fcfbf63565 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1071 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2019_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2019_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2019_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 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 new file mode 100644 index 000000000000..fb80d8eb5e9c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2019_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2019_06_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/__init__.py index 84eeeb2e1081..36528dbf044b 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 @@ -1,20 +1,19 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -31,68 +30,75 @@ 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 - from ._models import AgentPoolAvailableVersions - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models import AgentPoolUpgradeProfile - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models import ContainerServiceDiagnosticsProfile - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterAgentPoolProfileProperties - from ._models import ManagedClusterIdentity - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterUpgradeProfile - from ._models import ManagedClusterWindowsProfile - from ._models import OperationValue - from ._models import Resource - from ._models import SubResource - from ._models import TagsObject -from ._paged_models import AgentPoolPaged -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( + AgentPoolType, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, - AgentPoolType, - ScaleSetPriority, - ScaleSetEvictionPolicy, + Count, + LoadBalancerSku, NetworkPlugin, NetworkPolicy, - LoadBalancerSku, + OSType, ResourceIdentityType, + ScaleSetEvictionPolicy, + ScaleSetPriority, ) __all__ = [ 'AgentPool', 'AgentPoolAvailableVersions', 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', 'AgentPoolUpgradeProfile', 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'CloudErrorBody', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', 'ContainerServiceMasterProfile', @@ -109,26 +115,26 @@ 'ManagedClusterAgentPoolProfile', 'ManagedClusterAgentPoolProfileProperties', 'ManagedClusterIdentity', + 'ManagedClusterListResult', 'ManagedClusterPoolUpgradeProfile', 'ManagedClusterPoolUpgradeProfileUpgradesItem', 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', 'ManagedClusterWindowsProfile', + 'OperationListResult', 'OperationValue', 'Resource', 'SubResource', 'TagsObject', - 'OperationValuePaged', - 'ManagedClusterPaged', - 'AgentPoolPaged', + 'AgentPoolType', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', - 'AgentPoolType', - 'ScaleSetPriority', - 'ScaleSetEvictionPolicy', + 'Count', + 'LoadBalancerSku', 'NetworkPlugin', 'NetworkPolicy', - 'LoadBalancerSku', + 'OSType', 'ResourceIdentityType', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', ] 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 aa6915a8defc..b481cccbda24 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 @@ -1,244 +1,284 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class AgentPoolType(str, Enum): - - virtual_machine_scale_sets = "VirtualMachineScaleSets" - availability_set = "AvailabilitySet" - - -class ScaleSetPriority(str, Enum): - - low = "Low" - regular = "Regular" - - -class ScaleSetEvictionPolicy(str, Enum): - - delete = "Delete" - deallocate = "Deallocate" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" - azure = "azure" - - -class LoadBalancerSku(str, Enum): - - standard = "standard" - basic = "basic" - - -class ResourceIdentityType(str, Enum): - - system_assigned = "SystemAssigned" - none = "None" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """AgentPoolType represents types of an agent pool. VirtualMachineScaleSets type is still in + PREVIEW. + """ + + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + AVAILABILITY_SET = "AvailabilitySet" + +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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """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)): + """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. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" + +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. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. + """ + + LOW = "Low" + REGULAR = "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 index b35111df6d57..01390e7cfcc6 100644 --- 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 @@ -1,30 +1,25 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class SubResource(Model): +class SubResource(msrest.serialization.Model): """Reference to another subresource. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +35,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,121 +48,102 @@ def __init__(self, **kwargs): class AgentPool(SubResource): """Agent Pool. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -172,6 +151,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -188,7 +168,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -198,7 +178,10 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = kwargs.get('count', None) self.vm_size = kwargs.get('vm_size', None) @@ -209,7 +192,7 @@ def __init__(self, **kwargs): 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.agent_pool_type = kwargs.get('agent_pool_type', 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) @@ -219,11 +202,10 @@ def __init__(self, **kwargs): self.node_taints = kwargs.get('node_taints', None) -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -249,7 +231,10 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -257,7 +242,7 @@ def __init__(self, **kwargs): self.agent_pool_versions = kwargs.get('agent_pool_versions', None) -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -274,18 +259,49 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 AgentPoolUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -295,16 +311,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -326,17 +338,20 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.kubernetes_version = kwargs['kubernetes_version'] self.os_type = kwargs.get('os_type', "Linux") self.upgrades = kwargs.get('upgrades', None) -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -350,56 +365,29 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_06_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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_06_01.models.CloudErrorBody] """ _attribute_map = { @@ -409,7 +397,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -417,13 +408,12 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMDiagnostics """ @@ -436,23 +426,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -465,93 +455,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -561,6 +537,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -575,11 +552,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -587,37 +567,29 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 + :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 = { @@ -637,7 +609,10 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -648,13 +623,13 @@ def __init__(self, **kwargs): self.load_balancer_sku = kwargs.get('load_balancer_sku', None) -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -667,19 +642,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -691,24 +668,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -722,17 +699,19 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -750,21 +729,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_06_01.models.CredentialResult] """ _validation = { @@ -775,28 +755,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -815,41 +797,43 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -858,42 +842,35 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterIdentity """ _validation = { @@ -912,6 +889,7 @@ class ManagedCluster(Resource): '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'}, @@ -928,11 +906,14 @@ class ManagedCluster(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, } - def __init__(self, **kwargs): + 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) @@ -949,10 +930,9 @@ def __init__(self, **kwargs): 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) - self.identity = kwargs.get('identity', None) -class ManagedClusterAADProfile(Model): +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. @@ -963,8 +943,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -980,10 +960,13 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) + 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) @@ -991,20 +974,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1026,12 +1008,15 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. @@ -1051,127 +1036,111 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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}, } @@ -1195,7 +1164,10 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = kwargs.get('count', None) self.vm_size = kwargs.get('vm_size', None) @@ -1219,123 +1191,104 @@ def __init__(self, **kwargs): 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. + Variables are only 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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. + :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}$'}, } @@ -1361,31 +1314,30 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] -class ManagedClusterIdentity(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1396,33 +1348,61 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = kwargs.get('type', None) -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1439,15 +1419,18 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1461,22 +1444,23 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1489,17 +1473,19 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1509,12 +1495,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1535,22 +1520,24 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.control_plane_profile = kwargs['control_plane_profile'] + self.agent_pool_profiles = kwargs['agent_pool_profiles'] -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1566,17 +1553,44 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) + self.admin_username = kwargs['admin_username'] self.admin_password = kwargs.get('admin_password', None) -class OperationValue(Model): +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. + 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 @@ -1610,7 +1624,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1620,10 +1637,10 @@ def __init__(self, **kwargs): self.provider = None -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1631,6 +1648,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 13c68cbf9f9a..9cfd82c72e64 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 @@ -1,30 +1,29 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class SubResource(Model): +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. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +39,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,121 +52,102 @@ def __init__(self, **kwargs) -> None: class AgentPool(SubResource): """Agent Pool. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -172,6 +155,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -188,7 +172,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -198,7 +182,27 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, agent_pool_type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + node_taints: Optional[List[str]] = None, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -209,7 +213,7 @@ def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, self.max_count = max_count self.min_count = min_count self.enable_auto_scaling = enable_auto_scaling - self.agent_pool_type = agent_pool_type + self.type_properties_type = type_properties_type self.orchestrator_version = orchestrator_version self.provisioning_state = None self.availability_zones = availability_zones @@ -219,11 +223,10 @@ def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, self.node_taints = node_taints -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -249,7 +252,12 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: + def __init__( + self, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -257,7 +265,7 @@ def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: self.agent_pool_versions = agent_pool_versions -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -274,18 +282,55 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, default: bool=None, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class AgentPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -295,16 +340,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -326,7 +367,14 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -336,7 +384,7 @@ def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, * self.upgrades = upgrades -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -350,56 +398,32 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_06_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_06_01.models.CloudErrorBody] """ _attribute_map = { @@ -409,7 +433,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -417,13 +449,12 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceVMDiagnostics """ @@ -436,23 +467,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_06_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -465,93 +498,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -561,6 +583,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -575,7 +598,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -587,37 +621,29 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 + :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 = { @@ -637,7 +663,18 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", load_balancer_sku=None, **kwargs) -> None: + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = 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", + load_balancer_sku: Optional[Union[str, "LoadBalancerSku"]] = None, + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -648,13 +685,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: s self.load_balancer_sku = load_balancer_sku -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -667,19 +704,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -691,24 +732,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -722,17 +765,21 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -750,21 +797,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_06_01.models.CredentialResult] """ _validation = { @@ -775,28 +823,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -815,7 +865,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -827,29 +883,28 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ManagedCluster(Resource): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -858,42 +913,35 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterIdentity """ _validation = { @@ -912,6 +960,7 @@ class ManagedCluster(Resource): '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'}, @@ -928,11 +977,31 @@ class ManagedCluster(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, } - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, node_resource_group: str=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_authorized_ip_ranges=None, identity=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + api_server_authorized_ip_ranges: Optional[List[str]] = None, + **kwargs + ): super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity self.provisioning_state = None self.max_agent_pools = None self.kubernetes_version = kubernetes_version @@ -949,10 +1018,9 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.network_profile = network_profile self.aad_profile = aad_profile self.api_server_authorized_ip_ranges = api_server_authorized_ip_ranges - self.identity = identity -class ManagedClusterAADProfile(Model): +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. @@ -963,8 +1031,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -980,7 +1048,15 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_app_id: str, + server_app_id: str, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -991,20 +1067,19 @@ def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1026,12 +1101,19 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. @@ -1051,127 +1133,114 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config -class ManagedClusterAgentPoolProfileProperties(Model): +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. + 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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}, } @@ -1195,7 +1264,27 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + node_taints: Optional[List[str]] = None, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1219,123 +1308,104 @@ def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=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. + Variables are only 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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. + :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}$'}, } @@ -1361,31 +1431,48 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, name: str, count: int=None, vm_size=None, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + node_taints: Optional[List[str]] = None, + **kwargs + ): 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 -class ManagedClusterIdentity(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1396,33 +1483,65 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type -class ManagedClusterPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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). + :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. + :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] """ @@ -1439,7 +1558,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1447,7 +1574,7 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1461,22 +1588,26 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1489,17 +1620,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1509,12 +1645,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1535,7 +1670,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1544,13 +1685,12 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1566,17 +1706,47 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str=None, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class OperationValue(Model): +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. + 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 @@ -1610,7 +1780,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1620,10 +1793,10 @@ def __init__(self, **kwargs) -> None: self.provider = None -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1631,6 +1804,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_paged_models.py deleted file mode 100644 index da24c704a9c8..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_paged_models.py +++ /dev/null @@ -1,53 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) -class AgentPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`AgentPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AgentPool]'} - } - - def __init__(self, *args, **kwargs): - - super(AgentPoolPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/__init__.py index d1b67f7888b7..5aac40228eec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 8d6b93954a30..92e9eb4dcd21 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 @@ -1,127 +1,141 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class AgentPoolsOperations(object): """AgentPoolsOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_06_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-06-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" - - self.config = config + self._config = config def list( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 of each agent pool. + Gets a list of agent pools in the specified managed cluster. The operation returns properties + of each 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AgentPool - :rtype: - ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolPaged[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore def get( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" """Gets the agent pool. - Gets the details of the agent pool by managed cluster and resource - group. + Gets the details of the agent pool by managed cluster and resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -129,115 +143,122 @@ def get( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_06_01.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', {})) + api_version = "2019-06-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + 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" + 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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AgentPool') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('AgentPool', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + 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"] """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -248,92 +269,114 @@ def create_or_update( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param parameters: Parameters supplied to the Create or Update an - agent pool operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_06_01.models.AgentPool - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns AgentPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_06_01.models.AgentPool]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - 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, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('AgentPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-06-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -344,46 +387,65 @@ def delete( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} + 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 def get_upgrade_profile( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 managed cluster name. + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -391,63 +453,60 @@ def get_upgrade_profile( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_06_01.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', {})) + api_version = "2019-06-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolUpgradeProfile', response) + deserialized = self._deserialize('AgentPoolUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore def get_available_agent_pool_versions( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -456,56 +515,48 @@ def get_available_agent_pool_versions( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolAvailableVersions or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolAvailableVersions - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_06_01.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', {})) + api_version = "2019-06-01" + accept = "application/json" + # Construct URL - url = self.get_available_agent_pool_versions.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolAvailableVersions', response) + deserialized = self._deserialize('AgentPoolAvailableVersions', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + 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 1f72b3b2a011..89280167e866 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 @@ -1,677 +1,696 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_06_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-06-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_06_01.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', {})) + api_version = "2019-06-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_06_01.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', {})) + api_version = "2019-06-01" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_06_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_06_01.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', {})) + api_version = "2019-06-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_06_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_06_01.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', {})) + api_version = "2019-06-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true + :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.v2019_06_01.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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', {})) + api_version = "2019-06-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -680,88 +699,110 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-06-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -770,85 +811,111 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -857,90 +924,115 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -949,40 +1041,52 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} + 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 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 f261bb6235b0..ca73352dee0c 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_06_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-06-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2019_06_01.models.OperationValuePaged[~azure.mgmt.containerservice.v2019_06_01.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2019_06_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/version.py deleted file mode 100644 index 4174449873ab..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2019-06-01" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..1cbb309f1ab7 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2019-08-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', '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 = policies.BearerTokenCredentialPolicy(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 1b24da013b7b..6b4419440b5e 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -19,43 +24,56 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_08_01.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2019_08_01.operations.ManagedClustersOperations - :ivar agent_pools: AgentPools operations + :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_08_01.operations.AgentPoolsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2019-08-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_08_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_metadata.json new file mode 100644 index 000000000000..c05d1095d9c7 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2019-08-01", + "total_api_version_list": ["2019-08-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..e2041e496021 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2019-08-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..d4972e19518c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_container_service_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2019_08_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..ec1dfc20b373 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2019_08_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2019_08_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2019_08_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..aa722963c4de --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1175 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2019_08_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2019_08_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_08_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_08_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2019_08_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..e5f625edfffb --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2019_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2019_08_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/__init__.py index 48e637b79406..90e3057ac05e 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 @@ -1,20 +1,19 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -26,12 +25,13 @@ 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 ManagedClusterAPIServerAccessProfile 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 @@ -41,70 +41,76 @@ 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 - from ._models import AgentPoolAvailableVersions - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models import AgentPoolUpgradeProfile - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models import ContainerServiceDiagnosticsProfile - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterAgentPoolProfileProperties - from ._models import ManagedClusterAPIServerAccessProfile - from ._models import ManagedClusterIdentity - from ._models import ManagedClusterLoadBalancerProfile - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterUpgradeProfile - from ._models import ManagedClusterWindowsProfile - from ._models import OperationValue - from ._models import Resource - from ._models import ResourceReference - from ._models import SubResource - from ._models import TagsObject -from ._paged_models import AgentPoolPaged -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( + AgentPoolType, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, - AgentPoolType, - ScaleSetPriority, - ScaleSetEvictionPolicy, + Count, + LoadBalancerSku, NetworkPlugin, NetworkPolicy, - LoadBalancerSku, + OSType, ResourceIdentityType, + ScaleSetEvictionPolicy, + ScaleSetPriority, ) __all__ = [ 'AgentPool', 'AgentPoolAvailableVersions', 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', 'AgentPoolUpgradeProfile', 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'CloudErrorBody', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', 'ContainerServiceMasterProfile', @@ -116,12 +122,13 @@ 'CredentialResults', 'ManagedCluster', 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterAccessProfile', 'ManagedClusterAddonProfile', 'ManagedClusterAgentPoolProfile', 'ManagedClusterAgentPoolProfileProperties', - 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterIdentity', + 'ManagedClusterListResult', 'ManagedClusterLoadBalancerProfile', 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', @@ -131,22 +138,21 @@ 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', 'ManagedClusterWindowsProfile', + 'OperationListResult', 'OperationValue', 'Resource', 'ResourceReference', 'SubResource', 'TagsObject', - 'OperationValuePaged', - 'ManagedClusterPaged', - 'AgentPoolPaged', + 'AgentPoolType', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', - 'AgentPoolType', - 'ScaleSetPriority', - 'ScaleSetEvictionPolicy', + 'Count', + 'LoadBalancerSku', 'NetworkPlugin', 'NetworkPolicy', - 'LoadBalancerSku', + 'OSType', 'ResourceIdentityType', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', ] 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 aa6915a8defc..b481cccbda24 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 @@ -1,244 +1,284 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class AgentPoolType(str, Enum): - - virtual_machine_scale_sets = "VirtualMachineScaleSets" - availability_set = "AvailabilitySet" - - -class ScaleSetPriority(str, Enum): - - low = "Low" - regular = "Regular" - - -class ScaleSetEvictionPolicy(str, Enum): - - delete = "Delete" - deallocate = "Deallocate" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" - azure = "azure" - - -class LoadBalancerSku(str, Enum): - - standard = "standard" - basic = "basic" - - -class ResourceIdentityType(str, Enum): - - system_assigned = "SystemAssigned" - none = "None" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """AgentPoolType represents types of an agent pool. VirtualMachineScaleSets type is still in + PREVIEW. + """ + + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + AVAILABILITY_SET = "AvailabilitySet" + +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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """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)): + """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. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" + +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. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. + """ + + LOW = "Low" + REGULAR = "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 index 59ba0b085fd3..191a4967324c 100644 --- 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 @@ -1,30 +1,25 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class SubResource(Model): +class SubResource(msrest.serialization.Model): """Reference to another subresource. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +35,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,121 +48,102 @@ def __init__(self, **kwargs): class AgentPool(SubResource): """Agent Pool. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -172,6 +151,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -188,7 +168,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -198,7 +178,10 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = kwargs.get('count', None) self.vm_size = kwargs.get('vm_size', None) @@ -209,7 +192,7 @@ def __init__(self, **kwargs): 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.agent_pool_type = kwargs.get('agent_pool_type', 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) @@ -219,11 +202,10 @@ def __init__(self, **kwargs): self.node_taints = kwargs.get('node_taints', None) -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -249,7 +231,10 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -257,7 +242,7 @@ def __init__(self, **kwargs): self.agent_pool_versions = kwargs.get('agent_pool_versions', None) -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -274,18 +259,49 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 AgentPoolUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -295,16 +311,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -326,17 +338,20 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.kubernetes_version = kwargs['kubernetes_version'] self.os_type = kwargs.get('os_type', "Linux") self.upgrades = kwargs.get('upgrades', None) -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -350,56 +365,29 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_08_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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_08_01.models.CloudErrorBody] """ _attribute_map = { @@ -409,7 +397,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -417,13 +408,12 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMDiagnostics """ @@ -436,23 +426,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -465,93 +455,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -561,6 +537,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -575,11 +552,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -587,37 +567,29 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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_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 @@ -641,7 +613,10 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, **kwargs): + 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) @@ -653,13 +628,13 @@ def __init__(self, **kwargs): self.load_balancer_profile = kwargs.get('load_balancer_profile', None) -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -672,19 +647,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -696,24 +673,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -727,17 +704,19 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -755,21 +734,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_08_01.models.CredentialResult] """ _validation = { @@ -780,28 +760,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -820,41 +802,43 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -863,43 +847,35 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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 - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterIdentity """ _validation = { @@ -918,6 +894,7 @@ class ManagedCluster(Resource): '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'}, @@ -934,11 +911,14 @@ class ManagedCluster(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, } - def __init__(self, **kwargs): + 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) @@ -955,10 +935,9 @@ def __init__(self, **kwargs): 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 = kwargs.get('identity', None) -class ManagedClusterAADProfile(Model): +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. @@ -969,8 +948,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -986,10 +965,13 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) + 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) @@ -997,20 +979,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1032,12 +1013,15 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. @@ -1057,127 +1041,111 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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}, } @@ -1201,7 +1169,10 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = kwargs.get('count', None) self.vm_size = kwargs.get('vm_size', None) @@ -1225,123 +1196,104 @@ def __init__(self, **kwargs): 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. + Variables are only 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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. + :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}$'}, } @@ -1367,19 +1319,20 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1388,32 +1341,31 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1424,58 +1376,90 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = kwargs.get('type', None) -class ManagedClusterLoadBalancerProfile(Model): +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_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = kwargs.get('managed_outbound_ips', None) + self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_ips = kwargs.get('outbound_ips', None) - self.effective_outbound_ips = kwargs.get('effective_outbound_ips', 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(Model): +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. . Default value: 1 . + :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 """ @@ -1487,12 +1471,15 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = kwargs.get('count', 1) -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1504,45 +1491,46 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = kwargs.get('public_ips', None) + self.public_i_ps = kwargs.get('public_i_ps', None) -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1559,15 +1547,18 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1581,22 +1572,23 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1609,17 +1601,19 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1629,12 +1623,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1655,22 +1648,24 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.control_plane_profile = kwargs['control_plane_profile'] + self.agent_pool_profiles = kwargs['agent_pool_profiles'] -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1686,17 +1681,44 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) + self.admin_username = kwargs['admin_username'] self.admin_password = kwargs.get('admin_password', None) -class OperationValue(Model): +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. + 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 @@ -1730,7 +1752,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1740,7 +1765,7 @@ def __init__(self, **kwargs): self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -1751,15 +1776,18 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = kwargs.get('id', None) -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1767,6 +1795,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 283459570300..3ec027c177d4 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 @@ -1,30 +1,29 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class SubResource(Model): +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. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +39,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,121 +52,102 @@ def __init__(self, **kwargs) -> None: class AgentPool(SubResource): """Agent Pool. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -172,6 +155,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -188,7 +172,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -198,7 +182,27 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, agent_pool_type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + node_taints: Optional[List[str]] = None, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -209,7 +213,7 @@ def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, self.max_count = max_count self.min_count = min_count self.enable_auto_scaling = enable_auto_scaling - self.agent_pool_type = agent_pool_type + self.type_properties_type = type_properties_type self.orchestrator_version = orchestrator_version self.provisioning_state = None self.availability_zones = availability_zones @@ -219,11 +223,10 @@ def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, self.node_taints = node_taints -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -249,7 +252,12 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: + def __init__( + self, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -257,7 +265,7 @@ def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: self.agent_pool_versions = agent_pool_versions -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -274,18 +282,55 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, default: bool=None, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class AgentPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -295,16 +340,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -326,7 +367,14 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -336,7 +384,7 @@ def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, * self.upgrades = upgrades -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -350,56 +398,32 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class CloudError(Model): +class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_08_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_08_01.models.CloudErrorBody] """ _attribute_map = { @@ -409,7 +433,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -417,13 +449,12 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceVMDiagnostics """ @@ -436,23 +467,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_08_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -465,93 +498,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -561,6 +583,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -575,7 +598,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -587,37 +621,29 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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_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 @@ -641,7 +667,19 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", load_balancer_sku=None, load_balancer_profile=None, **kwargs) -> None: + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = 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", + load_balancer_sku: Optional[Union[str, "LoadBalancerSku"]] = None, + load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -653,13 +691,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: s self.load_balancer_profile = load_balancer_profile -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -672,19 +710,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -696,24 +738,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -727,17 +771,21 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -755,21 +803,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_08_01.models.CredentialResult] """ _validation = { @@ -780,28 +829,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -820,7 +871,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -832,29 +889,28 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ManagedCluster(Resource): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -863,43 +919,35 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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 - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterIdentity """ _validation = { @@ -918,6 +966,7 @@ class ManagedCluster(Resource): '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'}, @@ -934,11 +983,31 @@ class ManagedCluster(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, } - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, node_resource_group: str=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_access_profile=None, identity=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + api_server_access_profile: Optional["ManagedClusterAPIServerAccessProfile"] = None, + **kwargs + ): super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity self.provisioning_state = None self.max_agent_pools = None self.kubernetes_version = kubernetes_version @@ -955,10 +1024,9 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.network_profile = network_profile self.aad_profile = aad_profile self.api_server_access_profile = api_server_access_profile - self.identity = identity -class ManagedClusterAADProfile(Model): +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. @@ -969,8 +1037,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -986,7 +1054,15 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_app_id: str, + server_app_id: str, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -997,20 +1073,19 @@ def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1032,12 +1107,19 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. @@ -1057,127 +1139,114 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config -class ManagedClusterAgentPoolProfileProperties(Model): +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. + 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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}, } @@ -1201,7 +1270,27 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + node_taints: Optional[List[str]] = None, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1225,123 +1314,104 @@ def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=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. + Variables are only 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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. + :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}$'}, } @@ -1367,19 +1437,38 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, name: str, count: int=None, vm_size=None, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + node_taints: Optional[List[str]] = None, + **kwargs + ): 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 -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1388,32 +1477,34 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, *, authorized_ip_ranges=None, enable_private_cluster: bool=None, **kwargs) -> None: + def __init__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + **kwargs + ): super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster -class ManagedClusterIdentity(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1424,58 +1515,99 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type -class ManagedClusterLoadBalancerProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - } - - def __init__(self, *, managed_outbound_ips=None, outbound_ip_prefixes=None, outbound_ips=None, effective_outbound_ips=None, **kwargs) -> None: + 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + } + + 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, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = managed_outbound_ips + self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes - self.outbound_ips = outbound_ips - self.effective_outbound_ips = effective_outbound_ips + self.outbound_i_ps = outbound_i_ps + self.effective_outbound_i_ps = effective_outbound_i_ps -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): +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. . Default value: 1 . + :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 """ @@ -1487,12 +1619,17 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, *, count: int=1, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = 1, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1504,45 +1641,50 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ip_prefixes=None, **kwargs) -> None: + def __init__( + self, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2019_08_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ips=None, **kwargs) -> None: + def __init__( + self, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = public_ips + self.public_i_ps = public_i_ps -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1559,7 +1701,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1567,7 +1717,7 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1581,22 +1731,26 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1609,17 +1763,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1629,12 +1788,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1655,7 +1813,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1664,13 +1828,12 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1686,17 +1849,47 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str=None, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class OperationValue(Model): +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. + 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 @@ -1730,7 +1923,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1740,7 +1936,7 @@ def __init__(self, **kwargs) -> None: self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -1751,15 +1947,20 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, *, id: str=None, **kwargs) -> None: + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = id -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1767,6 +1968,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_paged_models.py deleted file mode 100644 index 7a0bf6178a31..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_paged_models.py +++ /dev/null @@ -1,53 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) -class AgentPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`AgentPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AgentPool]'} - } - - def __init__(self, *args, **kwargs): - - super(AgentPoolPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/__init__.py index d1b67f7888b7..5aac40228eec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 b1a808335114..0f07a4cbde31 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 @@ -1,127 +1,141 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class AgentPoolsOperations(object): """AgentPoolsOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-08-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" - - self.config = config + self._config = config def list( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 of each agent pool. + Gets a list of agent pools in the specified managed cluster. The operation returns properties + of each 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AgentPool - :rtype: - ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolPaged[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore def get( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" """Gets the agent pool. - Gets the details of the agent pool by managed cluster and resource - group. + Gets the details of the agent pool by managed cluster and resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -129,115 +143,122 @@ def get( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_08_01.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', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + 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" + 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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AgentPool') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('AgentPool', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + 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"] """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -248,92 +269,114 @@ def create_or_update( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param parameters: Parameters supplied to the Create or Update an - agent pool operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_08_01.models.AgentPool - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns AgentPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_08_01.models.AgentPool]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - 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, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('AgentPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -344,46 +387,65 @@ def delete( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} + 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 def get_upgrade_profile( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 managed cluster name. + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -391,63 +453,60 @@ def get_upgrade_profile( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_08_01.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', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolUpgradeProfile', response) + deserialized = self._deserialize('AgentPoolUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore def get_available_agent_pool_versions( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -456,56 +515,48 @@ def get_available_agent_pool_versions( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolAvailableVersions or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolAvailableVersions - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_08_01.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', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.get_available_agent_pool_versions.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolAvailableVersions', response) + deserialized = self._deserialize('AgentPoolAvailableVersions', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + 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 a27b947938b1..cb57ce5356b9 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 @@ -1,677 +1,696 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-08-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_08_01.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', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_08_01.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', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_08_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_08_01.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', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_08_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_08_01.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', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true + :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.v2019_08_01.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -680,88 +699,110 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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, {}) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -770,85 +811,111 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -857,90 +924,115 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -949,84 +1041,108 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-08-01" + accept = "application/json" + # Construct URL - url = self.rotate_cluster_certificates.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def rotate_cluster_certificates( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1035,35 +1151,48 @@ def rotate_cluster_certificates( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._rotate_cluster_certificates_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} + 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 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 b1c5b037dc28..b1d4e564fd5a 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_08_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-08-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2019_08_01.models.OperationValuePaged[~azure.mgmt.containerservice.v2019_08_01.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2019_08_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/version.py deleted file mode 100644 index b99c58c616c0..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2019-08-01" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..8e23d77fb5c5 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2019-09-30-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 = policies.BearerTokenCredentialPolicy(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 0ee9fa9fce05..adc6c1e2beca 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 @@ -1,51 +1,69 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - - :ivar open_shift_managed_clusters: OpenShiftManagedClusters operations + :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2019_09_30_preview.operations.OpenShiftManagedClustersOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2019-09-30-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_09_30_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json new file mode 100644 index 000000000000..d724ab52dee5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_metadata.json @@ -0,0 +1,60 @@ +{ + "chosen_version": "2019-09-30-preview", + "total_api_version_list": ["2019-09-30-preview"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "open_shift_managed_clusters": "OpenShiftManagedClustersOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..42b340447590 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2019-09-30-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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..b168490435db --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_container_service_client.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import OpenShiftManagedClustersOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_09_30_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..45d890441cd5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations + +__all__ = [ + 'OpenShiftManagedClustersOperations', +] 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 new file mode 100644 index 000000000000..4d3ddca38007 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py @@ -0,0 +1,596 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OpenShiftManagedClustersOperations: + """OpenShiftManagedClustersOperations 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.v2019_09_30_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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/openShiftManagedClusters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + operation returns properties of each OpenShift managed cluster. + + :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] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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/openShiftManagedClusters'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.OpenShiftManagedCluster": + """Gets a OpenShift managed cluster. + + Gets the details of the managed OpenShift cluster with a specified resource group and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OpenShiftManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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" + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + 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, + resource_name: str, + parameters: "models.OpenShiftManagedCluster", + **kwargs + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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('OpenShiftManagedCluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.OpenShiftManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.OpenShiftManagedCluster"]: + """Creates or updates an OpenShift managed cluster. + + Creates or updates a OpenShift managed cluster with the specified configuration for agents and + OpenShift version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', 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/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.OpenShiftManagedCluster"]: + """Updates tags on an OpenShift managed cluster. + + Updates an OpenShift managed cluster with the specified tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', 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/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an OpenShift managed cluster. + + Deletes the OpenShift managed cluster with a specified resource group and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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/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 957aef2caa89..157115a6924d 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 @@ -1,15 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -17,6 +15,7 @@ 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 @@ -24,27 +23,30 @@ from ._models_py3 import Resource from ._models_py3 import TagsObject except (SyntaxError, ImportError): - from ._models import NetworkProfile - from ._models import OpenShiftManagedCluster - from ._models import OpenShiftManagedClusterAADIdentityProvider - from ._models import OpenShiftManagedClusterAgentPoolProfile - from ._models import OpenShiftManagedClusterAuthProfile - from ._models import OpenShiftManagedClusterBaseIdentityProvider - from ._models import OpenShiftManagedClusterIdentityProvider - from ._models import OpenShiftManagedClusterMasterPoolProfile - from ._models import OpenShiftManagedClusterMonitorProfile - from ._models import OpenShiftRouterProfile - from ._models import PurchasePlan - from ._models import Resource - from ._models import TagsObject -from ._paged_models import OpenShiftManagedClusterPaged + 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 ._container_service_client_enums import ( OSType, - OpenShiftContainerServiceVMSize, OpenShiftAgentPoolProfileRole, + OpenShiftContainerServiceVMSize, ) __all__ = [ + 'CloudErrorBody', 'NetworkProfile', 'OpenShiftManagedCluster', 'OpenShiftManagedClusterAADIdentityProvider', @@ -52,14 +54,14 @@ 'OpenShiftManagedClusterAuthProfile', 'OpenShiftManagedClusterBaseIdentityProvider', 'OpenShiftManagedClusterIdentityProvider', + 'OpenShiftManagedClusterListResult', 'OpenShiftManagedClusterMasterPoolProfile', 'OpenShiftManagedClusterMonitorProfile', 'OpenShiftRouterProfile', 'PurchasePlan', 'Resource', 'TagsObject', - 'OpenShiftManagedClusterPaged', 'OSType', - 'OpenShiftContainerServiceVMSize', 'OpenShiftAgentPoolProfileRole', + 'OpenShiftContainerServiceVMSize', ] 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 237179cc909e..05a77b92092e 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 @@ -1,61 +1,79 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class OpenShiftContainerServiceVMSize(str, Enum): - - standard_d2s_v3 = "Standard_D2s_v3" - standard_d4s_v3 = "Standard_D4s_v3" - standard_d8s_v3 = "Standard_D8s_v3" - standard_d16s_v3 = "Standard_D16s_v3" - standard_d32s_v3 = "Standard_D32s_v3" - standard_d64s_v3 = "Standard_D64s_v3" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_f8s_v2 = "Standard_F8s_v2" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8s = "Standard_F8s" - standard_f16s = "Standard_F16s" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_e16s_v3 = "Standard_E16s_v3" - standard_e20s_v3 = "Standard_E20s_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - - -class OpenShiftAgentPoolProfileRole(str, Enum): - - compute = "compute" - infra = "infra" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class OpenShiftAgentPoolProfileRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """OpenShiftAgentPoolProfileRole represents the role of the AgentPoolProfile. + """ + + COMPUTE = "compute" + INFRA = "infra" + +class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of OpenShift VMs. + """ + + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E20_S_V3 = "Standard_E20s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + +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" 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 index f95f204dcd30..5b674597c622 100644 --- 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 @@ -1,62 +1,28 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class CloudError(Model): +class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_09_30_preview.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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_09_30_preview.models.CloudErrorBody] """ _attribute_map = { @@ -66,7 +32,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -74,11 +43,10 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class NetworkProfile(Model): +class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. Default value: "10.0.0.0/8" - . + :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 @@ -92,30 +60,32 @@ class NetworkProfile(Model): 'vnet_id': {'key': 'vnetId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -134,54 +104,50 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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: Required. Version of OpenShift specified when - creating the cluster. + :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. + :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. + :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 + :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] @@ -205,7 +171,6 @@ class OpenShiftManagedCluster(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, - 'open_shift_version': {'required': True}, 'cluster_version': {'readonly': True}, 'public_hostname': {'readonly': True}, 'fqdn': {'readonly': True}, @@ -231,7 +196,10 @@ class OpenShiftManagedCluster(Resource): 'monitor_profile': {'key': 'properties.monitorProfile', 'type': 'OpenShiftManagedClusterMonitorProfile'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedCluster, self).__init__(**kwargs) self.plan = kwargs.get('plan', None) self.provisioning_state = None @@ -247,15 +215,15 @@ def __init__(self, **kwargs): self.monitor_profile = kwargs.get('monitor_profile', None) -class OpenShiftManagedClusterBaseIdentityProvider(Model): +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 + sub-classes are: OpenShiftManagedClusterAADIdentityProvider. All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :param kind: Required. The kind of the provider.Constant filled by server. :type kind: str """ @@ -271,9 +239,12 @@ class OpenShiftManagedClusterBaseIdentityProvider(Model): 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None + self.kind = None # type: Optional[str] class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): @@ -281,7 +252,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :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 @@ -289,8 +260,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden :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. + :param customer_admin_group_id: The groupId to be granted cluster admin role. :type customer_admin_group_id: str """ @@ -306,48 +276,45 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) - self.kind = 'AADIdentityProvider' -class OpenShiftManagedClusterAgentPoolProfile(Model): +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. + :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' + :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. Default value: - "10.0.0.0/24" . + :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' + :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 """ @@ -367,17 +334,20 @@ class OpenShiftManagedClusterAgentPoolProfile(Model): 'role': {'key': 'role', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) + 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(Model): +class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. :param identity_providers: Type of authentication profile to use. @@ -389,14 +359,16 @@ class OpenShiftManagedClusterAuthProfile(Model): 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = kwargs.get('identity_providers', None) -class OpenShiftManagedClusterIdentityProvider(Model): - """Defines the configuration of the identity providers to be used in the - OpenShift cluster. +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 @@ -410,44 +382,71 @@ class OpenShiftManagedClusterIdentityProvider(Model): 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.provider = kwargs.get('provider', None) -class OpenShiftManagedClusterMasterPoolProfile(Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for - OpenShift master VMs. +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. + :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. + :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' + :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 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 = { @@ -463,23 +462,25 @@ class OpenShiftManagedClusterMasterPoolProfile(Model): 'os_type': {'key': 'osType', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.name = kwargs.get('name', None) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', 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(Model): +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. + :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 + :param enabled: If the Log analytics integration should be turned on or off. :type enabled: bool """ @@ -488,17 +489,19 @@ class OpenShiftManagedClusterMonitorProfile(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): +class OpenShiftRouterProfile(msrest.serialization.Model): """Represents an OpenShift router. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -519,21 +522,23 @@ class OpenShiftRouterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.public_subdomain = None self.fqdn = None -class PurchasePlan(Model): - """Used for establishing the purchase context of any 3rd Party artifact - through MarketPlace. +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. + :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 @@ -548,7 +553,10 @@ class PurchasePlan(Model): 'publisher': {'key': 'publisher', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(PurchasePlan, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.product = kwargs.get('product', None) @@ -556,10 +564,10 @@ def __init__(self, **kwargs): self.publisher = kwargs.get('publisher', None) -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -567,6 +575,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 dacacdea84eb..b1df756f1b81 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 @@ -1,62 +1,32 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_09_30_preview.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) +from ._container_service_client_enums import * -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_09_30_preview.models.CloudErrorBody] """ _attribute_map = { @@ -66,7 +36,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -74,11 +52,10 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class NetworkProfile(Model): +class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. Default value: "10.0.0.0/8" - . + :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 @@ -92,30 +69,36 @@ class NetworkProfile(Model): 'vnet_id': {'key': 'vnetId', 'type': 'str'}, } - def __init__(self, *, vnet_cidr: str="10.0.0.0/8", peer_vnet_id: str=None, vnet_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + vnet_cidr: Optional[str] = "10.0.0.0/8", + peer_vnet_id: Optional[str] = None, + vnet_id: Optional[str] = None, + **kwargs + ): super(NetworkProfile, self).__init__(**kwargs) self.vnet_cidr = vnet_cidr self.peer_vnet_id = peer_vnet_id self.vnet_id = vnet_id -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -134,7 +117,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -146,42 +135,35 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class OpenShiftManagedCluster(Resource): """OpenShift Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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: Required. Version of OpenShift specified when - creating the cluster. + :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. + :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. + :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 + :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] @@ -205,7 +187,6 @@ class OpenShiftManagedCluster(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, - 'open_shift_version': {'required': True}, 'cluster_version': {'readonly': True}, 'public_hostname': {'readonly': True}, 'fqdn': {'readonly': True}, @@ -231,7 +212,21 @@ class OpenShiftManagedCluster(Resource): 'monitor_profile': {'key': 'properties.monitorProfile', 'type': 'OpenShiftManagedClusterMonitorProfile'}, } - def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=None, network_profile=None, router_profiles=None, master_pool_profile=None, agent_pool_profiles=None, auth_profile=None, monitor_profile=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + plan: Optional["PurchasePlan"] = None, + open_shift_version: Optional[str] = None, + network_profile: Optional["NetworkProfile"] = None, + router_profiles: Optional[List["OpenShiftRouterProfile"]] = None, + master_pool_profile: Optional["OpenShiftManagedClusterMasterPoolProfile"] = None, + agent_pool_profiles: Optional[List["OpenShiftManagedClusterAgentPoolProfile"]] = None, + auth_profile: Optional["OpenShiftManagedClusterAuthProfile"] = None, + monitor_profile: Optional["OpenShiftManagedClusterMonitorProfile"] = None, + **kwargs + ): super(OpenShiftManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.plan = plan self.provisioning_state = None @@ -247,15 +242,15 @@ def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=No self.monitor_profile = monitor_profile -class OpenShiftManagedClusterBaseIdentityProvider(Model): +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 + sub-classes are: OpenShiftManagedClusterAADIdentityProvider. All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :param kind: Required. The kind of the provider.Constant filled by server. :type kind: str """ @@ -271,9 +266,12 @@ class OpenShiftManagedClusterBaseIdentityProvider(Model): 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None + self.kind = None # type: Optional[str] class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): @@ -281,7 +279,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :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 @@ -289,8 +287,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden :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. + :param customer_admin_group_id: The groupId to be granted cluster admin role. :type customer_admin_group_id: str """ @@ -306,48 +303,50 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, } - def __init__(self, *, client_id: str=None, secret: str=None, tenant_id: str=None, customer_admin_group_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: Optional[str] = None, + secret: Optional[str] = None, + tenant_id: Optional[str] = None, + customer_admin_group_id: Optional[str] = None, + **kwargs + ): super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) + self.kind = 'AADIdentityProvider' # type: str self.client_id = client_id self.secret = secret self.tenant_id = tenant_id self.customer_admin_group_id = customer_admin_group_id - self.kind = 'AADIdentityProvider' -class OpenShiftManagedClusterAgentPoolProfile(Model): +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. + :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' + :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. Default value: - "10.0.0.0/24" . + :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' + :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 """ @@ -367,7 +366,17 @@ class OpenShiftManagedClusterAgentPoolProfile(Model): 'role': {'key': 'role', 'type': 'str'}, } - def __init__(self, *, name: str, count: int, vm_size, subnet_cidr: str="10.0.0.0/24", os_type="Linux", role=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: int, + vm_size: Union[str, "OpenShiftContainerServiceVMSize"], + subnet_cidr: Optional[str] = "10.0.0.0/24", + os_type: Optional[Union[str, "OSType"]] = "Linux", + role: Optional[Union[str, "OpenShiftAgentPoolProfileRole"]] = None, + **kwargs + ): super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -377,7 +386,7 @@ def __init__(self, *, name: str, count: int, vm_size, subnet_cidr: str="10.0.0.0 self.role = role -class OpenShiftManagedClusterAuthProfile(Model): +class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. :param identity_providers: Type of authentication profile to use. @@ -389,14 +398,18 @@ class OpenShiftManagedClusterAuthProfile(Model): 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, } - def __init__(self, *, identity_providers=None, **kwargs) -> None: + def __init__( + self, + *, + identity_providers: Optional[List["OpenShiftManagedClusterIdentityProvider"]] = None, + **kwargs + ): super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = identity_providers -class OpenShiftManagedClusterIdentityProvider(Model): - """Defines the configuration of the identity providers to be used in the - OpenShift cluster. +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 @@ -410,44 +423,76 @@ class OpenShiftManagedClusterIdentityProvider(Model): 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, } - def __init__(self, *, name: str=None, provider=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + provider: Optional["OpenShiftManagedClusterBaseIdentityProvider"] = None, + **kwargs + ): super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = name self.provider = provider -class OpenShiftManagedClusterMasterPoolProfile(Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for - OpenShift master VMs. +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, + *, + value: Optional[List["OpenShiftManagedCluster"]] = None, + **kwargs + ): + super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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. + :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. + :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' + :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 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 = { @@ -463,7 +508,16 @@ class OpenShiftManagedClusterMasterPoolProfile(Model): 'os_type': {'key': 'osType', 'type': 'str'}, } - def __init__(self, *, count: int, vm_size, name: str=None, subnet_cidr: str=None, os_type="Linux", **kwargs) -> None: + def __init__( + self, + *, + count: int, + vm_size: Union[str, "OpenShiftContainerServiceVMSize"], + name: Optional[str] = None, + subnet_cidr: Optional[str] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + **kwargs + ): super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -472,14 +526,13 @@ def __init__(self, *, count: int, vm_size, name: str=None, subnet_cidr: str=None self.os_type = os_type -class OpenShiftManagedClusterMonitorProfile(Model): +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. + :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 + :param enabled: If the Log analytics integration should be turned on or off. :type enabled: bool """ @@ -488,17 +541,22 @@ class OpenShiftManagedClusterMonitorProfile(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, *, workspace_resource_id: str=None, enabled: bool=None, **kwargs) -> None: + def __init__( + self, + *, + workspace_resource_id: Optional[str] = None, + enabled: Optional[bool] = None, + **kwargs + ): super(OpenShiftManagedClusterMonitorProfile, self).__init__(**kwargs) self.workspace_resource_id = workspace_resource_id self.enabled = enabled -class OpenShiftRouterProfile(Model): +class OpenShiftRouterProfile(msrest.serialization.Model): """Represents an OpenShift router. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -519,21 +577,25 @@ class OpenShiftRouterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, name: str=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + **kwargs + ): super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = name self.public_subdomain = None self.fqdn = None -class PurchasePlan(Model): - """Used for establishing the purchase context of any 3rd Party artifact - through MarketPlace. +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. + :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 @@ -548,7 +610,15 @@ class PurchasePlan(Model): 'publisher': {'key': 'publisher', 'type': 'str'}, } - def __init__(self, *, name: str=None, product: str=None, promotion_code: str=None, publisher: str=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + product: Optional[str] = None, + promotion_code: Optional[str] = None, + publisher: Optional[str] = None, + **kwargs + ): super(PurchasePlan, self).__init__(**kwargs) self.name = name self.product = product @@ -556,10 +626,10 @@ def __init__(self, *, name: str=None, product: str=None, promotion_code: str=Non self.publisher = publisher -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -567,6 +637,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_paged_models.py deleted file mode 100644 index bc30b82dfd4a..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/models/_paged_models.py +++ /dev/null @@ -1,27 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OpenShiftManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`OpenShiftManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OpenShiftManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(OpenShiftManagedClusterPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/__init__.py index fa983c289926..45d890441cd5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations 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 d3c4a1696dde..9d9ccdcf4666 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 @@ -1,549 +1,609 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class OpenShiftManagedClustersOperations(object): """OpenShiftManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_09_30_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. - :ivar api_version: Client Api Version. Constant value: "2019-09-30-preview". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-30-preview" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): - """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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OpenShiftManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] - :raises: :class:`CloudError` + self, + **kwargs # type: Any + ): + # type: (...) -> 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] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists OpenShift managed clusters in the specified subscription and - resource group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 operation returns properties of each OpenShift - managed cluster. + Lists OpenShift managed clusters in the specified subscription and resource group. The + operation returns properties of each OpenShift managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OpenShiftManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] - :raises: :class:`CloudError` + :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] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OpenShiftManagedCluster" """Gets a OpenShift managed cluster. - Gets the details of the managed OpenShift cluster with a specified - resource group and name. + Gets the details of the managed OpenShift cluster with a specified resource group and name. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OpenShiftManagedCluster or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OpenShiftManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError """ + 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" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.OpenShiftManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates an OpenShift managed cluster. - Creates or updates a OpenShift managed cluster with the specified - configuration for agents and OpenShift version. + Creates or updates a OpenShift managed cluster with the specified configuration for agents and + OpenShift version. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns OpenShiftManagedCluster - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('OpenShiftManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + 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/openShiftManagedClusters/{resourceName}'} # type: ignore def _update_tags_initial( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns OpenShiftManagedCluster - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('OpenShiftManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + 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/openShiftManagedClusters/{resourceName}'} # type: ignore def _delete_initial( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-09-30-preview" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an OpenShift managed cluster. - Deletes the OpenShift managed cluster with a specified resource group - and name. + Deletes the OpenShift managed cluster with a specified resource group and name. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} + 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/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/version.py deleted file mode 100644 index c5d161575be0..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2019-04-30" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..a5136bac09d5 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2019-10-01" + 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 = policies.BearerTokenCredentialPolicy(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 7fa72ba83f46..42d2f5745ba9 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -19,43 +24,56 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_10_01.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2019_10_01.operations.ManagedClustersOperations - :ivar agent_pools: AgentPools operations + :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_10_01.operations.AgentPoolsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2019-10-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_10_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_metadata.json new file mode 100644 index 000000000000..d918310ea82a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2019-10-01", + "total_api_version_list": ["2019-10-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..162d74b196a2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2019-10-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..9e790f762477 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_container_service_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2019_10_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..e5494d5284d3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_10_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2019_10_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2019_10_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2019_10_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..e14ca7a7033c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_10_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2019_10_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2019_10_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_10_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_10_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_10_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2019_10_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..155ed5305d60 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2019_10_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2019_10_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/__init__.py index 48e637b79406..90e3057ac05e 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 @@ -1,20 +1,19 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -26,12 +25,13 @@ 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 ManagedClusterAPIServerAccessProfile 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 @@ -41,70 +41,76 @@ 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 - from ._models import AgentPoolAvailableVersions - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models import AgentPoolUpgradeProfile - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models import ContainerServiceDiagnosticsProfile - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterAgentPoolProfileProperties - from ._models import ManagedClusterAPIServerAccessProfile - from ._models import ManagedClusterIdentity - from ._models import ManagedClusterLoadBalancerProfile - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterUpgradeProfile - from ._models import ManagedClusterWindowsProfile - from ._models import OperationValue - from ._models import Resource - from ._models import ResourceReference - from ._models import SubResource - from ._models import TagsObject -from ._paged_models import AgentPoolPaged -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( + AgentPoolType, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, - AgentPoolType, - ScaleSetPriority, - ScaleSetEvictionPolicy, + Count, + LoadBalancerSku, NetworkPlugin, NetworkPolicy, - LoadBalancerSku, + OSType, ResourceIdentityType, + ScaleSetEvictionPolicy, + ScaleSetPriority, ) __all__ = [ 'AgentPool', 'AgentPoolAvailableVersions', 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', 'AgentPoolUpgradeProfile', 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'CloudErrorBody', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', 'ContainerServiceMasterProfile', @@ -116,12 +122,13 @@ 'CredentialResults', 'ManagedCluster', 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterAccessProfile', 'ManagedClusterAddonProfile', 'ManagedClusterAgentPoolProfile', 'ManagedClusterAgentPoolProfileProperties', - 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterIdentity', + 'ManagedClusterListResult', 'ManagedClusterLoadBalancerProfile', 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', @@ -131,22 +138,21 @@ 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', 'ManagedClusterWindowsProfile', + 'OperationListResult', 'OperationValue', 'Resource', 'ResourceReference', 'SubResource', 'TagsObject', - 'OperationValuePaged', - 'ManagedClusterPaged', - 'AgentPoolPaged', + 'AgentPoolType', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', - 'AgentPoolType', - 'ScaleSetPriority', - 'ScaleSetEvictionPolicy', + 'Count', + 'LoadBalancerSku', 'NetworkPlugin', 'NetworkPolicy', - 'LoadBalancerSku', + 'OSType', 'ResourceIdentityType', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', ] 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 aa6915a8defc..b481cccbda24 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 @@ -1,244 +1,284 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class AgentPoolType(str, Enum): - - virtual_machine_scale_sets = "VirtualMachineScaleSets" - availability_set = "AvailabilitySet" - - -class ScaleSetPriority(str, Enum): - - low = "Low" - regular = "Regular" - - -class ScaleSetEvictionPolicy(str, Enum): - - delete = "Delete" - deallocate = "Deallocate" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" - azure = "azure" - - -class LoadBalancerSku(str, Enum): - - standard = "standard" - basic = "basic" - - -class ResourceIdentityType(str, Enum): - - system_assigned = "SystemAssigned" - none = "None" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """AgentPoolType represents types of an agent pool. VirtualMachineScaleSets type is still in + PREVIEW. + """ + + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + AVAILABILITY_SET = "AvailabilitySet" + +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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """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)): + """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. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" + +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. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. + """ + + LOW = "Low" + REGULAR = "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 index 753f79b6155e..3a0a3e0c7426 100644 --- 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 @@ -1,30 +1,25 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class SubResource(Model): +class SubResource(msrest.serialization.Model): """Reference to another subresource. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +35,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,121 +48,102 @@ def __init__(self, **kwargs): class AgentPool(SubResource): """Agent Pool. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -172,6 +151,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -188,7 +168,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -198,7 +178,10 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = kwargs.get('count', None) self.vm_size = kwargs.get('vm_size', None) @@ -209,7 +192,7 @@ def __init__(self, **kwargs): 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.agent_pool_type = kwargs.get('agent_pool_type', 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) @@ -219,11 +202,10 @@ def __init__(self, **kwargs): self.node_taints = kwargs.get('node_taints', None) -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -249,7 +231,10 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -257,7 +242,7 @@ def __init__(self, **kwargs): self.agent_pool_versions = kwargs.get('agent_pool_versions', None) -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -274,18 +259,49 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 AgentPoolUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -295,16 +311,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -326,17 +338,20 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.kubernetes_version = kwargs['kubernetes_version'] self.os_type = kwargs.get('os_type', "Linux") self.upgrades = kwargs.get('upgrades', None) -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -350,56 +365,29 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_10_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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_10_01.models.CloudErrorBody] """ _attribute_map = { @@ -409,7 +397,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -417,13 +408,12 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMDiagnostics """ @@ -436,23 +426,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -465,93 +455,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -561,6 +537,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -575,11 +552,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -587,37 +567,29 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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_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 @@ -641,7 +613,10 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, **kwargs): + 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) @@ -653,13 +628,13 @@ def __init__(self, **kwargs): self.load_balancer_profile = kwargs.get('load_balancer_profile', None) -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -672,19 +647,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -696,24 +673,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -727,17 +704,19 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -755,21 +734,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_10_01.models.CredentialResult] """ _validation = { @@ -780,28 +760,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -820,41 +802,43 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -865,43 +849,35 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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 - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterIdentity """ _validation = { @@ -921,6 +897,7 @@ class ManagedCluster(Resource): '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'}, @@ -938,11 +915,14 @@ class ManagedCluster(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, } - def __init__(self, **kwargs): + 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) @@ -960,10 +940,9 @@ def __init__(self, **kwargs): 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 = kwargs.get('identity', None) -class ManagedClusterAADProfile(Model): +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. @@ -974,8 +953,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -991,10 +970,13 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) + 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) @@ -1002,20 +984,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1037,12 +1018,15 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. @@ -1062,127 +1046,111 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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}, } @@ -1206,7 +1174,10 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = kwargs.get('count', None) self.vm_size = kwargs.get('vm_size', None) @@ -1230,123 +1201,104 @@ def __init__(self, **kwargs): 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. + Variables are only 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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. + :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}$'}, } @@ -1372,19 +1324,20 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1393,32 +1346,31 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1429,58 +1381,90 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = kwargs.get('type', None) -class ManagedClusterLoadBalancerProfile(Model): +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_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = kwargs.get('managed_outbound_ips', None) + self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_ips = kwargs.get('outbound_ips', None) - self.effective_outbound_ips = kwargs.get('effective_outbound_ips', 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(Model): +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. . Default value: 1 . + :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 """ @@ -1492,12 +1476,15 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = kwargs.get('count', 1) -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1509,45 +1496,46 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = kwargs.get('public_ips', None) + self.public_i_ps = kwargs.get('public_i_ps', None) -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1564,15 +1552,18 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1586,22 +1577,23 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1614,17 +1606,19 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1634,12 +1628,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1660,22 +1653,24 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.control_plane_profile = kwargs['control_plane_profile'] + self.agent_pool_profiles = kwargs['agent_pool_profiles'] -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1691,17 +1686,44 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) + self.admin_username = kwargs['admin_username'] self.admin_password = kwargs.get('admin_password', None) -class OperationValue(Model): +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. + 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 @@ -1735,7 +1757,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1745,7 +1770,7 @@ def __init__(self, **kwargs): self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -1756,15 +1781,18 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = kwargs.get('id', None) -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1772,6 +1800,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 5cac60b228c2..3d30470371e4 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 @@ -1,30 +1,29 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class SubResource(Model): +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. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +39,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,121 +52,102 @@ def __init__(self, **kwargs) -> None: class AgentPool(SubResource): """Agent Pool. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -172,6 +155,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -188,7 +172,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -198,7 +182,27 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, agent_pool_type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + node_taints: Optional[List[str]] = None, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -209,7 +213,7 @@ def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, self.max_count = max_count self.min_count = min_count self.enable_auto_scaling = enable_auto_scaling - self.agent_pool_type = agent_pool_type + self.type_properties_type = type_properties_type self.orchestrator_version = orchestrator_version self.provisioning_state = None self.availability_zones = availability_zones @@ -219,11 +223,10 @@ def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, self.node_taints = node_taints -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -249,7 +252,12 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: + def __init__( + self, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -257,7 +265,7 @@ def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: self.agent_pool_versions = agent_pool_versions -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -274,18 +282,55 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, default: bool=None, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class AgentPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -295,16 +340,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -326,7 +367,14 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -336,7 +384,7 @@ def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, * self.upgrades = upgrades -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -350,56 +398,32 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class CloudError(Model): +class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_10_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_10_01.models.CloudErrorBody] """ _attribute_map = { @@ -409,7 +433,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -417,13 +449,12 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceVMDiagnostics """ @@ -436,23 +467,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_10_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -465,93 +498,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -561,6 +583,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -575,7 +598,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -587,37 +621,29 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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_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 @@ -641,7 +667,19 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", load_balancer_sku=None, load_balancer_profile=None, **kwargs) -> None: + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = 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", + load_balancer_sku: Optional[Union[str, "LoadBalancerSku"]] = None, + load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -653,13 +691,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: s self.load_balancer_profile = load_balancer_profile -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -672,19 +710,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -696,24 +738,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -727,17 +771,21 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -755,21 +803,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_10_01.models.CredentialResult] """ _validation = { @@ -780,28 +829,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -820,7 +871,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -832,29 +889,28 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ManagedCluster(Resource): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -865,43 +921,35 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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 - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterIdentity """ _validation = { @@ -921,6 +969,7 @@ class ManagedCluster(Resource): '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'}, @@ -938,11 +987,31 @@ class ManagedCluster(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, } - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, node_resource_group: str=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_access_profile=None, identity=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + api_server_access_profile: Optional["ManagedClusterAPIServerAccessProfile"] = None, + **kwargs + ): super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity self.provisioning_state = None self.max_agent_pools = None self.kubernetes_version = kubernetes_version @@ -960,10 +1029,9 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.network_profile = network_profile self.aad_profile = aad_profile self.api_server_access_profile = api_server_access_profile - self.identity = identity -class ManagedClusterAADProfile(Model): +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. @@ -974,8 +1042,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -991,7 +1059,15 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_app_id: str, + server_app_id: str, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -1002,20 +1078,19 @@ def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1037,12 +1112,19 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. @@ -1062,127 +1144,114 @@ class ManagedClusterAddonProfile(Model): 'config': {'key': 'config', 'type': '{str}'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config -class ManagedClusterAgentPoolProfileProperties(Model): +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. + 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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}, } @@ -1206,7 +1275,27 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + node_taints: Optional[List[str]] = None, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1230,123 +1319,104 @@ def __init__(self, *, count: int=None, vm_size=None, os_disk_size_gb: int=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. + Variables are only 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. + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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. + :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}$'}, } @@ -1372,19 +1442,38 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, name: str, count: int=None, vm_size=None, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + node_taints: Optional[List[str]] = None, + **kwargs + ): 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 -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1393,32 +1482,34 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, *, authorized_ip_ranges=None, enable_private_cluster: bool=None, **kwargs) -> None: + def __init__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + **kwargs + ): super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster -class ManagedClusterIdentity(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1429,58 +1520,99 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type -class ManagedClusterLoadBalancerProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, - } - - def __init__(self, *, managed_outbound_ips=None, outbound_ip_prefixes=None, outbound_ips=None, effective_outbound_ips=None, **kwargs) -> None: + 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + } + + 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, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = managed_outbound_ips + self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes - self.outbound_ips = outbound_ips - self.effective_outbound_ips = effective_outbound_ips + self.outbound_i_ps = outbound_i_ps + self.effective_outbound_i_ps = effective_outbound_i_ps -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): +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. . Default value: 1 . + :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 """ @@ -1492,12 +1624,17 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, *, count: int=1, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = 1, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1509,45 +1646,50 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ip_prefixes=None, **kwargs) -> None: + def __init__( + self, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2019_10_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ips=None, **kwargs) -> None: + def __init__( + self, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = public_ips + self.public_i_ps = public_i_ps -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1564,7 +1706,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1572,7 +1722,7 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1586,22 +1736,26 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1614,17 +1768,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1634,12 +1793,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1660,7 +1818,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1669,13 +1833,12 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1691,17 +1854,47 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str=None, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class OperationValue(Model): +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. + 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 @@ -1735,7 +1928,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1745,7 +1941,7 @@ def __init__(self, **kwargs) -> None: self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -1756,15 +1952,20 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, *, id: str=None, **kwargs) -> None: + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = id -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1772,6 +1973,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_paged_models.py deleted file mode 100644 index ea9bb9008ff5..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_paged_models.py +++ /dev/null @@ -1,53 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) -class AgentPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`AgentPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AgentPool]'} - } - - def __init__(self, *args, **kwargs): - - super(AgentPoolPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/__init__.py index d1b67f7888b7..5aac40228eec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 c9dbdd83076d..f50ec9b207fe 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 @@ -1,127 +1,141 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class AgentPoolsOperations(object): """AgentPoolsOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_10_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-10-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-01" - - self.config = config + self._config = config def list( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 of each agent pool. + Gets a list of agent pools in the specified managed cluster. The operation returns properties + of each 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AgentPool - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolPaged[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore def get( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" """Gets the agent pool. - Gets the details of the agent pool by managed cluster and resource - group. + Gets the details of the agent pool by managed cluster and resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -129,115 +143,122 @@ def get( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_10_01.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', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + 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" + 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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AgentPool') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('AgentPool', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + 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"] """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -248,92 +269,114 @@ def create_or_update( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param parameters: Parameters supplied to the Create or Update an - agent pool operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_10_01.models.AgentPool - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns AgentPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_10_01.models.AgentPool]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - 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, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('AgentPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -344,46 +387,65 @@ def delete( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} + 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 def get_upgrade_profile( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 managed cluster name. + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -391,63 +453,60 @@ def get_upgrade_profile( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_10_01.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', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolUpgradeProfile', response) + deserialized = self._deserialize('AgentPoolUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore def get_available_agent_pool_versions( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -456,56 +515,48 @@ def get_available_agent_pool_versions( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolAvailableVersions or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolAvailableVersions - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_10_01.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', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.get_available_agent_pool_versions.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolAvailableVersions', response) + deserialized = self._deserialize('AgentPoolAvailableVersions', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + 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 7550a84a3e64..9898a5c62c82 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 @@ -1,742 +1,758 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_10_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-10-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_10_01.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', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_10_01.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', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_10_01.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', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_10_01.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', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def list_cluster_monitoring_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets cluster monitoring user credential of the managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_10_01.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', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true + :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.v2019_10_01.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -745,88 +761,110 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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, {}) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -835,85 +873,111 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -922,90 +986,115 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1014,84 +1103,108 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-01" + accept = "application/json" + # Construct URL - url = self.rotate_cluster_certificates.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def rotate_cluster_certificates( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1100,35 +1213,48 @@ def rotate_cluster_certificates( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._rotate_cluster_certificates_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} + 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 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 b24ee7de294e..e184cd5c3d44 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_10_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-10-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2019_10_01.models.OperationValuePaged[~azure.mgmt.containerservice.v2019_10_01.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2019_10_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/version.py deleted file mode 100644 index f0880ef49517..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2019-10-01" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..8ec15952c3a5 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2019-10-27-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 = policies.BearerTokenCredentialPolicy(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 af2740e28852..bae4b0e72461 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 @@ -1,51 +1,69 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import OpenShiftManagedClustersOperations from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - - :ivar open_shift_managed_clusters: OpenShiftManagedClusters operations + :ivar open_shift_managed_clusters: OpenShiftManagedClustersOperations operations :vartype open_shift_managed_clusters: azure.mgmt.containerservice.v2019_10_27_preview.operations.OpenShiftManagedClustersOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2019-10-27-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_10_27_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_metadata.json new file mode 100644 index 000000000000..a883ca1921ce --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_metadata.json @@ -0,0 +1,60 @@ +{ + "chosen_version": "2019-10-27-preview", + "total_api_version_list": ["2019-10-27-preview"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "open_shift_managed_clusters": "OpenShiftManagedClustersOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..849dbb94b24c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2019-10-27-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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..f431b63ebbc5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_container_service_client.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import OpenShiftManagedClustersOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.open_shift_managed_clusters = OpenShiftManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_10_27_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..45d890441cd5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations + +__all__ = [ + 'OpenShiftManagedClustersOperations', +] 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 new file mode 100644 index 000000000000..a1c001050e7f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/_open_shift_managed_clusters_operations.py @@ -0,0 +1,596 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OpenShiftManagedClustersOperations: + """OpenShiftManagedClustersOperations 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.v2019_10_27_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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/openShiftManagedClusters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + operation returns properties of each OpenShift managed cluster. + + :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] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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/openShiftManagedClusters'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.OpenShiftManagedCluster": + """Gets a OpenShift managed cluster. + + Gets the details of the managed OpenShift cluster with a specified resource group and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OpenShiftManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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" + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + 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, + resource_name: str, + parameters: "models.OpenShiftManagedCluster", + **kwargs + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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('OpenShiftManagedCluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.OpenShiftManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.OpenShiftManagedCluster"]: + """Creates or updates an OpenShift managed cluster. + + Creates or updates a OpenShift managed cluster with the specified configuration for agents and + OpenShift version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', 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/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.OpenShiftManagedCluster"]: + """Updates tags on an OpenShift managed cluster. + + Updates an OpenShift managed cluster with the specified tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', 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/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an OpenShift managed cluster. + + Deletes the OpenShift managed cluster with a specified resource group and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the OpenShift 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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/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 25c8d66e04bb..f958ee9ba5d2 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 @@ -1,15 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -18,6 +16,7 @@ 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 @@ -25,28 +24,31 @@ from ._models_py3 import Resource from ._models_py3 import TagsObject except (SyntaxError, ImportError): - from ._models import NetworkProfile - from ._models import OpenShiftAPIProperties - from ._models import OpenShiftManagedCluster - from ._models import OpenShiftManagedClusterAADIdentityProvider - from ._models import OpenShiftManagedClusterAgentPoolProfile - from ._models import OpenShiftManagedClusterAuthProfile - from ._models import OpenShiftManagedClusterBaseIdentityProvider - from ._models import OpenShiftManagedClusterIdentityProvider - from ._models import OpenShiftManagedClusterMasterPoolProfile - from ._models import OpenShiftManagedClusterMonitorProfile - from ._models import OpenShiftRouterProfile - from ._models import PurchasePlan - from ._models import Resource - from ._models import TagsObject -from ._paged_models import OpenShiftManagedClusterPaged + 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 ._container_service_client_enums import ( OSType, - OpenShiftContainerServiceVMSize, OpenShiftAgentPoolProfileRole, + OpenShiftContainerServiceVMSize, ) __all__ = [ + 'CloudErrorBody', 'NetworkProfile', 'OpenShiftAPIProperties', 'OpenShiftManagedCluster', @@ -55,14 +57,14 @@ 'OpenShiftManagedClusterAuthProfile', 'OpenShiftManagedClusterBaseIdentityProvider', 'OpenShiftManagedClusterIdentityProvider', + 'OpenShiftManagedClusterListResult', 'OpenShiftManagedClusterMasterPoolProfile', 'OpenShiftManagedClusterMonitorProfile', 'OpenShiftRouterProfile', 'PurchasePlan', 'Resource', 'TagsObject', - 'OpenShiftManagedClusterPaged', 'OSType', - 'OpenShiftContainerServiceVMSize', 'OpenShiftAgentPoolProfileRole', + 'OpenShiftContainerServiceVMSize', ] 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 237179cc909e..05a77b92092e 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 @@ -1,61 +1,79 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class OpenShiftContainerServiceVMSize(str, Enum): - - standard_d2s_v3 = "Standard_D2s_v3" - standard_d4s_v3 = "Standard_D4s_v3" - standard_d8s_v3 = "Standard_D8s_v3" - standard_d16s_v3 = "Standard_D16s_v3" - standard_d32s_v3 = "Standard_D32s_v3" - standard_d64s_v3 = "Standard_D64s_v3" - standard_ds4_v2 = "Standard_DS4_v2" - standard_ds5_v2 = "Standard_DS5_v2" - standard_f8s_v2 = "Standard_F8s_v2" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8s = "Standard_F8s" - standard_f16s = "Standard_F16s" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_e16s_v3 = "Standard_E16s_v3" - standard_e20s_v3 = "Standard_E20s_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_gs2 = "Standard_GS2" - standard_gs3 = "Standard_GS3" - standard_gs4 = "Standard_GS4" - standard_gs5 = "Standard_GS5" - standard_ds12_v2 = "Standard_DS12_v2" - standard_ds13_v2 = "Standard_DS13_v2" - standard_ds14_v2 = "Standard_DS14_v2" - standard_ds15_v2 = "Standard_DS15_v2" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - - -class OpenShiftAgentPoolProfileRole(str, Enum): - - compute = "compute" - infra = "infra" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class OpenShiftAgentPoolProfileRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """OpenShiftAgentPoolProfileRole represents the role of the AgentPoolProfile. + """ + + COMPUTE = "compute" + INFRA = "infra" + +class OpenShiftContainerServiceVMSize(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of OpenShift VMs. + """ + + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F16_S = "Standard_F16s" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E20_S_V3 = "Standard_E20s_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS5 = "Standard_GS5" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + +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" 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 index af0a0bd17b9b..2e9928ecb417 100644 --- 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 @@ -1,62 +1,28 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class CloudError(Model): +class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_10_27_preview.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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody] """ _attribute_map = { @@ -66,7 +32,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -74,14 +43,13 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class NetworkProfile(Model): +class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. Default value: "10.0.0.0/8" - . + :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 + :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 @@ -93,14 +61,17 @@ class NetworkProfile(Model): 'vnet_id': {'key': 'vnetId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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(Model): +class OpenShiftAPIProperties(msrest.serialization.Model): """Defines further properties on the API. :param private_api_server: Specifies if API server is public or private. @@ -111,28 +82,30 @@ class OpenShiftAPIProperties(Model): 'private_api_server': {'key': 'privateApiServer', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftAPIProperties, self).__init__(**kwargs) self.private_api_server = kwargs.get('private_api_server', None) -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -151,55 +124,50 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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: Required. Version of OpenShift specified when - creating the cluster. + :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. + :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. + :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. + :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 + :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] @@ -215,7 +183,7 @@ class OpenShiftManagedCluster(Resource): :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 + :param refresh_cluster: Allows node rotation. :type refresh_cluster: bool """ @@ -225,7 +193,6 @@ class OpenShiftManagedCluster(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, - 'open_shift_version': {'required': True}, 'cluster_version': {'readonly': True}, 'public_hostname': {'readonly': True}, 'fqdn': {'readonly': True}, @@ -252,7 +219,10 @@ class OpenShiftManagedCluster(Resource): 'refresh_cluster': {'key': 'properties.refreshCluster', 'type': 'bool'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedCluster, self).__init__(**kwargs) self.plan = kwargs.get('plan', None) self.provisioning_state = None @@ -269,15 +239,15 @@ def __init__(self, **kwargs): self.refresh_cluster = kwargs.get('refresh_cluster', None) -class OpenShiftManagedClusterBaseIdentityProvider(Model): +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 + sub-classes are: OpenShiftManagedClusterAADIdentityProvider. All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :param kind: Required. The kind of the provider.Constant filled by server. :type kind: str """ @@ -293,9 +263,12 @@ class OpenShiftManagedClusterBaseIdentityProvider(Model): 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None + self.kind = None # type: Optional[str] class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): @@ -303,7 +276,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :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 @@ -311,8 +284,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden :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. + :param customer_admin_group_id: The groupId to be granted cluster admin role. :type customer_admin_group_id: str """ @@ -328,48 +300,45 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) - self.kind = 'AADIdentityProvider' -class OpenShiftManagedClusterAgentPoolProfile(Model): +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. + :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' + :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. Default value: - "10.0.0.0/24" . + :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' + :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 """ @@ -389,17 +358,20 @@ class OpenShiftManagedClusterAgentPoolProfile(Model): 'role': {'key': 'role', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) + 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(Model): +class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. :param identity_providers: Type of authentication profile to use. @@ -411,14 +383,16 @@ class OpenShiftManagedClusterAuthProfile(Model): 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = kwargs.get('identity_providers', None) -class OpenShiftManagedClusterIdentityProvider(Model): - """Defines the configuration of the identity providers to be used in the - OpenShift cluster. +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 @@ -432,32 +406,61 @@ class OpenShiftManagedClusterIdentityProvider(Model): 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.provider = kwargs.get('provider', None) -class OpenShiftManagedClusterMasterPoolProfile(Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for - OpenShift master VMs. +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. + :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' + :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. @@ -479,22 +482,24 @@ class OpenShiftManagedClusterMasterPoolProfile(Model): 'api_properties': {'key': 'apiProperties', 'type': 'OpenShiftAPIProperties'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', None) - self.vm_size = kwargs.get('vm_size', None) + 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(Model): +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. + :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 + :param enabled: If the Log analytics integration should be turned on or off. :type enabled: bool """ @@ -503,17 +508,19 @@ class OpenShiftManagedClusterMonitorProfile(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): +class OpenShiftRouterProfile(msrest.serialization.Model): """Represents an OpenShift router. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -534,21 +541,23 @@ class OpenShiftRouterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.public_subdomain = None self.fqdn = None -class PurchasePlan(Model): - """Used for establishing the purchase context of any 3rd Party artifact - through MarketPlace. +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. + :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 @@ -563,7 +572,10 @@ class PurchasePlan(Model): 'publisher': {'key': 'publisher', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(PurchasePlan, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.product = kwargs.get('product', None) @@ -571,10 +583,10 @@ def __init__(self, **kwargs): self.publisher = kwargs.get('publisher', None) -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -582,6 +594,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 b5ba6c7e9c61..dbae13cd0286 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 @@ -1,62 +1,32 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error +from ._container_service_client_enums import * -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_10_27_preview.models.CloudErrorBody] """ _attribute_map = { @@ -66,7 +36,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -74,14 +52,13 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class NetworkProfile(Model): +class NetworkProfile(msrest.serialization.Model): """Represents the OpenShift networking configuration. - :param vnet_cidr: CIDR for the OpenShift Vnet. Default value: "10.0.0.0/8" - . + :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 + :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 @@ -93,14 +70,21 @@ class NetworkProfile(Model): 'vnet_id': {'key': 'vnetId', 'type': 'str'}, } - def __init__(self, *, vnet_cidr: str="10.0.0.0/8", management_subnet_cidr: str=None, vnet_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + vnet_cidr: Optional[str] = "10.0.0.0/8", + management_subnet_cidr: Optional[str] = None, + vnet_id: Optional[str] = None, + **kwargs + ): super(NetworkProfile, self).__init__(**kwargs) self.vnet_cidr = vnet_cidr self.management_subnet_cidr = management_subnet_cidr self.vnet_id = vnet_id -class OpenShiftAPIProperties(Model): +class OpenShiftAPIProperties(msrest.serialization.Model): """Defines further properties on the API. :param private_api_server: Specifies if API server is public or private. @@ -111,28 +95,32 @@ class OpenShiftAPIProperties(Model): 'private_api_server': {'key': 'privateApiServer', 'type': 'bool'}, } - def __init__(self, *, private_api_server: bool=None, **kwargs) -> None: + def __init__( + self, + *, + private_api_server: Optional[bool] = None, + **kwargs + ): super(OpenShiftAPIProperties, self).__init__(**kwargs) self.private_api_server = private_api_server -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -151,7 +139,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -163,43 +157,35 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class OpenShiftManagedCluster(Resource): """OpenShift Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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: Required. Version of OpenShift specified when - creating the cluster. + :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. + :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. + :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. + :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 + :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] @@ -215,7 +201,7 @@ class OpenShiftManagedCluster(Resource): :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 + :param refresh_cluster: Allows node rotation. :type refresh_cluster: bool """ @@ -225,7 +211,6 @@ class OpenShiftManagedCluster(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, - 'open_shift_version': {'required': True}, 'cluster_version': {'readonly': True}, 'public_hostname': {'readonly': True}, 'fqdn': {'readonly': True}, @@ -252,7 +237,22 @@ class OpenShiftManagedCluster(Resource): 'refresh_cluster': {'key': 'properties.refreshCluster', 'type': 'bool'}, } - def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=None, network_profile=None, router_profiles=None, master_pool_profile=None, agent_pool_profiles=None, auth_profile=None, monitor_profile=None, refresh_cluster: bool=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + plan: Optional["PurchasePlan"] = None, + open_shift_version: Optional[str] = None, + network_profile: Optional["NetworkProfile"] = None, + router_profiles: Optional[List["OpenShiftRouterProfile"]] = None, + master_pool_profile: Optional["OpenShiftManagedClusterMasterPoolProfile"] = None, + agent_pool_profiles: Optional[List["OpenShiftManagedClusterAgentPoolProfile"]] = None, + auth_profile: Optional["OpenShiftManagedClusterAuthProfile"] = None, + monitor_profile: Optional["OpenShiftManagedClusterMonitorProfile"] = None, + refresh_cluster: Optional[bool] = None, + **kwargs + ): super(OpenShiftManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.plan = plan self.provisioning_state = None @@ -269,15 +269,15 @@ def __init__(self, *, location: str, open_shift_version: str, tags=None, plan=No self.refresh_cluster = refresh_cluster -class OpenShiftManagedClusterBaseIdentityProvider(Model): +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 + sub-classes are: OpenShiftManagedClusterAADIdentityProvider. All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :param kind: Required. The kind of the provider.Constant filled by server. :type kind: str """ @@ -293,9 +293,12 @@ class OpenShiftManagedClusterBaseIdentityProvider(Model): 'kind': {'AADIdentityProvider': 'OpenShiftManagedClusterAADIdentityProvider'} } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OpenShiftManagedClusterBaseIdentityProvider, self).__init__(**kwargs) - self.kind = None + self.kind = None # type: Optional[str] class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIdentityProvider): @@ -303,7 +306,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden All required parameters must be populated in order to send to Azure. - :param kind: Required. Constant filled by server. + :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 @@ -311,8 +314,7 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden :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. + :param customer_admin_group_id: The groupId to be granted cluster admin role. :type customer_admin_group_id: str """ @@ -328,48 +330,50 @@ class OpenShiftManagedClusterAADIdentityProvider(OpenShiftManagedClusterBaseIden 'customer_admin_group_id': {'key': 'customerAdminGroupId', 'type': 'str'}, } - def __init__(self, *, client_id: str=None, secret: str=None, tenant_id: str=None, customer_admin_group_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: Optional[str] = None, + secret: Optional[str] = None, + tenant_id: Optional[str] = None, + customer_admin_group_id: Optional[str] = None, + **kwargs + ): super(OpenShiftManagedClusterAADIdentityProvider, self).__init__(**kwargs) + self.kind = 'AADIdentityProvider' # type: str self.client_id = client_id self.secret = secret self.tenant_id = tenant_id self.customer_admin_group_id = customer_admin_group_id - self.kind = 'AADIdentityProvider' -class OpenShiftManagedClusterAgentPoolProfile(Model): +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. + :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' + :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. Default value: - "10.0.0.0/24" . + :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' + :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 """ @@ -389,7 +393,17 @@ class OpenShiftManagedClusterAgentPoolProfile(Model): 'role': {'key': 'role', 'type': 'str'}, } - def __init__(self, *, name: str, count: int, vm_size, subnet_cidr: str="10.0.0.0/24", os_type="Linux", role=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: int, + vm_size: Union[str, "OpenShiftContainerServiceVMSize"], + subnet_cidr: Optional[str] = "10.0.0.0/24", + os_type: Optional[Union[str, "OSType"]] = "Linux", + role: Optional[Union[str, "OpenShiftAgentPoolProfileRole"]] = None, + **kwargs + ): super(OpenShiftManagedClusterAgentPoolProfile, self).__init__(**kwargs) self.name = name self.count = count @@ -399,7 +413,7 @@ def __init__(self, *, name: str, count: int, vm_size, subnet_cidr: str="10.0.0.0 self.role = role -class OpenShiftManagedClusterAuthProfile(Model): +class OpenShiftManagedClusterAuthProfile(msrest.serialization.Model): """Defines all possible authentication profiles for the OpenShift cluster. :param identity_providers: Type of authentication profile to use. @@ -411,14 +425,18 @@ class OpenShiftManagedClusterAuthProfile(Model): 'identity_providers': {'key': 'identityProviders', 'type': '[OpenShiftManagedClusterIdentityProvider]'}, } - def __init__(self, *, identity_providers=None, **kwargs) -> None: + def __init__( + self, + *, + identity_providers: Optional[List["OpenShiftManagedClusterIdentityProvider"]] = None, + **kwargs + ): super(OpenShiftManagedClusterAuthProfile, self).__init__(**kwargs) self.identity_providers = identity_providers -class OpenShiftManagedClusterIdentityProvider(Model): - """Defines the configuration of the identity providers to be used in the - OpenShift cluster. +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 @@ -432,32 +450,66 @@ class OpenShiftManagedClusterIdentityProvider(Model): 'provider': {'key': 'provider', 'type': 'OpenShiftManagedClusterBaseIdentityProvider'}, } - def __init__(self, *, name: str=None, provider=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + provider: Optional["OpenShiftManagedClusterBaseIdentityProvider"] = None, + **kwargs + ): super(OpenShiftManagedClusterIdentityProvider, self).__init__(**kwargs) self.name = name self.provider = provider -class OpenShiftManagedClusterMasterPoolProfile(Model): - """OpenShiftManagedClusterMaterPoolProfile contains configuration for - OpenShift master VMs. +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, + *, + value: Optional[List["OpenShiftManagedCluster"]] = None, + **kwargs + ): + super(OpenShiftManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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. + :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' + :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. @@ -479,7 +531,15 @@ class OpenShiftManagedClusterMasterPoolProfile(Model): 'api_properties': {'key': 'apiProperties', 'type': 'OpenShiftAPIProperties'}, } - def __init__(self, *, count: int, vm_size, subnet_cidr: str=None, api_properties=None, **kwargs) -> None: + def __init__( + self, + *, + count: int, + vm_size: Union[str, "OpenShiftContainerServiceVMSize"], + subnet_cidr: Optional[str] = None, + api_properties: Optional["OpenShiftAPIProperties"] = None, + **kwargs + ): super(OpenShiftManagedClusterMasterPoolProfile, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -487,14 +547,13 @@ def __init__(self, *, count: int, vm_size, subnet_cidr: str=None, api_properties self.api_properties = api_properties -class OpenShiftManagedClusterMonitorProfile(Model): +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. + :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 + :param enabled: If the Log analytics integration should be turned on or off. :type enabled: bool """ @@ -503,17 +562,22 @@ class OpenShiftManagedClusterMonitorProfile(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, *, workspace_resource_id: str=None, enabled: bool=None, **kwargs) -> None: + def __init__( + self, + *, + workspace_resource_id: Optional[str] = None, + enabled: Optional[bool] = None, + **kwargs + ): super(OpenShiftManagedClusterMonitorProfile, self).__init__(**kwargs) self.workspace_resource_id = workspace_resource_id self.enabled = enabled -class OpenShiftRouterProfile(Model): +class OpenShiftRouterProfile(msrest.serialization.Model): """Represents an OpenShift router. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -534,21 +598,25 @@ class OpenShiftRouterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, name: str=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + **kwargs + ): super(OpenShiftRouterProfile, self).__init__(**kwargs) self.name = name self.public_subdomain = None self.fqdn = None -class PurchasePlan(Model): - """Used for establishing the purchase context of any 3rd Party artifact - through MarketPlace. +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. + :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 @@ -563,7 +631,15 @@ class PurchasePlan(Model): 'publisher': {'key': 'publisher', 'type': 'str'}, } - def __init__(self, *, name: str=None, product: str=None, promotion_code: str=None, publisher: str=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + product: Optional[str] = None, + promotion_code: Optional[str] = None, + publisher: Optional[str] = None, + **kwargs + ): super(PurchasePlan, self).__init__(**kwargs) self.name = name self.product = product @@ -571,10 +647,10 @@ def __init__(self, *, name: str=None, product: str=None, promotion_code: str=Non self.publisher = publisher -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -582,6 +658,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_paged_models.py deleted file mode 100644 index c19244216ccd..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/models/_paged_models.py +++ /dev/null @@ -1,27 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OpenShiftManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`OpenShiftManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OpenShiftManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(OpenShiftManagedClusterPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/__init__.py index fa983c289926..45d890441cd5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._open_shift_managed_clusters_operations import OpenShiftManagedClustersOperations 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 25754a9c01f6..859eb9d7219d 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 @@ -1,549 +1,609 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class OpenShiftManagedClustersOperations(object): """OpenShiftManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_10_27_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. - :ivar api_version: Client Api Version. Constant value: "2019-10-27-preview". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-10-27-preview" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): - """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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OpenShiftManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] - :raises: :class:`CloudError` + self, + **kwargs # type: Any + ): + # type: (...) -> 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] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists OpenShift managed clusters in the specified subscription and - resource group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 operation returns properties of each OpenShift - managed cluster. + Lists OpenShift managed clusters in the specified subscription and resource group. The + operation returns properties of each OpenShift managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OpenShiftManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedClusterPaged[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] - :raises: :class:`CloudError` + :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] + :raises: ~azure.core.exceptions.HttpResponseError """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedClusterListResult"] + error_map = { + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + def extract_data(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedClusterListResult', 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OpenShiftManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OpenShiftManagedCluster" """Gets a OpenShift managed cluster. - Gets the details of the managed OpenShift cluster with a specified - resource group and name. + Gets the details of the managed OpenShift cluster with a specified resource group and name. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OpenShiftManagedCluster or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OpenShiftManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError """ + 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" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.OpenShiftManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'OpenShiftManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates an OpenShift managed cluster. - Creates or updates a OpenShift managed cluster with the specified - configuration for agents and OpenShift version. + Creates or updates a OpenShift managed cluster with the specified configuration for agents and + OpenShift version. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns OpenShiftManagedCluster - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('OpenShiftManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + 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/openShiftManagedClusters/{resourceName}'} # type: ignore def _update_tags_initial( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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('OpenShiftManagedCluster', response) + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns OpenShiftManagedCluster - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OpenShiftManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('OpenShiftManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OpenShiftManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} - + 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/openShiftManagedClusters/{resourceName}'} # type: ignore def _delete_initial( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-10-27-preview" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an OpenShift managed cluster. - Deletes the OpenShift managed cluster with a specified resource group - and name. + Deletes the OpenShift managed cluster with a specified resource group and name. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param resource_name: The name of the OpenShift managed cluster - resource. + :param resource_name: The name of the OpenShift managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'} + 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/openShiftManagedClusters/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/version.py deleted file mode 100644 index 41b1c18201ad..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2019-10-27-preview" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..e7c824a3542e 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2019-11-01" + 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 = policies.BearerTokenCredentialPolicy(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 4d9f165010bc..2c52b4eaface 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -19,43 +24,56 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2019_11_01.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2019_11_01.operations.ManagedClustersOperations - :ivar agent_pools: AgentPools operations + :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2019_11_01.operations.AgentPoolsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2019-11-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2019_11_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_metadata.json new file mode 100644 index 000000000000..9a6f1047d523 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2019-11-01", + "total_api_version_list": ["2019-11-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..1835526db31c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2019-11-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..cb1bdc69272a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_container_service_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2019_11_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..3744f59913a1 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_11_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2019_11_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2019_11_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2019_11_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..471e013115dc --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2019_11_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2019_11_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2019_11_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_11_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_11_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2019_11_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2019_11_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..da3a83d9986c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2019_11_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2019_11_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/__init__.py index 671f9f9401d1..31731299ad0c 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 @@ -1,20 +1,19 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -26,13 +25,14 @@ 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 ManagedClusterAPIServerAccessProfile 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 @@ -43,6 +43,7 @@ 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 @@ -50,68 +51,73 @@ from ._models_py3 import TagsObject from ._models_py3 import UserAssignedIdentity except (SyntaxError, ImportError): - from ._models import AgentPool - from ._models import AgentPoolAvailableVersions - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models import AgentPoolUpgradeProfile - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models import ContainerServiceDiagnosticsProfile - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAddonProfileIdentity - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterAgentPoolProfileProperties - from ._models import ManagedClusterAPIServerAccessProfile - from ._models import ManagedClusterIdentity - from ._models import ManagedClusterLoadBalancerProfile - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models import ManagedClusterPropertiesIdentityProfileValue - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterUpgradeProfile - from ._models import ManagedClusterWindowsProfile - from ._models import OperationValue - from ._models import Resource - from ._models import ResourceReference - from ._models import SubResource - from ._models import TagsObject - from ._models import UserAssignedIdentity -from ._paged_models import AgentPoolPaged -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( + AgentPoolType, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, - AgentPoolType, - ScaleSetPriority, - ScaleSetEvictionPolicy, + Count, + LoadBalancerSku, NetworkPlugin, NetworkPolicy, + OSType, OutboundType, - LoadBalancerSku, ResourceIdentityType, + ScaleSetEvictionPolicy, + ScaleSetPriority, ) __all__ = [ 'AgentPool', 'AgentPoolAvailableVersions', 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', 'AgentPoolUpgradeProfile', 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'CloudErrorBody', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', 'ContainerServiceMasterProfile', @@ -123,13 +129,14 @@ 'CredentialResults', 'ManagedCluster', 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterAccessProfile', 'ManagedClusterAddonProfile', 'ManagedClusterAddonProfileIdentity', 'ManagedClusterAgentPoolProfile', 'ManagedClusterAgentPoolProfileProperties', - 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterIdentity', + 'ManagedClusterListResult', 'ManagedClusterLoadBalancerProfile', 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', @@ -140,24 +147,23 @@ 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', 'ManagedClusterWindowsProfile', + 'OperationListResult', 'OperationValue', 'Resource', 'ResourceReference', 'SubResource', 'TagsObject', 'UserAssignedIdentity', - 'OperationValuePaged', - 'ManagedClusterPaged', - 'AgentPoolPaged', + 'AgentPoolType', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', - 'AgentPoolType', - 'ScaleSetPriority', - 'ScaleSetEvictionPolicy', + 'Count', + 'LoadBalancerSku', 'NetworkPlugin', 'NetworkPolicy', + 'OSType', 'OutboundType', - 'LoadBalancerSku', 'ResourceIdentityType', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', ] 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 1f16ba53a9be..8ab3311852d6 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 @@ -1,250 +1,290 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class AgentPoolType(str, Enum): - - virtual_machine_scale_sets = "VirtualMachineScaleSets" - availability_set = "AvailabilitySet" - - -class ScaleSetPriority(str, Enum): - - low = "Low" - regular = "Regular" - - -class ScaleSetEvictionPolicy(str, Enum): - - delete = "Delete" - deallocate = "Deallocate" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" - azure = "azure" - - -class OutboundType(str, Enum): - - load_balancer = "loadBalancer" - user_defined_routing = "userDefinedRouting" - - -class LoadBalancerSku(str, Enum): - - standard = "standard" - basic = "basic" - - -class ResourceIdentityType(str, Enum): - - system_assigned = "SystemAssigned" - none = "None" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class 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)): + """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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """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)): + """The outbound (egress) routing method. + """ + + LOAD_BALANCER = "loadBalancer" + USER_DEFINED_ROUTING = "userDefinedRouting" + +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 + principal will be used instead. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" + +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. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. + """ + + LOW = "Low" + REGULAR = "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 index a27508f5c7b7..2ca1642842a6 100644 --- 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 @@ -1,30 +1,25 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class SubResource(Model): +class SubResource(msrest.serialization.Model): """Reference to another subresource. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +35,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,129 +48,107 @@ def __init__(self, **kwargs): class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -180,8 +156,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -198,7 +173,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -210,9 +185,12 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) + 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) @@ -221,7 +199,7 @@ def __init__(self, **kwargs): 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.agent_pool_type = kwargs.get('agent_pool_type', 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) @@ -233,11 +211,10 @@ def __init__(self, **kwargs): self.node_taints = kwargs.get('node_taints', None) -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -263,7 +240,10 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -271,7 +251,7 @@ def __init__(self, **kwargs): self.agent_pool_versions = kwargs.get('agent_pool_versions', None) -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -288,18 +268,49 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 AgentPoolUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -309,16 +320,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -340,17 +347,20 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.kubernetes_version = kwargs['kubernetes_version'] self.os_type = kwargs.get('os_type', "Linux") self.upgrades = kwargs.get('upgrades', None) -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -364,56 +374,29 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 CloudError(Model): +class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_11_01.models.CloudErrorBody] """ _attribute_map = { @@ -423,7 +406,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -431,13 +417,12 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMDiagnostics """ @@ -450,23 +435,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -479,93 +464,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -575,6 +546,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -589,11 +561,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -601,42 +576,32 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 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 @@ -661,7 +626,10 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, **kwargs): + 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) @@ -674,13 +642,13 @@ def __init__(self, **kwargs): self.load_balancer_profile = kwargs.get('load_balancer_profile', None) -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -693,19 +661,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -717,24 +687,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -748,17 +718,19 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -776,21 +748,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_11_01.models.CredentialResult] """ _validation = { @@ -801,28 +774,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -841,41 +816,43 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -886,46 +863,38 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterIdentity + ~azure.mgmt.containerservice.v2019_11_01.models.UserAssignedIdentity] """ _validation = { @@ -945,6 +914,7 @@ class ManagedCluster(Resource): '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'}, @@ -962,12 +932,15 @@ class ManagedCluster(Resource): '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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, } - def __init__(self, **kwargs): + 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) @@ -986,10 +959,9 @@ def __init__(self, **kwargs): 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) - self.identity = kwargs.get('identity', None) -class ManagedClusterAADProfile(Model): +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. @@ -1000,8 +972,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -1017,10 +989,13 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) + 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) @@ -1028,20 +1003,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1063,16 +1037,18 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1081,8 +1057,7 @@ class ManagedClusterAddonProfile(Model): :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 + :vartype identity: ~azure.mgmt.containerservice.v2019_11_01.models.UserAssignedIdentity """ _validation = { @@ -1093,17 +1068,20 @@ class ManagedClusterAddonProfile(Model): _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) self.identity = None -class UserAssignedIdentity(Model): +class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. :param resource_id: The resource id of the user assigned identity. @@ -1120,7 +1098,10 @@ class UserAssignedIdentity(Model): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -1144,135 +1125,114 @@ class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. - :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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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 = { - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -1298,9 +1258,12 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) + 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) @@ -1324,131 +1287,109 @@ def __init__(self, **kwargs): 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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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. + :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}$'}, } @@ -1476,19 +1417,20 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1497,32 +1439,31 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1533,43 +1474,71 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = kwargs.get('type', None) -class ManagedClusterLoadBalancerProfile(Model): +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_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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. - Default value: 0 . + :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. Default value: 30 . + :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 """ @@ -1579,30 +1548,32 @@ class ManagedClusterLoadBalancerProfile(Model): } _attribute_map = { - 'managed_outbound_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + '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): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = kwargs.get('managed_outbound_ips', None) + self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_ips = kwargs.get('outbound_ips', None) - self.effective_outbound_ips = kwargs.get('effective_outbound_ips', 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(Model): +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. . Default value: 1 . + :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 """ @@ -1614,12 +1585,15 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = kwargs.get('count', 1) -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1631,45 +1605,46 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = kwargs.get('public_ips', None) + self.public_i_ps = kwargs.get('public_i_ps', None) -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1686,15 +1661,18 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1708,7 +1686,10 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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) @@ -1731,20 +1712,21 @@ class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1757,17 +1739,19 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1777,12 +1761,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1803,22 +1786,24 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.control_plane_profile = kwargs['control_plane_profile'] + self.agent_pool_profiles = kwargs['agent_pool_profiles'] -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1834,17 +1819,44 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) + self.admin_username = kwargs['admin_username'] self.admin_password = kwargs.get('admin_password', None) -class OperationValue(Model): +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. + 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 @@ -1878,7 +1890,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1888,7 +1903,7 @@ def __init__(self, **kwargs): self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -1899,15 +1914,18 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = kwargs.get('id', None) -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1915,6 +1933,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 37afc0040d71..892df56b0b52 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 @@ -1,30 +1,29 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class SubResource(Model): +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. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +39,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,129 +52,107 @@ def __init__(self, **kwargs) -> None: class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -180,8 +160,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -198,7 +177,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -210,7 +189,29 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, agent_pool_type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -221,7 +222,7 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub self.max_count = max_count self.min_count = min_count self.enable_auto_scaling = enable_auto_scaling - self.agent_pool_type = agent_pool_type + self.type_properties_type = type_properties_type self.orchestrator_version = orchestrator_version self.provisioning_state = None self.availability_zones = availability_zones @@ -233,11 +234,10 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub self.node_taints = node_taints -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -263,7 +263,12 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: + def __init__( + self, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -271,7 +276,7 @@ def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: self.agent_pool_versions = agent_pool_versions -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -288,18 +293,55 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, default: bool=None, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class AgentPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -309,16 +351,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -340,7 +378,14 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -350,7 +395,7 @@ def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, * self.upgrades = upgrades -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -364,56 +409,32 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2019_11_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2019_11_01.models.CloudErrorBody] """ _attribute_map = { @@ -423,7 +444,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -431,13 +460,12 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceVMDiagnostics """ @@ -450,23 +478,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2019_11_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -479,93 +509,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -575,6 +594,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -589,7 +609,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -601,42 +632,32 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 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 @@ -661,7 +682,20 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", outbound_type="loadBalancer", load_balancer_sku=None, load_balancer_profile=None, **kwargs) -> None: + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = 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, + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -674,13 +708,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: s self.load_balancer_profile = load_balancer_profile -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -693,19 +727,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -717,24 +755,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -748,17 +788,21 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -776,21 +820,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2019_11_01.models.CredentialResult] """ _validation = { @@ -801,28 +846,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -841,7 +888,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -853,29 +906,28 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ManagedCluster(Resource): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -886,46 +938,38 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterIdentity + ~azure.mgmt.containerservice.v2019_11_01.models.UserAssignedIdentity] """ _validation = { @@ -945,6 +989,7 @@ class ManagedCluster(Resource): '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'}, @@ -962,12 +1007,33 @@ class ManagedCluster(Resource): '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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - } - - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, node_resource_group: str=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_access_profile=None, identity_profile=None, identity=None, **kwargs) -> None: + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + api_server_access_profile: Optional["ManagedClusterAPIServerAccessProfile"] = None, + identity_profile: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity self.provisioning_state = None self.max_agent_pools = None self.kubernetes_version = kubernetes_version @@ -986,10 +1052,9 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.aad_profile = aad_profile self.api_server_access_profile = api_server_access_profile self.identity_profile = identity_profile - self.identity = identity -class ManagedClusterAADProfile(Model): +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. @@ -1000,8 +1065,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -1017,7 +1082,15 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_app_id: str, + server_app_id: str, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -1028,20 +1101,19 @@ def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1063,16 +1135,22 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1081,8 +1159,7 @@ class ManagedClusterAddonProfile(Model): :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 + :vartype identity: ~azure.mgmt.containerservice.v2019_11_01.models.UserAssignedIdentity """ _validation = { @@ -1093,17 +1170,23 @@ class ManagedClusterAddonProfile(Model): _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config self.identity = None -class UserAssignedIdentity(Model): +class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. :param resource_id: The resource id of the user assigned identity. @@ -1120,7 +1203,14 @@ class UserAssignedIdentity(Model): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1144,135 +1234,118 @@ class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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 = { - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -1298,7 +1371,29 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1324,131 +1419,109 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub 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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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. + :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}$'}, } @@ -1476,19 +1549,40 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, vm_size, name: str, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + **kwargs + ): 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 -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1497,32 +1591,34 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, *, authorized_ip_ranges=None, enable_private_cluster: bool=None, **kwargs) -> None: + def __init__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + **kwargs + ): super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster -class ManagedClusterIdentity(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1533,43 +1629,75 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type -class ManagedClusterLoadBalancerProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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. - Default value: 0 . + :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. Default value: 30 . + :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 """ @@ -1579,30 +1707,39 @@ class ManagedClusterLoadBalancerProfile(Model): } _attribute_map = { - 'managed_outbound_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + '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, *, managed_outbound_ips=None, outbound_ip_prefixes=None, outbound_ips=None, effective_outbound_ips=None, allocated_outbound_ports: int=0, idle_timeout_in_minutes: int=30, **kwargs) -> None: + 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, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = managed_outbound_ips + self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes - self.outbound_ips = outbound_ips - self.effective_outbound_ips = effective_outbound_ips + 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 -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): +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. . Default value: 1 . + :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 """ @@ -1614,12 +1751,17 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, *, count: int=1, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = 1, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1631,45 +1773,50 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ip_prefixes=None, **kwargs) -> None: + def __init__( + self, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2019_11_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ips=None, **kwargs) -> None: + def __init__( + self, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = public_ips + self.public_i_ps = public_i_ps -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1686,7 +1833,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1694,7 +1849,7 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1708,7 +1863,13 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -1731,20 +1892,25 @@ class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1757,17 +1923,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1777,12 +1948,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1803,7 +1973,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1812,13 +1988,12 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1834,17 +2009,47 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str=None, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class OperationValue(Model): +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. + 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 @@ -1878,7 +2083,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1888,7 +2096,7 @@ def __init__(self, **kwargs) -> None: self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -1899,15 +2107,20 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, *, id: str=None, **kwargs) -> None: + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = id -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1915,6 +2128,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_paged_models.py deleted file mode 100644 index e301a1d0ce18..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_paged_models.py +++ /dev/null @@ -1,53 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) -class AgentPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`AgentPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AgentPool]'} - } - - def __init__(self, *args, **kwargs): - - super(AgentPoolPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/__init__.py index d1b67f7888b7..5aac40228eec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 15556eb22e0e..7183f6610298 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 @@ -1,127 +1,141 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class AgentPoolsOperations(object): """AgentPoolsOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_11_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-11-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01" - - self.config = config + self._config = config def list( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 of each agent pool. + Gets a list of agent pools in the specified managed cluster. The operation returns properties + of each 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AgentPool - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolPaged[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore def get( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" """Gets the agent pool. - Gets the details of the agent pool by managed cluster and resource - group. + Gets the details of the agent pool by managed cluster and resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -129,115 +143,122 @@ def get( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_11_01.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', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + 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" + 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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AgentPool') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('AgentPool', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + 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"] """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -248,92 +269,114 @@ def create_or_update( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param parameters: Parameters supplied to the Create or Update an - agent pool operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_11_01.models.AgentPool - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns AgentPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_11_01.models.AgentPool]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - 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, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('AgentPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -344,46 +387,65 @@ def delete( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} + 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 def get_upgrade_profile( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 managed cluster name. + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -391,63 +453,60 @@ def get_upgrade_profile( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_11_01.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', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolUpgradeProfile', response) + deserialized = self._deserialize('AgentPoolUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore def get_available_agent_pool_versions( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -456,56 +515,48 @@ def get_available_agent_pool_versions( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolAvailableVersions or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolAvailableVersions - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_11_01.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', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.get_available_agent_pool_versions.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolAvailableVersions', response) + deserialized = self._deserialize('AgentPoolAvailableVersions', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + 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 a48dc133d26d..e518719c08cc 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 @@ -1,742 +1,758 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_11_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-11-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_11_01.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', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_11_01.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', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_11_01.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', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_11_01.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', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def list_cluster_monitoring_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets cluster monitoring user credential of the managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2019_11_01.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', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true + :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.v2019_11_01.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -745,88 +761,110 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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, {}) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -835,85 +873,111 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -922,90 +986,115 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1014,84 +1103,108 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2019-11-01" + accept = "application/json" + # Construct URL - url = self.rotate_cluster_certificates.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def rotate_cluster_certificates( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1100,35 +1213,48 @@ def rotate_cluster_certificates( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._rotate_cluster_certificates_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} + 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 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 b6645ea2f794..a77f7810c5d8 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2019_11_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-11-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-11-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2019_11_01.models.OperationValuePaged[~azure.mgmt.containerservice.v2019_11_01.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2019_11_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/version.py deleted file mode 100644 index 93d376dfdcc7..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2019-11-01" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..1ffb97662504 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2020-01-01" + 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 = policies.BearerTokenCredentialPolicy(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 ce5db51f7e3d..62247c63aa63 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -19,43 +24,56 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_01_01.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2020_01_01.operations.ManagedClustersOperations - :ivar agent_pools: AgentPools operations + :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_01_01.operations.AgentPoolsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2020-01-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2020_01_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_metadata.json new file mode 100644 index 000000000000..0f7a6919be56 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2020-01-01", + "total_api_version_list": ["2020-01-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..f064b59a8a2f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2020-01-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..c88f7fa6dd1d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_container_service_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2020_01_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..331ef4dd54b2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_01_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_01_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2020_01_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_01_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..792299691529 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_01_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2020_01_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2020_01_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_01_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_01_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_01_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_01_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..f7d35ed411de --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_01_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2020_01_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/__init__.py index 671f9f9401d1..31731299ad0c 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 @@ -1,20 +1,19 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -26,13 +25,14 @@ 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 ManagedClusterAPIServerAccessProfile 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 @@ -43,6 +43,7 @@ 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 @@ -50,68 +51,73 @@ from ._models_py3 import TagsObject from ._models_py3 import UserAssignedIdentity except (SyntaxError, ImportError): - from ._models import AgentPool - from ._models import AgentPoolAvailableVersions - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models import AgentPoolUpgradeProfile - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models import ContainerServiceDiagnosticsProfile - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAddonProfileIdentity - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterAgentPoolProfileProperties - from ._models import ManagedClusterAPIServerAccessProfile - from ._models import ManagedClusterIdentity - from ._models import ManagedClusterLoadBalancerProfile - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models import ManagedClusterPropertiesIdentityProfileValue - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterUpgradeProfile - from ._models import ManagedClusterWindowsProfile - from ._models import OperationValue - from ._models import Resource - from ._models import ResourceReference - from ._models import SubResource - from ._models import TagsObject - from ._models import UserAssignedIdentity -from ._paged_models import AgentPoolPaged -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( + AgentPoolType, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, - AgentPoolType, - ScaleSetPriority, - ScaleSetEvictionPolicy, + Count, + LoadBalancerSku, NetworkPlugin, NetworkPolicy, + OSType, OutboundType, - LoadBalancerSku, ResourceIdentityType, + ScaleSetEvictionPolicy, + ScaleSetPriority, ) __all__ = [ 'AgentPool', 'AgentPoolAvailableVersions', 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', 'AgentPoolUpgradeProfile', 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'CloudErrorBody', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', 'ContainerServiceMasterProfile', @@ -123,13 +129,14 @@ 'CredentialResults', 'ManagedCluster', 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterAccessProfile', 'ManagedClusterAddonProfile', 'ManagedClusterAddonProfileIdentity', 'ManagedClusterAgentPoolProfile', 'ManagedClusterAgentPoolProfileProperties', - 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterIdentity', + 'ManagedClusterListResult', 'ManagedClusterLoadBalancerProfile', 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', @@ -140,24 +147,23 @@ 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', 'ManagedClusterWindowsProfile', + 'OperationListResult', 'OperationValue', 'Resource', 'ResourceReference', 'SubResource', 'TagsObject', 'UserAssignedIdentity', - 'OperationValuePaged', - 'ManagedClusterPaged', - 'AgentPoolPaged', + 'AgentPoolType', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', - 'AgentPoolType', - 'ScaleSetPriority', - 'ScaleSetEvictionPolicy', + 'Count', + 'LoadBalancerSku', 'NetworkPlugin', 'NetworkPolicy', + 'OSType', 'OutboundType', - 'LoadBalancerSku', 'ResourceIdentityType', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', ] 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 1f16ba53a9be..8ab3311852d6 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 @@ -1,250 +1,290 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class AgentPoolType(str, Enum): - - virtual_machine_scale_sets = "VirtualMachineScaleSets" - availability_set = "AvailabilitySet" - - -class ScaleSetPriority(str, Enum): - - low = "Low" - regular = "Regular" - - -class ScaleSetEvictionPolicy(str, Enum): - - delete = "Delete" - deallocate = "Deallocate" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" - azure = "azure" - - -class OutboundType(str, Enum): - - load_balancer = "loadBalancer" - user_defined_routing = "userDefinedRouting" - - -class LoadBalancerSku(str, Enum): - - standard = "standard" - basic = "basic" - - -class ResourceIdentityType(str, Enum): - - system_assigned = "SystemAssigned" - none = "None" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class 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)): + """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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """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)): + """The outbound (egress) routing method. + """ + + LOAD_BALANCER = "loadBalancer" + USER_DEFINED_ROUTING = "userDefinedRouting" + +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 + principal will be used instead. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" + +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. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. + """ + + LOW = "Low" + REGULAR = "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 index f611ec528ca5..8fe20b4d3cd2 100644 --- 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 @@ -1,30 +1,25 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class SubResource(Model): +class SubResource(msrest.serialization.Model): """Reference to another subresource. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +35,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,129 +48,107 @@ def __init__(self, **kwargs): class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -180,8 +156,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -198,7 +173,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -210,9 +185,12 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) + 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) @@ -221,7 +199,7 @@ def __init__(self, **kwargs): 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.agent_pool_type = kwargs.get('agent_pool_type', 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) @@ -233,11 +211,10 @@ def __init__(self, **kwargs): self.node_taints = kwargs.get('node_taints', None) -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -263,7 +240,10 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -271,7 +251,7 @@ def __init__(self, **kwargs): self.agent_pool_versions = kwargs.get('agent_pool_versions', None) -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -288,18 +268,49 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 AgentPoolUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -309,16 +320,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -340,17 +347,20 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.kubernetes_version = kwargs['kubernetes_version'] self.os_type = kwargs.get('os_type', "Linux") self.upgrades = kwargs.get('upgrades', None) -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -364,56 +374,29 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 CloudError(Model): +class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2020_01_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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2020_01_01.models.CloudErrorBody] """ _attribute_map = { @@ -423,7 +406,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -431,13 +417,12 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMDiagnostics """ @@ -450,23 +435,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -479,93 +464,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -575,6 +546,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -589,11 +561,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -601,42 +576,32 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 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 @@ -661,7 +626,10 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, **kwargs): + 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) @@ -674,13 +642,13 @@ def __init__(self, **kwargs): self.load_balancer_profile = kwargs.get('load_balancer_profile', None) -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -693,19 +661,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -717,24 +687,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -748,17 +718,19 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -776,21 +748,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_01_01.models.CredentialResult] """ _validation = { @@ -801,28 +774,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -841,41 +816,43 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -886,49 +863,41 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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. + :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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterIdentity + ~azure.mgmt.containerservice.v2020_01_01.models.UserAssignedIdentity] """ _validation = { @@ -948,6 +917,7 @@ class ManagedCluster(Resource): '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'}, @@ -966,12 +936,15 @@ class ManagedCluster(Resource): '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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, } - def __init__(self, **kwargs): + 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) @@ -991,10 +964,9 @@ def __init__(self, **kwargs): 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.identity = kwargs.get('identity', None) -class ManagedClusterAADProfile(Model): +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. @@ -1005,8 +977,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -1022,10 +994,13 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) + 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) @@ -1033,20 +1008,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1068,16 +1042,18 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1086,8 +1062,7 @@ class ManagedClusterAddonProfile(Model): :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 + :vartype identity: ~azure.mgmt.containerservice.v2020_01_01.models.UserAssignedIdentity """ _validation = { @@ -1098,17 +1073,20 @@ class ManagedClusterAddonProfile(Model): _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) self.identity = None -class UserAssignedIdentity(Model): +class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. :param resource_id: The resource id of the user assigned identity. @@ -1125,7 +1103,10 @@ class UserAssignedIdentity(Model): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -1149,135 +1130,114 @@ class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. - :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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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 = { - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -1303,9 +1263,12 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) + 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) @@ -1329,131 +1292,109 @@ def __init__(self, **kwargs): 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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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. + :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}$'}, } @@ -1481,19 +1422,20 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1502,32 +1444,31 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1538,43 +1479,71 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = kwargs.get('type', None) -class ManagedClusterLoadBalancerProfile(Model): +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_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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. - Default value: 0 . + :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. Default value: 30 . + :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 """ @@ -1584,30 +1553,32 @@ class ManagedClusterLoadBalancerProfile(Model): } _attribute_map = { - 'managed_outbound_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + '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): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = kwargs.get('managed_outbound_ips', None) + self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_ips = kwargs.get('outbound_ips', None) - self.effective_outbound_ips = kwargs.get('effective_outbound_ips', 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(Model): +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. . Default value: 1 . + :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 """ @@ -1619,12 +1590,15 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = kwargs.get('count', 1) -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1636,45 +1610,46 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = kwargs.get('public_ips', None) + self.public_i_ps = kwargs.get('public_i_ps', None) -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1691,15 +1666,18 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1713,7 +1691,10 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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) @@ -1736,20 +1717,21 @@ class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1762,17 +1744,19 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1782,12 +1766,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1808,22 +1791,24 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.control_plane_profile = kwargs['control_plane_profile'] + self.agent_pool_profiles = kwargs['agent_pool_profiles'] -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1839,17 +1824,44 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) + self.admin_username = kwargs['admin_username'] self.admin_password = kwargs.get('admin_password', None) -class OperationValue(Model): +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. + 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 @@ -1883,7 +1895,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1893,7 +1908,7 @@ def __init__(self, **kwargs): self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -1904,15 +1919,18 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = kwargs.get('id', None) -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1920,6 +1938,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 a22da338d847..5c1b66c38587 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 @@ -1,30 +1,29 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class SubResource(Model): +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. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +39,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,129 +52,107 @@ def __init__(self, **kwargs) -> None: class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -180,8 +160,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -198,7 +177,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -210,7 +189,29 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, agent_pool_type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -221,7 +222,7 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub self.max_count = max_count self.min_count = min_count self.enable_auto_scaling = enable_auto_scaling - self.agent_pool_type = agent_pool_type + self.type_properties_type = type_properties_type self.orchestrator_version = orchestrator_version self.provisioning_state = None self.availability_zones = availability_zones @@ -233,11 +234,10 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub self.node_taints = node_taints -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -263,7 +263,12 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: + def __init__( + self, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -271,7 +276,7 @@ def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: self.agent_pool_versions = agent_pool_versions -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -288,18 +293,55 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, default: bool=None, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class AgentPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -309,16 +351,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -340,7 +378,14 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -350,7 +395,7 @@ def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, * self.upgrades = upgrades -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -364,56 +409,32 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2020_01_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2020_01_01.models.CloudErrorBody] """ _attribute_map = { @@ -423,7 +444,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -431,13 +460,12 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceVMDiagnostics """ @@ -450,23 +478,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2020_01_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -479,93 +509,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -575,6 +594,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -589,7 +609,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -601,42 +632,32 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 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 @@ -661,7 +682,20 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", outbound_type="loadBalancer", load_balancer_sku=None, load_balancer_profile=None, **kwargs) -> None: + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = 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, + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -674,13 +708,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: s self.load_balancer_profile = load_balancer_profile -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -693,19 +727,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -717,24 +755,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -748,17 +788,21 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -776,21 +820,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_01_01.models.CredentialResult] """ _validation = { @@ -801,28 +846,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -841,7 +888,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -853,29 +906,28 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ManagedCluster(Resource): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -886,49 +938,41 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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. + :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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterIdentity + ~azure.mgmt.containerservice.v2020_01_01.models.UserAssignedIdentity] """ _validation = { @@ -948,6 +992,7 @@ class ManagedCluster(Resource): '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'}, @@ -966,12 +1011,34 @@ class ManagedCluster(Resource): '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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - } - - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, node_resource_group: str=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_access_profile=None, disk_encryption_set_id: str=None, identity_profile=None, identity=None, **kwargs) -> None: + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + api_server_access_profile: Optional["ManagedClusterAPIServerAccessProfile"] = None, + disk_encryption_set_id: Optional[str] = None, + identity_profile: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity self.provisioning_state = None self.max_agent_pools = None self.kubernetes_version = kubernetes_version @@ -991,10 +1058,9 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.api_server_access_profile = api_server_access_profile self.disk_encryption_set_id = disk_encryption_set_id self.identity_profile = identity_profile - self.identity = identity -class ManagedClusterAADProfile(Model): +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. @@ -1005,8 +1071,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -1022,7 +1088,15 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_app_id: str, + server_app_id: str, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -1033,20 +1107,19 @@ def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1068,16 +1141,22 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1086,8 +1165,7 @@ class ManagedClusterAddonProfile(Model): :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 + :vartype identity: ~azure.mgmt.containerservice.v2020_01_01.models.UserAssignedIdentity """ _validation = { @@ -1098,17 +1176,23 @@ class ManagedClusterAddonProfile(Model): _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config self.identity = None -class UserAssignedIdentity(Model): +class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. :param resource_id: The resource id of the user assigned identity. @@ -1125,7 +1209,14 @@ class UserAssignedIdentity(Model): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1149,135 +1240,118 @@ class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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 = { - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -1303,7 +1377,29 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1329,131 +1425,109 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub 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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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. + :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}$'}, } @@ -1481,19 +1555,40 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, vm_size, name: str, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + **kwargs + ): 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 -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1502,32 +1597,34 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, *, authorized_ip_ranges=None, enable_private_cluster: bool=None, **kwargs) -> None: + def __init__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + **kwargs + ): super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster -class ManagedClusterIdentity(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1538,43 +1635,75 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type -class ManagedClusterLoadBalancerProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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. - Default value: 0 . + :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. Default value: 30 . + :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 """ @@ -1584,30 +1713,39 @@ class ManagedClusterLoadBalancerProfile(Model): } _attribute_map = { - 'managed_outbound_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + '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, *, managed_outbound_ips=None, outbound_ip_prefixes=None, outbound_ips=None, effective_outbound_ips=None, allocated_outbound_ports: int=0, idle_timeout_in_minutes: int=30, **kwargs) -> None: + 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, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = managed_outbound_ips + self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes - self.outbound_ips = outbound_ips - self.effective_outbound_ips = effective_outbound_ips + 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 -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): +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. . Default value: 1 . + :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 """ @@ -1619,12 +1757,17 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, *, count: int=1, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = 1, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1636,45 +1779,50 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ip_prefixes=None, **kwargs) -> None: + def __init__( + self, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2020_01_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ips=None, **kwargs) -> None: + def __init__( + self, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = public_ips + self.public_i_ps = public_i_ps -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1691,7 +1839,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1699,7 +1855,7 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1713,7 +1869,13 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview @@ -1736,20 +1898,25 @@ class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1762,17 +1929,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1782,12 +1954,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1808,7 +1979,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1817,13 +1994,12 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1839,17 +2015,47 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str=None, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class OperationValue(Model): +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. + 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 @@ -1883,7 +2089,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1893,7 +2102,7 @@ def __init__(self, **kwargs) -> None: self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -1904,15 +2113,20 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, *, id: str=None, **kwargs) -> None: + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = id -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1920,6 +2134,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_paged_models.py deleted file mode 100644 index b665e1d73743..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_paged_models.py +++ /dev/null @@ -1,53 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) -class AgentPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`AgentPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AgentPool]'} - } - - def __init__(self, *args, **kwargs): - - super(AgentPoolPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/__init__.py index d1b67f7888b7..5aac40228eec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 fd546934dd57..64d7b0e5c444 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 @@ -1,127 +1,141 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class AgentPoolsOperations(object): """AgentPoolsOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2020_01_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-01-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" - - self.config = config + self._config = config def list( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 of each agent pool. + Gets a list of agent pools in the specified managed cluster. The operation returns properties + of each 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AgentPool - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolPaged[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore def get( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" """Gets the agent pool. - Gets the details of the agent pool by managed cluster and resource - group. + Gets the details of the agent pool by managed cluster and resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -129,115 +143,122 @@ def get( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_01_01.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', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + 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" + 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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AgentPool') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('AgentPool', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + 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"] """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -248,92 +269,114 @@ def create_or_update( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param parameters: Parameters supplied to the Create or Update an - agent pool operation. - :type parameters: - ~azure.mgmt.containerservice.v2020_01_01.models.AgentPool - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns AgentPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_01_01.models.AgentPool]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - 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, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('AgentPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -344,46 +387,65 @@ def delete( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} + 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 def get_upgrade_profile( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 managed cluster name. + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -391,63 +453,60 @@ def get_upgrade_profile( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_01_01.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', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolUpgradeProfile', response) + deserialized = self._deserialize('AgentPoolUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore def get_available_agent_pool_versions( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -456,56 +515,48 @@ def get_available_agent_pool_versions( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolAvailableVersions or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolAvailableVersions - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_01_01.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', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.get_available_agent_pool_versions.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolAvailableVersions', response) + deserialized = self._deserialize('AgentPoolAvailableVersions', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + 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 a2214fb5ecdd..cf568c344f15 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 @@ -1,742 +1,758 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2020_01_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-01-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_01_01.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', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_01_01.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', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_01_01.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', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_01_01.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', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def list_cluster_monitoring_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets cluster monitoring user credential of the managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_01_01.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', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true + :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.v2020_01_01.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -745,88 +761,110 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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, {}) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -835,85 +873,111 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -922,90 +986,115 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1014,84 +1103,108 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01" + accept = "application/json" + # Construct URL - url = self.rotate_cluster_certificates.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def rotate_cluster_certificates( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1100,35 +1213,48 @@ def rotate_cluster_certificates( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._rotate_cluster_certificates_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} + 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 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 6b5107c85eeb..6d974309877a 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2020_01_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-01-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-01-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2020_01_01.models.OperationValuePaged[~azure.mgmt.containerservice.v2020_01_01.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2020_01_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/version.py deleted file mode 100644 index b25da413d3a6..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2020-01-01" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..45f7db14a8c9 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2020-02-01" + 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 = policies.BearerTokenCredentialPolicy(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 7f744a9e6c59..300f7b9cf67a 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -19,43 +24,56 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_02_01.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2020_02_01.operations.ManagedClustersOperations - :ivar agent_pools: AgentPools operations + :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_02_01.operations.AgentPoolsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2020-02-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2020_02_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_metadata.json new file mode 100644 index 000000000000..a1ec1b3d43b4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2020-02-01", + "total_api_version_list": ["2020-02-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..bd4ae14a015e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2020-02-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..b81b319af3be --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_container_service_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2020_02_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..56e790037158 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_02_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2020_02_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_02_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..8f7e558984e4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2020_02_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2020_02_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_02_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_02_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_02_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_02_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..a9d9c0e73cd5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2020_02_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/__init__.py index 671e627031d6..e3d019e1413e 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 @@ -1,20 +1,19 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -26,13 +25,14 @@ 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 ManagedClusterAPIServerAccessProfile 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 @@ -44,6 +44,7 @@ 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 @@ -51,70 +52,75 @@ from ._models_py3 import TagsObject from ._models_py3 import UserAssignedIdentity except (SyntaxError, ImportError): - from ._models import AgentPool - from ._models import AgentPoolAvailableVersions - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models import AgentPoolUpgradeProfile - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models import ContainerServiceDiagnosticsProfile - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAddonProfileIdentity - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterAgentPoolProfileProperties - from ._models import ManagedClusterAPIServerAccessProfile - from ._models import ManagedClusterIdentity - from ._models import ManagedClusterLoadBalancerProfile - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models import ManagedClusterPropertiesAutoScalerProfile - from ._models import ManagedClusterPropertiesIdentityProfileValue - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterUpgradeProfile - from ._models import ManagedClusterWindowsProfile - from ._models import OperationValue - from ._models import Resource - from ._models import ResourceReference - from ._models import SubResource - from ._models import TagsObject - from ._models import UserAssignedIdentity -from ._paged_models import AgentPoolPaged -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( + AgentPoolType, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, - AgentPoolType, - ScaleSetPriority, - ScaleSetEvictionPolicy, + Count, + LoadBalancerSku, + NetworkMode, NetworkPlugin, NetworkPolicy, - NetworkMode, + OSType, OutboundType, - LoadBalancerSku, ResourceIdentityType, + ScaleSetEvictionPolicy, + ScaleSetPriority, ) __all__ = [ 'AgentPool', 'AgentPoolAvailableVersions', 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', 'AgentPoolUpgradeProfile', 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'CloudErrorBody', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', 'ContainerServiceMasterProfile', @@ -126,13 +132,14 @@ 'CredentialResults', 'ManagedCluster', 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterAccessProfile', 'ManagedClusterAddonProfile', 'ManagedClusterAddonProfileIdentity', 'ManagedClusterAgentPoolProfile', 'ManagedClusterAgentPoolProfileProperties', - 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterIdentity', + 'ManagedClusterListResult', 'ManagedClusterLoadBalancerProfile', 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', @@ -144,25 +151,24 @@ 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', 'ManagedClusterWindowsProfile', + 'OperationListResult', 'OperationValue', 'Resource', 'ResourceReference', 'SubResource', 'TagsObject', 'UserAssignedIdentity', - 'OperationValuePaged', - 'ManagedClusterPaged', - 'AgentPoolPaged', + 'AgentPoolType', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', - 'AgentPoolType', - 'ScaleSetPriority', - 'ScaleSetEvictionPolicy', + 'Count', + 'LoadBalancerSku', + 'NetworkMode', 'NetworkPlugin', 'NetworkPolicy', - 'NetworkMode', + 'OSType', 'OutboundType', - 'LoadBalancerSku', 'ResourceIdentityType', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', ] 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 50453fcda77a..83c354340884 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 @@ -1,257 +1,298 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class AgentPoolType(str, Enum): - - virtual_machine_scale_sets = "VirtualMachineScaleSets" - availability_set = "AvailabilitySet" - - -class ScaleSetPriority(str, Enum): - - spot = "Spot" - low = "Low" - regular = "Regular" - - -class ScaleSetEvictionPolicy(str, Enum): - - delete = "Delete" - deallocate = "Deallocate" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" - azure = "azure" - - -class NetworkMode(str, Enum): - - transparent = "transparent" - bridge = "bridge" - - -class OutboundType(str, Enum): - - load_balancer = "loadBalancer" - user_defined_routing = "userDefinedRouting" - - -class LoadBalancerSku(str, Enum): - - standard = "standard" - basic = "basic" - - -class ResourceIdentityType(str, Enum): - - system_assigned = "SystemAssigned" - none = "None" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class 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)): + """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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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)): + """Network mode used for building Kubernetes network. + """ + + TRANSPARENT = "transparent" + BRIDGE = "bridge" + +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)): + """Network policy used for building Kubernetes network. + """ + + CALICO = "calico" + AZURE = "azure" + +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)): + """The outbound (egress) routing method. + """ + + LOAD_BALANCER = "loadBalancer" + USER_DEFINED_ROUTING = "userDefinedRouting" + +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 + principal will be used instead. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" + +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. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. + """ + + SPOT = "Spot" + LOW = "Low" + REGULAR = "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 index a16c4db34f46..2f140c802451 100644 --- 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 @@ -1,30 +1,25 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class SubResource(Model): +class SubResource(msrest.serialization.Model): """Reference to another subresource. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +35,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,134 +48,111 @@ def __init__(self, **kwargs): class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -185,8 +160,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -203,7 +177,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -216,9 +190,12 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) + 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) @@ -227,24 +204,23 @@ def __init__(self, **kwargs): 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.agent_pool_type = kwargs.get('agent_pool_type', 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', None) + 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(Model): +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. + 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 @@ -270,7 +246,10 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -278,7 +257,7 @@ def __init__(self, **kwargs): self.agent_pool_versions = kwargs.get('agent_pool_versions', None) -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -295,18 +274,49 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 AgentPoolUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -316,16 +326,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -347,17 +353,20 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.kubernetes_version = kwargs['kubernetes_version'] self.os_type = kwargs.get('os_type', "Linux") self.upgrades = kwargs.get('upgrades', None) -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -371,56 +380,29 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 CloudError(Model): +class CloudErrorBody(msrest.serialization.Model): """An error response from the Container service. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2020_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 CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2020_02_01.models.CloudErrorBody] """ _attribute_map = { @@ -430,7 +412,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -438,13 +423,12 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMDiagnostics """ @@ -457,23 +441,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -486,93 +470,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -582,6 +552,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -596,11 +567,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -608,46 +582,35 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 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 @@ -673,7 +636,10 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, **kwargs): + 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) @@ -687,13 +653,13 @@ def __init__(self, **kwargs): self.load_balancer_profile = kwargs.get('load_balancer_profile', None) -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -706,19 +672,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -730,24 +698,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -761,17 +729,19 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -789,21 +759,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_02_01.models.CredentialResult] """ _validation = { @@ -814,28 +785,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -854,41 +827,43 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', 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. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -899,53 +874,44 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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. + :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. + :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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterIdentity + ~azure.mgmt.containerservice.v2020_02_01.models.UserAssignedIdentity] """ _validation = { @@ -965,6 +931,7 @@ class ManagedCluster(Resource): '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'}, @@ -984,12 +951,15 @@ class ManagedCluster(Resource): '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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, } - def __init__(self, **kwargs): + 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) @@ -1010,10 +980,9 @@ def __init__(self, **kwargs): 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.identity = kwargs.get('identity', None) -class ManagedClusterAADProfile(Model): +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. @@ -1024,8 +993,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -1041,10 +1010,13 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) - self.client_app_id = kwargs.get('client_app_id', None) - self.server_app_id = kwargs.get('server_app_id', None) + 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) @@ -1052,20 +1024,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1087,16 +1058,18 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1105,8 +1078,7 @@ class ManagedClusterAddonProfile(Model): :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 + :vartype identity: ~azure.mgmt.containerservice.v2020_02_01.models.UserAssignedIdentity """ _validation = { @@ -1117,17 +1089,20 @@ class ManagedClusterAddonProfile(Model): _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) self.identity = None -class UserAssignedIdentity(Model): +class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. :param resource_id: The resource id of the user assigned identity. @@ -1144,7 +1119,10 @@ class UserAssignedIdentity(Model): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -1168,140 +1146,118 @@ class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. - :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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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 = { - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -1328,9 +1284,12 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) + 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) @@ -1346,7 +1305,7 @@ def __init__(self, **kwargs): 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', None) + 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) @@ -1355,136 +1314,113 @@ def __init__(self, **kwargs): 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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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. + :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}$'}, } @@ -1513,19 +1449,20 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1534,32 +1471,31 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1570,43 +1506,71 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = kwargs.get('type', None) -class ManagedClusterLoadBalancerProfile(Model): +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_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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. - Default value: 0 . + :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. Default value: 30 . + :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 """ @@ -1616,30 +1580,32 @@ class ManagedClusterLoadBalancerProfile(Model): } _attribute_map = { - 'managed_outbound_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + '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): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = kwargs.get('managed_outbound_ips', None) + self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_ips = kwargs.get('outbound_ips', None) - self.effective_outbound_ips = kwargs.get('effective_outbound_ips', 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(Model): +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. . Default value: 1 . + :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 """ @@ -1651,12 +1617,15 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = kwargs.get('count', 1) -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1668,45 +1637,46 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = kwargs.get('public_ips', None) + self.public_i_ps = kwargs.get('public_i_ps', None) -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1723,15 +1693,18 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1745,13 +1718,16 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): +class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. :param scan_interval: @@ -1783,7 +1759,10 @@ class ManagedClusterPropertiesAutoScalerProfile(Model): 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -1812,20 +1791,21 @@ class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1838,17 +1818,19 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1858,12 +1840,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1884,22 +1865,24 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.control_plane_profile = kwargs['control_plane_profile'] + self.agent_pool_profiles = kwargs['agent_pool_profiles'] -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1915,17 +1898,44 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) + self.admin_username = kwargs['admin_username'] self.admin_password = kwargs.get('admin_password', None) -class OperationValue(Model): +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. + 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 @@ -1959,7 +1969,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1969,7 +1982,7 @@ def __init__(self, **kwargs): self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -1980,15 +1993,18 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = kwargs.get('id', None) -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1996,6 +2012,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 62c7e7acc10f..d5140f323198 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 @@ -1,30 +1,29 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class SubResource(Model): +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. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +39,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,134 +52,111 @@ def __init__(self, **kwargs) -> None: class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -185,8 +164,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -203,7 +181,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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]'}, @@ -216,7 +194,30 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, agent_pool_type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", spot_max_price: float=None, tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -227,7 +228,7 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub self.max_count = max_count self.min_count = min_count self.enable_auto_scaling = enable_auto_scaling - self.agent_pool_type = agent_pool_type + self.type_properties_type = type_properties_type self.orchestrator_version = orchestrator_version self.provisioning_state = None self.availability_zones = availability_zones @@ -240,11 +241,10 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub self.node_taints = node_taints -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -270,7 +270,12 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: + def __init__( + self, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -278,7 +283,7 @@ def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: self.agent_pool_versions = agent_pool_versions -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -295,18 +300,55 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, default: bool=None, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class AgentPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -316,16 +358,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -347,7 +385,14 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -357,7 +402,7 @@ def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, * self.upgrades = upgrades -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -371,56 +416,32 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2020_02_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) - - -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2020_02_01.models.CloudErrorBody] """ _attribute_map = { @@ -430,7 +451,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -438,13 +467,12 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceVMDiagnostics """ @@ -457,23 +485,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2020_02_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -486,93 +516,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -582,6 +601,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -596,7 +616,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -608,46 +639,35 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 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 @@ -673,7 +693,21 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, network_mode=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", outbound_type="loadBalancer", load_balancer_sku=None, load_balancer_profile=None, **kwargs) -> None: + 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, + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -687,13 +721,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, network_mod self.load_balancer_profile = load_balancer_profile -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -706,19 +740,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -730,24 +768,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -761,17 +801,21 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -789,21 +833,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_02_01.models.CredentialResult] """ _validation = { @@ -814,28 +859,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -854,7 +901,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -866,29 +919,28 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: class ManagedCluster(Resource): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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. + :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. + :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. + :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 @@ -899,53 +951,44 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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. + :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. + :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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterIdentity + ~azure.mgmt.containerservice.v2020_02_01.models.UserAssignedIdentity] """ _validation = { @@ -965,6 +1008,7 @@ class ManagedCluster(Resource): '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'}, @@ -984,12 +1028,35 @@ class ManagedCluster(Resource): '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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, - } - - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, node_resource_group: str=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, auto_scaler_profile=None, api_server_access_profile=None, disk_encryption_set_id: str=None, identity_profile=None, identity=None, **kwargs) -> None: + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + **kwargs + ): super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity self.provisioning_state = None self.max_agent_pools = None self.kubernetes_version = kubernetes_version @@ -1010,10 +1077,9 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.api_server_access_profile = api_server_access_profile self.disk_encryption_set_id = disk_encryption_set_id self.identity_profile = identity_profile - self.identity = identity -class ManagedClusterAADProfile(Model): +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. @@ -1024,8 +1090,8 @@ class ManagedClusterAADProfile(Model): :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. + :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 """ @@ -1041,7 +1107,15 @@ class ManagedClusterAADProfile(Model): 'tenant_id': {'key': 'tenantID', 'type': 'str'}, } - def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_app_id: str, + server_app_id: str, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.client_app_id = client_app_id self.server_app_id = server_app_id @@ -1052,20 +1126,19 @@ def __init__(self, *, client_app_id: str, server_app_id: str, server_app_secret: class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1087,16 +1160,22 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1105,8 +1184,7 @@ class ManagedClusterAddonProfile(Model): :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 + :vartype identity: ~azure.mgmt.containerservice.v2020_02_01.models.UserAssignedIdentity """ _validation = { @@ -1117,17 +1195,23 @@ class ManagedClusterAddonProfile(Model): _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config self.identity = None -class UserAssignedIdentity(Model): +class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. :param resource_id: The resource id of the user assigned identity. @@ -1144,7 +1228,14 @@ class UserAssignedIdentity(Model): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1168,140 +1259,122 @@ class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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 = { - 'count': {'required': True, 'maximum': 100, 'minimum': 1}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -1328,7 +1401,30 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", spot_max_price: float=None, tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1355,136 +1451,113 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub 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. + Variables are only 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. . Default value: 1 . + :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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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. + :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}$'}, } @@ -1513,19 +1586,41 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, vm_size, name: str, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", spot_max_price: float=None, tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): 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 -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1534,32 +1629,34 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, *, authorized_ip_ranges=None, enable_private_cluster: bool=None, **kwargs) -> None: + def __init__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + **kwargs + ): super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster -class ManagedClusterIdentity(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1570,43 +1667,75 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type -class ManagedClusterLoadBalancerProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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. - Default value: 0 . + :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. Default value: 30 . + :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 """ @@ -1616,30 +1745,39 @@ class ManagedClusterLoadBalancerProfile(Model): } _attribute_map = { - 'managed_outbound_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + '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, *, managed_outbound_ips=None, outbound_ip_prefixes=None, outbound_ips=None, effective_outbound_ips=None, allocated_outbound_ports: int=0, idle_timeout_in_minutes: int=30, **kwargs) -> None: + 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, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = managed_outbound_ips + self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes - self.outbound_ips = outbound_ips - self.effective_outbound_ips = effective_outbound_ips + 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 -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): +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. . Default value: 1 . + :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 """ @@ -1651,12 +1789,17 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, *, count: int=1, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = 1, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1668,45 +1811,50 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ip_prefixes=None, **kwargs) -> None: + def __init__( + self, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2020_02_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ips=None, **kwargs) -> None: + def __init__( + self, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = public_ips + self.public_i_ps = public_i_ps -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1723,7 +1871,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1731,7 +1887,7 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1745,13 +1901,19 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class ManagedClusterPropertiesAutoScalerProfile(Model): +class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. :param scan_interval: @@ -1783,7 +1945,19 @@ class ManagedClusterPropertiesAutoScalerProfile(Model): 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, } - def __init__(self, *, scan_interval: str=None, scale_down_delay_after_add: str=None, scale_down_delay_after_delete: str=None, scale_down_delay_after_failure: str=None, scale_down_unneeded_time: str=None, scale_down_unready_time: str=None, scale_down_utilization_threshold: str=None, max_graceful_termination_sec: str=None, **kwargs) -> None: + def __init__( + self, + *, + 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, + max_graceful_termination_sec: Optional[str] = None, + **kwargs + ): super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.scan_interval = scan_interval self.scale_down_delay_after_add = scale_down_delay_after_add @@ -1812,20 +1986,25 @@ class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1838,17 +2017,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1858,12 +2042,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1884,7 +2067,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1893,13 +2082,12 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1915,17 +2103,47 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str=None, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class OperationValue(Model): +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. + 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 @@ -1959,7 +2177,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -1969,7 +2190,7 @@ def __init__(self, **kwargs) -> None: self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -1980,15 +2201,20 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, *, id: str=None, **kwargs) -> None: + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = id -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -1996,6 +2222,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_paged_models.py deleted file mode 100644 index 5d90997da620..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_paged_models.py +++ /dev/null @@ -1,53 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) -class AgentPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`AgentPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AgentPool]'} - } - - def __init__(self, *args, **kwargs): - - super(AgentPoolPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/__init__.py index d1b67f7888b7..5aac40228eec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 71b48ccc96da..3305ecbf26f5 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 @@ -1,127 +1,141 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class AgentPoolsOperations(object): """AgentPoolsOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2020_02_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-02-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-02-01" - - self.config = config + self._config = config def list( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 of each agent pool. + Gets a list of agent pools in the specified managed cluster. The operation returns properties + of each 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AgentPool - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolPaged[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore def get( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" """Gets the agent pool. - Gets the details of the agent pool by managed cluster and resource - group. + Gets the details of the agent pool by managed cluster and resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -129,115 +143,122 @@ def get( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_02_01.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', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + 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" + 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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AgentPool') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('AgentPool', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + 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"] """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -248,92 +269,114 @@ def create_or_update( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param parameters: Parameters supplied to the Create or Update an - agent pool operation. - :type parameters: - ~azure.mgmt.containerservice.v2020_02_01.models.AgentPool - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns AgentPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_02_01.models.AgentPool]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - 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, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('AgentPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -344,46 +387,65 @@ def delete( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} + 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 def get_upgrade_profile( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 managed cluster name. + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -391,63 +453,60 @@ def get_upgrade_profile( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_02_01.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', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolUpgradeProfile', response) + deserialized = self._deserialize('AgentPoolUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore def get_available_agent_pool_versions( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -456,56 +515,48 @@ def get_available_agent_pool_versions( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolAvailableVersions or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolAvailableVersions - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_02_01.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', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.get_available_agent_pool_versions.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolAvailableVersions', response) + deserialized = self._deserialize('AgentPoolAvailableVersions', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + 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 47a0a3d77348..06c337c67651 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 @@ -1,742 +1,758 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2020_02_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-02-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-02-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_02_01.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', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_02_01.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', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_02_01.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', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_02_01.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', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def list_cluster_monitoring_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets cluster monitoring user credential of the managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_02_01.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', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true + :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.v2020_02_01.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -745,88 +761,110 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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, {}) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -835,85 +873,111 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -922,90 +986,115 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1014,84 +1103,108 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-02-01" + accept = "application/json" + # Construct URL - url = self.rotate_cluster_certificates.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def rotate_cluster_certificates( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1100,35 +1213,48 @@ def rotate_cluster_certificates( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._rotate_cluster_certificates_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} + 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 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 8d979dcf503c..0c2c206b44b7 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2020_02_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-02-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-02-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2020_02_01.models.OperationValuePaged[~azure.mgmt.containerservice.v2020_02_01.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2020_02_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/version.py deleted file mode 100644 index 5bb7dbc2923d..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2020-02-01" - 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 b7cb9d01cb16..eb3d7ba7a265 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 @@ -1,19 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration import ContainerServiceClientConfiguration from ._container_service_client import ContainerServiceClient -__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration'] - -from .version import VERSION - -__version__ = VERSION +__all__ = ['ContainerServiceClient'] +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 e94fbc7005d9..a8ce5d1af993 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 @@ -1,50 +1,70 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrestazure import AzureConfiguration -from .version import VERSION +from typing import TYPE_CHECKING +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. -class ContainerServiceClientConfiguration(AzureConfiguration): - """Configuration for ContainerServiceClient Note that all parameters used to create this instance are saved as instance attributes. - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - super(ContainerServiceClientConfiguration, self).__init__(base_url) - - # Starting Autorest.Python 4.0.64, make connection pool activated by default - self.keep_alive = True - - self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials + self.credential = credential self.subscription_id = subscription_id + self.api_version = "2020-03-01" + 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 = policies.BearerTokenCredentialPolicy(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 112dfe36bd09..28e64cc1ee68 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 @@ -1,16 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential from ._configuration import ContainerServiceClientConfiguration from .operations import Operations @@ -19,43 +24,56 @@ from . import models -class ContainerServiceClient(SDKClient): +class ContainerServiceClient(object): """The Container Service Client. - :ivar config: Configuration for client. - :vartype config: ContainerServiceClientConfiguration - :ivar operations: Operations operations :vartype operations: azure.mgmt.containerservice.v2020_03_01.operations.Operations - :ivar managed_clusters: ManagedClusters operations + :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.v2020_03_01.operations.ManagedClustersOperations - :ivar agent_pools: AgentPools operations + :ivar agent_pools: AgentPoolsOperations operations :vartype agent_pools: azure.mgmt.containerservice.v2020_03_01.operations.AgentPoolsOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url) - super(ContainerServiceClient, self).__init__(self.config.credentials, self.config) + 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) + 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.api_version = '2020-03-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( - self._client, self.config, self._serialize, self._deserialize) + self._client, self._config, self._serialize, self._deserialize) + + 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/v2020_03_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json new file mode 100644 index 000000000000..d11c6e521b81 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2020-03-01", + "total_api_version_list": ["2020-03-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..353d3cbbff2b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2020-03-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..33eed3de4460 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_container_service_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2020_03_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..d24e93dddb1c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_03_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_03_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2020_03_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_03_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..dc5f422f0b31 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1236 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_03_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2020_03_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. + + :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.v2020_03_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_03_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_03_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_03_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_03_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..34c02450d944 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_03_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2020_03_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/__init__.py index 89500883421b..e995f09726be 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 @@ -1,20 +1,20 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# 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 @@ -26,13 +26,14 @@ 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 ManagedClusterAPIServerAccessProfile 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 @@ -41,10 +42,11 @@ from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile from ._models_py3 import ManagedClusterPropertiesIdentityProfileValue - from ._models_py3 import ManagedClusterServicePrincipalProfile 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 @@ -52,74 +54,81 @@ from ._models_py3 import TagsObject from ._models_py3 import UserAssignedIdentity except (SyntaxError, ImportError): - from ._models import AgentPool - from ._models import AgentPoolAvailableVersions - from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem - from ._models import AgentPoolUpgradeProfile - from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem - from ._models import ContainerServiceDiagnosticsProfile - from ._models import ContainerServiceLinuxProfile - from ._models import ContainerServiceMasterProfile - from ._models import ContainerServiceNetworkProfile - from ._models import ContainerServiceSshConfiguration - from ._models import ContainerServiceSshPublicKey - from ._models import ContainerServiceVMDiagnostics - from ._models import CredentialResult - from ._models import CredentialResults - from ._models import ManagedCluster - from ._models import ManagedClusterAADProfile - from ._models import ManagedClusterAccessProfile - from ._models import ManagedClusterAddonProfile - from ._models import ManagedClusterAddonProfileIdentity - from ._models import ManagedClusterAgentPoolProfile - from ._models import ManagedClusterAgentPoolProfileProperties - from ._models import ManagedClusterAPIServerAccessProfile - from ._models import ManagedClusterIdentity - from ._models import ManagedClusterLoadBalancerProfile - from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs - from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes - from ._models import ManagedClusterLoadBalancerProfileOutboundIPs - from ._models import ManagedClusterPoolUpgradeProfile - from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem - from ._models import ManagedClusterPropertiesAutoScalerProfile - from ._models import ManagedClusterPropertiesIdentityProfileValue - from ._models import ManagedClusterServicePrincipalProfile - from ._models import ManagedClusterSKU - from ._models import ManagedClusterUpgradeProfile - from ._models import ManagedClusterWindowsProfile - from ._models import OperationValue - from ._models import Resource - from ._models import ResourceReference - from ._models import SubResource - from ._models import TagsObject - from ._models import UserAssignedIdentity -from ._paged_models import AgentPoolPaged -from ._paged_models import ManagedClusterPaged -from ._paged_models import OperationValuePaged + 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 ._container_service_client_enums import ( + AgentPoolMode, + AgentPoolType, ContainerServiceStorageProfileTypes, ContainerServiceVMSizeTypes, - OSType, - AgentPoolType, - AgentPoolMode, - ScaleSetPriority, - ScaleSetEvictionPolicy, + Count, + LoadBalancerSku, + ManagedClusterSKUName, + ManagedClusterSKUTier, + NetworkMode, NetworkPlugin, NetworkPolicy, - NetworkMode, + OSType, OutboundType, - LoadBalancerSku, ResourceIdentityType, - ManagedClusterSKUName, - ManagedClusterSKUTier, + ScaleSetEvictionPolicy, + ScaleSetPriority, ) __all__ = [ 'AgentPool', 'AgentPoolAvailableVersions', 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', 'AgentPoolUpgradeProfile', 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'BaseManagedCluster', + 'CloudErrorBody', 'ContainerServiceDiagnosticsProfile', 'ContainerServiceLinuxProfile', 'ContainerServiceMasterProfile', @@ -131,13 +140,14 @@ 'CredentialResults', 'ManagedCluster', 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterAccessProfile', 'ManagedClusterAddonProfile', 'ManagedClusterAddonProfileIdentity', 'ManagedClusterAgentPoolProfile', 'ManagedClusterAgentPoolProfileProperties', - 'ManagedClusterAPIServerAccessProfile', 'ManagedClusterIdentity', + 'ManagedClusterListResult', 'ManagedClusterLoadBalancerProfile', 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', @@ -146,32 +156,31 @@ 'ManagedClusterPoolUpgradeProfileUpgradesItem', 'ManagedClusterPropertiesAutoScalerProfile', 'ManagedClusterPropertiesIdentityProfileValue', - 'ManagedClusterServicePrincipalProfile', 'ManagedClusterSKU', + 'ManagedClusterServicePrincipalProfile', 'ManagedClusterUpgradeProfile', 'ManagedClusterWindowsProfile', + 'OperationListResult', 'OperationValue', 'Resource', 'ResourceReference', 'SubResource', 'TagsObject', 'UserAssignedIdentity', - 'OperationValuePaged', - 'ManagedClusterPaged', - 'AgentPoolPaged', + 'AgentPoolMode', + 'AgentPoolType', 'ContainerServiceStorageProfileTypes', 'ContainerServiceVMSizeTypes', - 'OSType', - 'AgentPoolType', - 'AgentPoolMode', - 'ScaleSetPriority', - 'ScaleSetEvictionPolicy', + 'Count', + 'LoadBalancerSku', + 'ManagedClusterSKUName', + 'ManagedClusterSKUTier', + 'NetworkMode', 'NetworkPlugin', 'NetworkPolicy', - 'NetworkMode', + 'OSType', 'OutboundType', - 'LoadBalancerSku', 'ResourceIdentityType', - 'ManagedClusterSKUName', - 'ManagedClusterSKUTier', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', ] 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 de84d5d535e1..17ff356e0558 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 @@ -1,274 +1,318 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum - - -class ContainerServiceStorageProfileTypes(str, Enum): - - storage_account = "StorageAccount" - managed_disks = "ManagedDisks" - - -class ContainerServiceVMSizeTypes(str, Enum): - - 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_a2m_v2 = "Standard_A2m_v2" - standard_a3 = "Standard_A3" - standard_a4 = "Standard_A4" - standard_a4_v2 = "Standard_A4_v2" - standard_a4m_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_a8m_v2 = "Standard_A8m_v2" - standard_a9 = "Standard_A9" - standard_b2ms = "Standard_B2ms" - standard_b2s = "Standard_B2s" - standard_b4ms = "Standard_B4ms" - standard_b8ms = "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_d16s_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_d2s_v3 = "Standard_D2s_v3" - standard_d3 = "Standard_D3" - standard_d32_v3 = "Standard_D32_v3" - standard_d32s_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_d4s_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_d64s_v3 = "Standard_D64s_v3" - standard_d8_v3 = "Standard_D8_v3" - standard_d8s_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_e16s_v3 = "Standard_E16s_v3" - standard_e2_v3 = "Standard_E2_v3" - standard_e2s_v3 = "Standard_E2s_v3" - standard_e32_16s_v3 = "Standard_E32-16s_v3" - standard_e32_8s_v3 = "Standard_E32-8s_v3" - standard_e32_v3 = "Standard_E32_v3" - standard_e32s_v3 = "Standard_E32s_v3" - standard_e4_v3 = "Standard_E4_v3" - standard_e4s_v3 = "Standard_E4s_v3" - standard_e64_16s_v3 = "Standard_E64-16s_v3" - standard_e64_32s_v3 = "Standard_E64-32s_v3" - standard_e64_v3 = "Standard_E64_v3" - standard_e64s_v3 = "Standard_E64s_v3" - standard_e8_v3 = "Standard_E8_v3" - standard_e8s_v3 = "Standard_E8s_v3" - standard_f1 = "Standard_F1" - standard_f16 = "Standard_F16" - standard_f16s = "Standard_F16s" - standard_f16s_v2 = "Standard_F16s_v2" - standard_f1s = "Standard_F1s" - standard_f2 = "Standard_F2" - standard_f2s = "Standard_F2s" - standard_f2s_v2 = "Standard_F2s_v2" - standard_f32s_v2 = "Standard_F32s_v2" - standard_f4 = "Standard_F4" - standard_f4s = "Standard_F4s" - standard_f4s_v2 = "Standard_F4s_v2" - standard_f64s_v2 = "Standard_F64s_v2" - standard_f72s_v2 = "Standard_F72s_v2" - standard_f8 = "Standard_F8" - standard_f8s = "Standard_F8s" - standard_f8s_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_h16m = "Standard_H16m" - standard_h16mr = "Standard_H16mr" - standard_h16r = "Standard_H16r" - standard_h8 = "Standard_H8" - standard_h8m = "Standard_H8m" - standard_l16s = "Standard_L16s" - standard_l32s = "Standard_L32s" - standard_l4s = "Standard_L4s" - standard_l8s = "Standard_L8s" - standard_m128_32ms = "Standard_M128-32ms" - standard_m128_64ms = "Standard_M128-64ms" - standard_m128ms = "Standard_M128ms" - standard_m128s = "Standard_M128s" - standard_m64_16ms = "Standard_M64-16ms" - standard_m64_32ms = "Standard_M64-32ms" - standard_m64ms = "Standard_M64ms" - standard_m64s = "Standard_M64s" - standard_nc12 = "Standard_NC12" - standard_nc12s_v2 = "Standard_NC12s_v2" - standard_nc12s_v3 = "Standard_NC12s_v3" - standard_nc24 = "Standard_NC24" - standard_nc24r = "Standard_NC24r" - standard_nc24rs_v2 = "Standard_NC24rs_v2" - standard_nc24rs_v3 = "Standard_NC24rs_v3" - standard_nc24s_v2 = "Standard_NC24s_v2" - standard_nc24s_v3 = "Standard_NC24s_v3" - standard_nc6 = "Standard_NC6" - standard_nc6s_v2 = "Standard_NC6s_v2" - standard_nc6s_v3 = "Standard_NC6s_v3" - standard_nd12s = "Standard_ND12s" - standard_nd24rs = "Standard_ND24rs" - standard_nd24s = "Standard_ND24s" - standard_nd6s = "Standard_ND6s" - standard_nv12 = "Standard_NV12" - standard_nv24 = "Standard_NV24" - standard_nv6 = "Standard_NV6" - - -class OSType(str, Enum): - - linux = "Linux" - windows = "Windows" - - -class AgentPoolType(str, Enum): - - virtual_machine_scale_sets = "VirtualMachineScaleSets" - availability_set = "AvailabilitySet" - - -class AgentPoolMode(str, Enum): - - system = "System" - user = "User" - - -class ScaleSetPriority(str, Enum): - - spot = "Spot" - low = "Low" - regular = "Regular" - - -class ScaleSetEvictionPolicy(str, Enum): - - delete = "Delete" - deallocate = "Deallocate" - - -class NetworkPlugin(str, Enum): - - azure = "azure" - kubenet = "kubenet" - - -class NetworkPolicy(str, Enum): - - calico = "calico" - azure = "azure" - - -class NetworkMode(str, Enum): - - transparent = "transparent" - bridge = "bridge" - - -class OutboundType(str, Enum): - - load_balancer = "loadBalancer" - user_defined_routing = "userDefinedRouting" - - -class LoadBalancerSku(str, Enum): - - standard = "standard" - basic = "basic" - - -class ResourceIdentityType(str, Enum): - - system_assigned = "SystemAssigned" - none = "None" - - -class ManagedClusterSKUName(str, Enum): - - basic = "Basic" - - -class ManagedClusterSKUTier(str, Enum): - - paid = "Paid" - free = "Free" +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """AgentPoolMode represents mode of an agent pool. + """ + + SYSTEM = "System" + USER = "User" + +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)): + """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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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)): + """Name of a managed cluster SKU. + """ + + BASIC = "Basic" + +class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of a managed cluster SKU. + """ + + PAID = "Paid" + FREE = "Free" + +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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """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)): + """The outbound (egress) routing method. + """ + + LOAD_BALANCER = "loadBalancer" + USER_DEFINED_ROUTING = "userDefinedRouting" + +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 + principal will be used instead. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" + +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. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. + """ + + SPOT = "Spot" + LOW = "Low" + REGULAR = "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 index 92c24b124594..aed3f798a4d7 100644 --- 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 @@ -1,30 +1,25 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +import msrest.serialization -class SubResource(Model): +class SubResource(msrest.serialization.Model): """Reference to another subresource. - Variables are only populated by the server, and will be ignored when - sending a request. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +35,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,138 +48,115 @@ def __init__(self, **kwargs): class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: str - :param count: Required. Number of agents (VMs) to host docker containers. - Allowed values must be in the range of 0 to 100 (inclusive). The default - value is 1. . Default value: 1 . + :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: 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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -189,8 +164,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 0}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -207,7 +181,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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'}, @@ -221,9 +195,12 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) + 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) @@ -232,7 +209,7 @@ def __init__(self, **kwargs): 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.agent_pool_type = kwargs.get('agent_pool_type', 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 @@ -240,17 +217,16 @@ def __init__(self, **kwargs): 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', None) + 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(Model): +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. + 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 @@ -276,7 +252,10 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -284,7 +263,7 @@ def __init__(self, **kwargs): self.agent_pool_versions = kwargs.get('agent_pool_versions', None) -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -301,18 +280,49 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 AgentPoolUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -322,16 +332,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -353,17 +359,20 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.kubernetes_version = kwargs['kubernetes_version'] self.os_type = kwargs.get('os_type', "Linux") self.upgrades = kwargs.get('upgrades', None) -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -377,56 +386,151 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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 CloudError(Model): - """An error response from the Container service. +class BaseManagedCluster(msrest.serialization.Model): + """BaseManagedCluster. - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2020_03_01.models.CloudErrorBody + 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.UserAssignedIdentity] """ - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + _validation = { + 'provisioning_state': {'readonly': True}, + 'max_agent_pools': {'readonly': True}, + 'fqdn': {'readonly': True}, + 'private_fqdn': {'readonly': True}, } - def __init__(self, **kwargs): - super(CloudError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): + _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': '{UserAssignedIdentity}'}, + } - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + 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(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2020_03_01.models.CloudErrorBody] """ _attribute_map = { @@ -436,7 +540,10 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.message = kwargs.get('message', None) @@ -444,13 +551,12 @@ def __init__(self, **kwargs): self.details = kwargs.get('details', None) -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMDiagnostics """ @@ -463,23 +569,23 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) - self.vm_diagnostics = kwargs.get('vm_diagnostics', None) + self.vm_diagnostics = kwargs['vm_diagnostics'] -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -492,93 +598,79 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) - self.ssh = kwargs.get('ssh', None) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -588,6 +680,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -602,11 +695,14 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) - self.dns_prefix = kwargs.get('dns_prefix', None) - self.vm_size = kwargs.get('vm_size', None) + 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") @@ -614,46 +710,35 @@ def __init__(self, **kwargs): self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 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 @@ -679,7 +764,10 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, **kwargs): + 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) @@ -693,13 +781,13 @@ def __init__(self, **kwargs): self.load_balancer_profile = kwargs.get('load_balancer_profile', None) -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -712,19 +800,21 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) - self.public_keys = kwargs.get('public_keys', None) + self.public_keys = kwargs['public_keys'] -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -736,24 +826,24 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) - self.key_data = kwargs.get('key_data', None) + self.key_data = kwargs['key_data'] -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -767,17 +857,19 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -795,21 +887,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_03_01.models.CredentialResult] """ _validation = { @@ -820,28 +913,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -860,41 +955,33 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = kwargs.get('location', None) + self.location = kwargs['location'] self.tags = kwargs.get('tags', None) -class ManagedCluster(Resource): +class ManagedCluster(Resource, BaseManagedCluster): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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: Resource tags - :type tags: dict[str, str] - :ivar provisioning_state: The current deployment or provisioning state, - which only appears in the response. + :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. + :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. + :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 @@ -905,75 +992,71 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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. + :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. + :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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterIdentity + ~azure.mgmt.containerservice.v2020_03_01.models.UserAssignedIdentity] + :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 + :type sku: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKU """ _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}, + '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}'}, + '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'}, @@ -993,13 +1076,21 @@ class ManagedCluster(Resource): '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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, + '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): + 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) @@ -1020,42 +1111,49 @@ def __init__(self, **kwargs): 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.identity = kwargs.get('identity', 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(Model): +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_ids: AAD group object IDs that will have admin - role of the cluster. - :type admin_group_object_ids: list[str] + :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. + :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_ids': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, + '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): + def __init__( + self, + **kwargs + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = kwargs.get('managed', None) - self.admin_group_object_ids = kwargs.get('admin_group_object_ids', 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) @@ -1065,20 +1163,19 @@ def __init__(self, **kwargs): class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1100,16 +1197,18 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(**kwargs) self.kube_config = kwargs.get('kube_config', None) -class ManagedClusterAddonProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1118,8 +1217,7 @@ class ManagedClusterAddonProfile(Model): :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 + :vartype identity: ~azure.mgmt.containerservice.v2020_03_01.models.UserAssignedIdentity """ _validation = { @@ -1130,17 +1228,20 @@ class ManagedClusterAddonProfile(Model): _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) + self.enabled = kwargs['enabled'] self.config = kwargs.get('config', None) self.identity = None -class UserAssignedIdentity(Model): +class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. :param resource_id: The resource id of the user assigned identity. @@ -1157,7 +1258,10 @@ class UserAssignedIdentity(Model): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -1181,144 +1285,122 @@ class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only 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 0 to 100 (inclusive). The default - value is 1. . Default value: 1 . + :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: 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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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 = { - 'count': {'required': True, 'maximum': 100, 'minimum': 0}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -1346,9 +1428,12 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) - self.count = kwargs.get('count', 1) + 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) @@ -1365,7 +1450,7 @@ def __init__(self, **kwargs): 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', None) + 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) @@ -1374,140 +1459,117 @@ def __init__(self, **kwargs): 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. + Variables are only 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 0 to 100 (inclusive). The default - value is 1. . Default value: 1 . + :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: 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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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. + :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': 0}, - '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}$'}, } @@ -1537,19 +1599,20 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + self.name = kwargs['name'] -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1558,32 +1621,31 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1594,43 +1656,71 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = kwargs.get('type', None) -class ManagedClusterLoadBalancerProfile(Model): +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_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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. - Default value: 0 . + :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. Default value: 30 . + :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 """ @@ -1640,30 +1730,32 @@ class ManagedClusterLoadBalancerProfile(Model): } _attribute_map = { - 'managed_outbound_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + '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): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = kwargs.get('managed_outbound_ips', None) + self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) - self.outbound_ips = kwargs.get('outbound_ips', None) - self.effective_outbound_ips = kwargs.get('effective_outbound_ips', 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(Model): +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. . Default value: 1 . + :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 """ @@ -1675,12 +1767,15 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = kwargs.get('count', 1) -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1692,45 +1787,46 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = kwargs.get('public_ips', None) + self.public_i_ps = kwargs.get('public_i_ps', None) -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1747,15 +1843,18 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) - self.kubernetes_version = kwargs.get('kubernetes_version', None) + 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(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1769,13 +1868,16 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, **kwargs): + 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(Model): +class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. :param balance_similar_node_groups: @@ -1810,7 +1912,10 @@ class ManagedClusterPropertiesAutoScalerProfile(Model): 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, } - def __init__(self, **kwargs): + 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) @@ -1840,20 +1945,21 @@ class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(**kwargs) -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1866,23 +1972,22 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) - self.client_id = kwargs.get('client_id', None) + self.client_id = kwargs['client_id'] self.secret = kwargs.get('secret', None) -class ManagedClusterSKU(Model): +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 + :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 = { @@ -1890,17 +1995,19 @@ class ManagedClusterSKU(Model): 'tier': {'key': 'tier', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterSKU, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.tier = kwargs.get('tier', None) -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1910,12 +2017,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1936,22 +2042,24 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.control_plane_profile = kwargs.get('control_plane_profile', None) - self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.control_plane_profile = kwargs['control_plane_profile'] + self.agent_pool_profiles = kwargs['agent_pool_profiles'] -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1967,17 +2075,44 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) - self.admin_username = kwargs.get('admin_username', None) + self.admin_username = kwargs['admin_username'] self.admin_password = kwargs.get('admin_password', None) -class OperationValue(Model): +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. + 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 @@ -2011,7 +2146,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2021,7 +2159,7 @@ def __init__(self, **kwargs): self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -2032,15 +2170,18 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, **kwargs): + def __init__( + self, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = kwargs.get('id', None) -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -2048,6 +2189,9 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs): + 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 ca7a88f2bdca..c5b1f184e401 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 @@ -1,30 +1,29 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError +from typing import Dict, List, Optional, Union +import msrest.serialization -class SubResource(Model): +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. + 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. + :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 + :ivar type: Resource type. :vartype type: str """ @@ -40,7 +39,10 @@ class SubResource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(SubResource, self).__init__(**kwargs) self.id = None self.name = None @@ -50,138 +52,115 @@ def __init__(self, **kwargs) -> None: class AgentPool(SubResource): """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. + 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. + :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 + :ivar type: Resource type. :vartype type: str - :param count: Required. Number of agents (VMs) to host docker containers. - Allowed values must be in the range of 0 to 100 (inclusive). The default - value is 1. . Default value: 1 . + :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: 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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :param enable_auto_scaling: Whether to enable auto-scaler. :type enable_auto_scaling: bool - :param agent_pool_type: AgentPoolType represents types of an agent pool. - Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' - :type agent_pool_type: str or + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :param node_taints: Taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule. :type node_taints: list[str] """ @@ -189,8 +168,7 @@ class AgentPool(SubResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'count': {'required': True, 'maximum': 100, 'minimum': 0}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -207,7 +185,7 @@ class AgentPool(SubResource): 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, 'min_count': {'key': 'properties.minCount', 'type': 'int'}, 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, - 'agent_pool_type': {'key': 'properties.type', 'type': 'str'}, + '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'}, @@ -221,7 +199,31 @@ class AgentPool(SubResource): 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, } - def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, agent_pool_type=None, mode=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", spot_max_price: float=None, tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): super(AgentPool, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -232,7 +234,7 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub self.max_count = max_count self.min_count = min_count self.enable_auto_scaling = enable_auto_scaling - self.agent_pool_type = agent_pool_type + self.type_properties_type = type_properties_type self.mode = mode self.orchestrator_version = orchestrator_version self.provisioning_state = None @@ -246,11 +248,10 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub self.node_taints = node_taints -class AgentPoolAvailableVersions(Model): +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. + 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 @@ -276,7 +277,12 @@ class AgentPoolAvailableVersions(Model): 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, } - def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: + def __init__( + self, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): super(AgentPoolAvailableVersions, self).__init__(**kwargs) self.id = None self.name = None @@ -284,7 +290,7 @@ def __init__(self, *, agent_pool_versions=None, **kwargs) -> None: self.agent_pool_versions = agent_pool_versions -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. :param default: Whether this version is the default agent pool version. @@ -301,18 +307,55 @@ class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, default: bool=None, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) self.default = default self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class AgentPoolUpgradeProfile(Model): +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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -322,16 +365,12 @@ class AgentPoolUpgradeProfile(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). + :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. + :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] """ @@ -353,7 +392,14 @@ class AgentPoolUpgradeProfile(Model): 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + **kwargs + ): super(AgentPoolUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -363,7 +409,7 @@ def __init__(self, *, kubernetes_version: str, os_type="Linux", upgrades=None, * self.upgrades = upgrades -class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): """AgentPoolUpgradeProfilePropertiesUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -377,56 +423,172 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class CloudError(Model): - """An error response from the Container service. - - :param error: Details about the error. - :type error: - ~azure.mgmt.containerservice.v2020_03_01.models.CloudErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'CloudErrorBody'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(CloudError, self).__init__(**kwargs) - self.error = error +class BaseManagedCluster(msrest.serialization.Model): + """BaseManagedCluster. + Variables are only populated by the server, and will be ignored when sending a request. -class CloudErrorException(HttpOperationError): - """Server responsed with exception of type: 'CloudError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. + :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.UserAssignedIdentity] """ - def __init__(self, deserialize, response, *args): + _validation = { + 'provisioning_state': {'readonly': True}, + 'max_agent_pools': {'readonly': True}, + 'fqdn': {'readonly': True}, + 'private_fqdn': {'readonly': True}, + } - super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + _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': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + **kwargs + ): + super(BaseManagedCluster, self).__init__(**kwargs) + self.identity = identity + self.provisioning_state = None + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn = None + self.private_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.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.network_profile = network_profile + self.aad_profile = aad_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 -class CloudErrorBody(Model): +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. + :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. + :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. + :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] + :type details: list[~azure.mgmt.containerservice.v2020_03_01.models.CloudErrorBody] """ _attribute_map = { @@ -436,7 +598,15 @@ class CloudErrorBody(Model): 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } - def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): super(CloudErrorBody, self).__init__(**kwargs) self.code = code self.message = message @@ -444,13 +614,12 @@ def __init__(self, *, code: str=None, message: str=None, target: str=None, detai self.details = details -class ContainerServiceDiagnosticsProfile(Model): +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. + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. :type vm_diagnostics: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceVMDiagnostics """ @@ -463,23 +632,25 @@ class ContainerServiceDiagnosticsProfile(Model): 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, } - def __init__(self, *, vm_diagnostics, **kwargs) -> None: + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) self.vm_diagnostics = vm_diagnostics -class ContainerServiceLinuxProfile(Model): +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. + :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 + :param ssh: Required. SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2020_03_01.models.ContainerServiceSshConfiguration """ _validation = { @@ -492,93 +663,82 @@ class ContainerServiceLinuxProfile(Model): 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, } - def __init__(self, *, admin_username: str, ssh, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): super(ContainerServiceLinuxProfile, self).__init__(**kwargs) self.admin_username = admin_username self.ssh = ssh -class ContainerServiceMasterProfile(Model): +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. + Variables are only 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. Default value: 1 . - :type count: int - :param dns_prefix: Required. DNS prefix to be used to create the FQDN for - the master pool. + :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' + :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. + :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. + :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. Default value: "10.240.255.5" . + :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' + :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. @@ -588,6 +748,7 @@ class ContainerServiceMasterProfile(Model): _validation = { 'dns_prefix': {'required': True}, 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'fqdn': {'readonly': True}, } @@ -602,7 +763,18 @@ class ContainerServiceMasterProfile(Model): 'fqdn': {'key': 'fqdn', 'type': 'str'}, } - def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, first_consecutive_static_ip: str="10.240.255.5", storage_profile=None, **kwargs) -> None: + 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 + ): super(ContainerServiceMasterProfile, self).__init__(**kwargs) self.count = count self.dns_prefix = dns_prefix @@ -614,46 +786,35 @@ def __init__(self, *, dns_prefix: str, vm_size, count: int=1, os_disk_size_gb: i self.fqdn = None -class ContainerServiceNetworkProfile(Model): +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. Default value: "10.244.0.0/16" . + :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. Default value: - "10.0.0.0/16" . + :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. Default value: "10.0.0.10" . + :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. Default value: "172.17.0.1/16" . + :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 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 @@ -679,7 +840,21 @@ class ContainerServiceNetworkProfile(Model): 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, network_mode=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", outbound_type="loadBalancer", load_balancer_sku=None, load_balancer_profile=None, **kwargs) -> None: + 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, + **kwargs + ): super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -693,13 +868,13 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, network_mod self.load_balancer_profile = load_balancer_profile -class ContainerServiceSshConfiguration(Model): +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. + :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] """ @@ -712,19 +887,23 @@ class ContainerServiceSshConfiguration(Model): 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, } - def __init__(self, *, public_keys, **kwargs) -> None: + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): super(ContainerServiceSshConfiguration, self).__init__(**kwargs) self.public_keys = public_keys -class ContainerServiceSshPublicKey(Model): +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. + :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 """ @@ -736,24 +915,26 @@ class ContainerServiceSshPublicKey(Model): 'key_data': {'key': 'keyData', 'type': 'str'}, } - def __init__(self, *, key_data: str, **kwargs) -> None: + def __init__( + self, + *, + key_data: str, + **kwargs + ): super(ContainerServiceSshPublicKey, self).__init__(**kwargs) self.key_data = key_data -class ContainerServiceVMDiagnostics(Model): +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. + Variables are only 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. + :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. + :ivar storage_uri: The URI of the storage account where diagnostics are stored. :vartype storage_uri: str """ @@ -767,17 +948,21 @@ class ContainerServiceVMDiagnostics(Model): 'storage_uri': {'key': 'storageUri', 'type': 'str'}, } - def __init__(self, *, enabled: bool, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + **kwargs + ): super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None -class CredentialResult(Model): +class CredentialResult(msrest.serialization.Model): """The credential result response. - Variables are only populated by the server, and will be ignored when - sending a request. + 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 @@ -795,21 +980,22 @@ class CredentialResult(Model): 'value': {'key': 'value', 'type': 'bytearray'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResult, self).__init__(**kwargs) self.name = None self.value = None -class CredentialResults(Model): +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. + 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] + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2020_03_01.models.CredentialResult] """ _validation = { @@ -820,28 +1006,30 @@ class CredentialResults(Model): 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(CredentialResults, self).__init__(**kwargs) self.kubeconfigs = None -class Resource(Model): +class Resource(msrest.serialization.Model): """The Resource model definition. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -860,7 +1048,13 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -869,32 +1063,21 @@ def __init__(self, *, location: str, tags=None, **kwargs) -> None: self.tags = tags -class ManagedCluster(Resource): +class ManagedCluster(Resource, BaseManagedCluster): """Managed cluster. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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: Resource tags - :type tags: dict[str, str] - :ivar provisioning_state: The current deployment or provisioning state, - which only appears in the response. + :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. + :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. + :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 @@ -905,75 +1088,71 @@ class ManagedCluster(Resource): :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. + :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. + :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. + :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. + :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. + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool - :param enable_pod_security_policy: (PREVIEW) Whether to enable Kubernetes - Pod security policy. + :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 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. + :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. + :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] - :param identity: The identity of the managed cluster, if configured. - :type identity: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterIdentity + ~azure.mgmt.containerservice.v2020_03_01.models.UserAssignedIdentity] + :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 + :type sku: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterSKU """ _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}, + '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}'}, + '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'}, @@ -993,13 +1172,42 @@ class ManagedCluster(Resource): '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}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, + '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, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, node_resource_group: str=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, auto_scaler_profile=None, api_server_access_profile=None, disk_encryption_set_id: str=None, identity_profile=None, identity=None, sku=None, **kwargs) -> None: - super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + def __init__( + self, + *, + location: str, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + tags: Optional[Dict[str, str]] = None, + sku: Optional["ManagedClusterSKU"] = None, + **kwargs + ): + 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 self.max_agent_pools = None self.kubernetes_version = kubernetes_version @@ -1020,42 +1228,56 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.api_server_access_profile = api_server_access_profile self.disk_encryption_set_id = disk_encryption_set_id self.identity_profile = identity_profile - self.identity = identity + self.sku = sku + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags self.sku = sku -class ManagedClusterAADProfile(Model): +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_ids: AAD group object IDs that will have admin - role of the cluster. - :type admin_group_object_ids: list[str] + :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. + :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_ids': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, + '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: bool=None, admin_group_object_ids=None, client_app_id: str=None, server_app_id: str=None, server_app_secret: str=None, tenant_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + managed: 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 + ): super(ManagedClusterAADProfile, self).__init__(**kwargs) self.managed = managed - self.admin_group_object_ids = admin_group_object_ids + 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 @@ -1065,20 +1287,19 @@ def __init__(self, *, managed: bool=None, admin_group_object_ids=None, client_ap class ManagedClusterAccessProfile(Resource): """Managed cluster Access Profile. - Variables are only populated by the server, and will be ignored when - sending a request. + Variables are only populated by 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 + :ivar id: Resource Id. :vartype id: str - :ivar name: Resource name + :ivar name: Resource name. :vartype name: str - :ivar type: Resource type + :ivar type: Resource type. :vartype type: str - :param location: Required. Resource location + :param location: Required. Resource location. :type location: str - :param tags: Resource tags + :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 @@ -1100,16 +1321,22 @@ class ManagedClusterAccessProfile(Resource): 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, } - def __init__(self, *, location: str, tags=None, kube_config: bytearray=None, **kwargs) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) self.kube_config = kube_config -class ManagedClusterAddonProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1118,8 +1345,7 @@ class ManagedClusterAddonProfile(Model): :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 + :vartype identity: ~azure.mgmt.containerservice.v2020_03_01.models.UserAssignedIdentity """ _validation = { @@ -1130,17 +1356,23 @@ class ManagedClusterAddonProfile(Model): _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'config': {'key': 'config', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, } - def __init__(self, *, enabled: bool, config=None, **kwargs) -> None: + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): super(ManagedClusterAddonProfile, self).__init__(**kwargs) self.enabled = enabled self.config = config self.identity = None -class UserAssignedIdentity(Model): +class UserAssignedIdentity(msrest.serialization.Model): """UserAssignedIdentity. :param resource_id: The resource id of the user assigned identity. @@ -1157,7 +1389,14 @@ class UserAssignedIdentity(Model): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(UserAssignedIdentity, self).__init__(**kwargs) self.resource_id = resource_id self.client_id = client_id @@ -1181,144 +1420,126 @@ class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) -class ManagedClusterAgentPoolProfileProperties(Model): +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. + Variables are only 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 0 to 100 (inclusive). The default - value is 1. . Default value: 1 . + :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: 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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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 = { - 'count': {'required': True, 'maximum': 100, 'minimum': 0}, - 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 1023, 'minimum': 0}, 'provisioning_state': {'readonly': True}, } @@ -1346,7 +1567,31 @@ class ManagedClusterAgentPoolProfileProperties(Model): 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, } - def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, mode=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", spot_max_price: float=None, tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) self.count = count self.vm_size = vm_size @@ -1374,140 +1619,117 @@ def __init__(self, *, vm_size, count: int=1, os_disk_size_gb: int=None, vnet_sub 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. + Variables are only 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 0 to 100 (inclusive). The default - value is 1. . Default value: 1 . + :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: 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' + :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. + :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. + :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 + :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 + :param min_count: Minimum number of nodes for auto-scaling. :type min_count: int - :param enable_auto_scaling: Whether to enable auto-scaler + :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. + :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. + :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. + :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 + :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" . + :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" . + :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. + :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: Agent pool tags to be persisted on the agent pool virtual - machine scale set. + :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. + :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. + :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. + :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': 0}, - '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}$'}, } @@ -1537,19 +1759,42 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, vm_size, name: str, count: int=1, os_disk_size_gb: int=None, vnet_subnet_id: str=None, max_pods: int=None, os_type="Linux", max_count: int=None, min_count: int=None, enable_auto_scaling: bool=None, type=None, mode=None, orchestrator_version: str=None, availability_zones=None, enable_node_public_ip: bool=None, scale_set_priority="Regular", scale_set_eviction_policy="Delete", spot_max_price: float=None, tags=None, node_labels=None, node_taints=None, **kwargs) -> None: + def __init__( + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): 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 -class ManagedClusterAPIServerAccessProfile(Model): +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): """Access profile for managed cluster API server. - :param authorized_ip_ranges: Authorized IP Ranges to kubernetes 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. + :param enable_private_cluster: Whether to create the cluster as a private cluster or not. :type enable_private_cluster: bool """ @@ -1558,32 +1803,34 @@ class ManagedClusterAPIServerAccessProfile(Model): 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, } - def __init__(self, *, authorized_ip_ranges=None, enable_private_cluster: bool=None, **kwargs) -> None: + def __init__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + **kwargs + ): super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) self.authorized_ip_ranges = authorized_ip_ranges self.enable_private_cluster = enable_private_cluster -class ManagedClusterIdentity(Model): +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. + 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. + :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. + :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 + :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 = { @@ -1594,43 +1841,75 @@ class ManagedClusterIdentity(Model): _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, type=None, **kwargs) -> None: + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + **kwargs + ): super(ManagedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type -class ManagedClusterLoadBalancerProfile(Model): +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): """Profile of the managed cluster load balancer. - :param managed_outbound_ips: Desired managed outbound IPs for the cluster - load balancer. - :type managed_outbound_ips: + :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. + :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_ips: Desired outbound IP resources for the cluster load - balancer. - :type outbound_ips: + :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_ips: The effective outbound IP resources of the - cluster load balancer. - :type effective_outbound_ips: + :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. - Default value: 0 . + :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. Default value: 30 . + :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 """ @@ -1640,30 +1919,39 @@ class ManagedClusterLoadBalancerProfile(Model): } _attribute_map = { - 'managed_outbound_ips': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, - 'outbound_ips': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, - 'effective_outbound_ips': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + '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, *, managed_outbound_ips=None, outbound_ip_prefixes=None, outbound_ips=None, effective_outbound_ips=None, allocated_outbound_ports: int=0, idle_timeout_in_minutes: int=30, **kwargs) -> None: + 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, + **kwargs + ): super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) - self.managed_outbound_ips = managed_outbound_ips + self.managed_outbound_i_ps = managed_outbound_i_ps self.outbound_ip_prefixes = outbound_ip_prefixes - self.outbound_ips = outbound_ips - self.effective_outbound_ips = effective_outbound_ips + 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 -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): +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. . Default value: 1 . + :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 """ @@ -1675,12 +1963,17 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(Model): 'count': {'key': 'count', 'type': 'int'}, } - def __init__(self, *, count: int=1, **kwargs) -> None: + def __init__( + self, + *, + count: Optional[int] = 1, + **kwargs + ): super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) self.count = count -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): +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. @@ -1692,45 +1985,50 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Model): 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ip_prefixes=None, **kwargs) -> None: + def __init__( + self, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) self.public_ip_prefixes = public_ip_prefixes -class ManagedClusterLoadBalancerProfileOutboundIPs(Model): +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): """Desired outbound IP resources for the cluster load balancer. - :param public_ips: A list of public IP resources. - :type public_ips: - list[~azure.mgmt.containerservice.v2020_03_01.models.ResourceReference] + :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_ips': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, } - def __init__(self, *, public_ips=None, **kwargs) -> None: + def __init__( + self, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) - self.public_ips = public_ips + self.public_i_ps = public_i_ps -class ManagedClusterPoolUpgradeProfile(Model): +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). + :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. + :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] """ @@ -1747,7 +2045,15 @@ class ManagedClusterPoolUpgradeProfile(Model): 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } - def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.name = name @@ -1755,7 +2061,7 @@ def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", self.upgrades = upgrades -class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): """ManagedClusterPoolUpgradeProfileUpgradesItem. :param kubernetes_version: Kubernetes version (major, minor, patch). @@ -1769,13 +2075,19 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) self.kubernetes_version = kubernetes_version self.is_preview = is_preview -class ManagedClusterPropertiesAutoScalerProfile(Model): +class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): """Parameters to be applied to the cluster-autoscaler when enabled. :param balance_similar_node_groups: @@ -1810,7 +2122,20 @@ class ManagedClusterPropertiesAutoScalerProfile(Model): 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, } - def __init__(self, *, balance_similar_node_groups: str=None, scan_interval: str=None, scale_down_delay_after_add: str=None, scale_down_delay_after_delete: str=None, scale_down_delay_after_failure: str=None, scale_down_unneeded_time: str=None, scale_down_unready_time: str=None, scale_down_utilization_threshold: str=None, max_graceful_termination_sec: str=None, **kwargs) -> None: + def __init__( + self, + *, + balance_similar_node_groups: 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, + max_graceful_termination_sec: Optional[str] = None, + **kwargs + ): super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) self.balance_similar_node_groups = balance_similar_node_groups self.scan_interval = scan_interval @@ -1840,20 +2165,25 @@ class ManagedClusterPropertiesIdentityProfileValue(UserAssignedIdentity): 'object_id': {'key': 'objectId', 'type': 'str'}, } - def __init__(self, *, resource_id: str=None, client_id: str=None, object_id: str=None, **kwargs) -> None: + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) -class ManagedClusterServicePrincipalProfile(Model): - """Information about a service principal identity for the cluster to use for - manipulating Azure APIs. +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. + :param secret: The secret password associated with the service principal in plain text. :type secret: str """ @@ -1866,23 +2196,25 @@ class ManagedClusterServicePrincipalProfile(Model): 'secret': {'key': 'secret', 'type': 'str'}, } - def __init__(self, *, client_id: str, secret: str=None, **kwargs) -> None: + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) self.client_id = client_id self.secret = secret -class ManagedClusterSKU(Model): +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 + :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 = { @@ -1890,17 +2222,22 @@ class ManagedClusterSKU(Model): 'tier': {'key': 'tier', 'type': 'str'}, } - def __init__(self, *, name=None, tier=None, **kwargs) -> None: + def __init__( + self, + *, + name: Optional[Union[str, "ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, + **kwargs + ): super(ManagedClusterSKU, self).__init__(**kwargs) self.name = name self.tier = tier -class ManagedClusterUpgradeProfile(Model): +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. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. @@ -1910,12 +2247,11 @@ class ManagedClusterUpgradeProfile(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 plane. + :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. + :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] """ @@ -1936,7 +2272,13 @@ class ManagedClusterUpgradeProfile(Model): 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, } - def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> None: + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) self.id = None self.name = None @@ -1945,13 +2287,12 @@ def __init__(self, *, control_plane_profile, agent_pool_profiles, **kwargs) -> N self.agent_pool_profiles = agent_pool_profiles -class ManagedClusterWindowsProfile(Model): +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. The administrator username to use for - Windows VMs. + :param admin_username: Required. The administrator username to use for Windows VMs. :type admin_username: str :param admin_password: The administrator password to use for Windows VMs. :type admin_password: str @@ -1967,17 +2308,47 @@ class ManagedClusterWindowsProfile(Model): 'admin_password': {'key': 'adminPassword', 'type': 'str'}, } - def __init__(self, *, admin_username: str, admin_password: str=None, **kwargs) -> None: + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + **kwargs + ): super(ManagedClusterWindowsProfile, self).__init__(**kwargs) self.admin_username = admin_username self.admin_password = admin_password -class OperationValue(Model): +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. + 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 @@ -2011,7 +2382,10 @@ class OperationValue(Model): 'provider': {'key': 'display.provider', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__( + self, + **kwargs + ): super(OperationValue, self).__init__(**kwargs) self.origin = None self.name = None @@ -2021,7 +2395,7 @@ def __init__(self, **kwargs) -> None: self.provider = None -class ResourceReference(Model): +class ResourceReference(msrest.serialization.Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. @@ -2032,15 +2406,20 @@ class ResourceReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, *, id: str=None, **kwargs) -> None: + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): super(ResourceReference, self).__init__(**kwargs) self.id = id -class TagsObject(Model): +class TagsObject(msrest.serialization.Model): """Tags object for patch operations. - :param tags: Resource tags. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ @@ -2048,6 +2427,11 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): super(TagsObject, self).__init__(**kwargs) self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_paged_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_paged_models.py deleted file mode 100644 index 77509d66a180..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/models/_paged_models.py +++ /dev/null @@ -1,53 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationValuePaged(Paged): - """ - A paging container for iterating over a list of :class:`OperationValue ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[OperationValue]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationValuePaged, self).__init__(*args, **kwargs) -class ManagedClusterPaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedCluster ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedCluster]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedClusterPaged, self).__init__(*args, **kwargs) -class AgentPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`AgentPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[AgentPool]'} - } - - def __init__(self, *args, **kwargs): - - super(AgentPoolPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/__init__.py index d1b67f7888b7..5aac40228eec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/operations/__init__.py @@ -1,12 +1,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from ._operations import Operations 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 31502eda0fc2..9c895359d719 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 @@ -1,127 +1,141 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class AgentPoolsOperations(object): """AgentPoolsOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2020_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-03-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-01" - - self.config = config + self._config = config def list( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 of each agent pool. + Gets a list of agent pools in the specified managed cluster. The operation returns properties + of each 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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of AgentPool - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolPaged[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.AgentPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore def get( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" """Gets the agent pool. - Gets the details of the agent pool by managed cluster and resource - group. + Gets the details of the agent pool by managed cluster and resource group. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -129,115 +143,122 @@ def get( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_03_01.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', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + 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" + 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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'AgentPool') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('AgentPool', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('AgentPool', response) + deserialized = self._deserialize('AgentPool', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, agent_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + 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"] """Creates or updates an agent pool. Creates or updates an agent pool in the specified managed cluster. @@ -248,92 +269,114 @@ def create_or_update( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param parameters: Parameters supplied to the Create or Update an - agent pool operation. - :type parameters: - ~azure.mgmt.containerservice.v2020_03_01.models.AgentPool - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns AgentPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_03_01.models.AgentPool]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - 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, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('AgentPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} - + 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, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes an agent pool. Deletes the agent pool in the specified managed cluster. @@ -344,46 +387,65 @@ def delete( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} + 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 def get_upgrade_profile( - self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 managed cluster name. + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -391,63 +453,60 @@ def get_upgrade_profile( :type resource_name: str :param agent_pool_name: The name of the agent pool. :type agent_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_03_01.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', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), - 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolUpgradeProfile', response) + deserialized = self._deserialize('AgentPoolUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore def get_available_agent_pool_versions( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" """Gets a list of supported versions for the specified agent pool. Gets a list of supported versions for the specified agent pool. @@ -456,56 +515,48 @@ def get_available_agent_pool_versions( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AgentPoolAvailableVersions or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolAvailableVersions - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_03_01.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', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.get_available_agent_pool_versions.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('AgentPoolAvailableVersions', response) + deserialized = self._deserialize('AgentPoolAvailableVersions', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + 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 f54fbca2f5d7..d4cb1db6988b 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 @@ -1,742 +1,758 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class ManagedClustersOperations(object): """ManagedClustersOperations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2020_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-03-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> 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. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] - :raises: :class:`CloudError` + 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] + :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', {})) + 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'] + url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists managed clusters in the specified subscription and resource - group. + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 properties of each managed cluster. + Lists managed clusters in the specified subscription and resource group. The operation returns + properties of each managed cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedCluster - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterPaged[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] + 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) + 'subscriptionId': self._serialize.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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - return response + return pipeline_response - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore def get_upgrade_profile( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets the details of the upgrade profile for a managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterUpgradeProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterUpgradeProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_03_01.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', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.get_upgrade_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterUpgradeProfile', response) + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore def get_access_profile( - self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 resource group and name. + Gets the accessProfile for the specified role name of the managed cluster with a specified + resource group and name. :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. + :param role_name: The name of the role for managed cluster accessProfile resource. :type role_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedClusterAccessProfile or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAccessProfile - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_03_01.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', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.get_access_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=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') + 'roleName': self._serialize.url("role_name", role_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedClusterAccessProfile', response) + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore def list_cluster_admin_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster admin credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_03_01.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', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_admin_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore def list_cluster_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + Gets cluster user credential of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_03_01.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', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore def list_cluster_monitoring_user_credentials( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 and name. + Gets cluster monitoring user credential of the managed cluster with a specified resource group + and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CredentialResults or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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.v2020_03_01.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', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.list_cluster_monitoring_user_credentials.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('CredentialResults', response) + deserialized = self._deserialize('CredentialResults', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_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'} + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" """Gets a managed cluster. - Gets the details of the managed cluster with a specified resource group - and name. + Gets the details of the managed cluster with a specified resource group and name. :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedCluster or ClientRawResponse if raw=true + :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.v2020_03_01.models.ManagedCluster - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :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', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.get.metadata['url'] + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore def _create_or_update_initial( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedCluster') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) + if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def create_or_update( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Creates or updates a managed cluster. - Creates or updates a managed cluster with the specified configuration - for agents and Kubernetes version. + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. :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 Create or Update a - Managed Cluster operation. - :type parameters: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.TagsObject(tags=tags) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'TagsObject') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None + 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', response) + deserialized = self._deserialize('ManagedCluster', pipeline_response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - - def update_tags( - self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + 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"] """Updates tags on a managed cluster. Updates a managed cluster with the specified tags. @@ -745,88 +761,110 @@ def update_tags( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ManagedCluster or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: 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: """ - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - tags=tags, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedCluster', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.delete.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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, {}) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore - def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Deletes a managed cluster. Deletes the managed cluster with a specified resource group and name. @@ -835,85 +873,111 @@ def delete( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} - + 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, resource_name, client_id, secret=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedClusterServicePrincipalProfile(client_id=client_id, secret=secret) + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL - url = self.reset_service_principal_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_service_principal_profile( - self, resource_group_name, resource_name, client_id, secret=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset Service Principal Profile of a managed cluster. Update the service principal Profile for a managed cluster. @@ -922,90 +986,115 @@ def reset_service_principal_profile( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param client_id: 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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_service_principal_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - client_id=client_id, - secret=secret, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} - + 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, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + # Construct URL - url = self.reset_aad_profile.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) + 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 if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def reset_aad_profile( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + 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 + + 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] """Reset AAD Profile of a managed cluster. Update the AAD Profile for a managed cluster. @@ -1014,84 +1103,108 @@ def reset_aad_profile( :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 Reset AAD Profile - operation for a Managed Cluster. - :type parameters: - ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAADProfile - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :param parameters: Parameters supplied to the Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._reset_aad_profile_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} - + 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, resource_name, custom_headers=None, raw=False, **operation_config): + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-03-01" + accept = "application/json" + # Construct URL - url = self.rotate_cluster_certificates.metadata['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'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$') + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if cls: + return cls(pipeline_response, None, {}) - def rotate_cluster_certificates( - self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] """Rotate certificates of a managed cluster. Rotate certificates of a managed cluster. @@ -1100,35 +1213,48 @@ def rotate_cluster_certificates( :type resource_group_name: str :param resource_name: The name of the managed cluster resource. :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: """ - raw_result = self._rotate_cluster_certificates_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - custom_headers=custom_headers, - raw=True, - **operation_config + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + 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) + kwargs.pop('content_type', 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 - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} + 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 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 a3f40bf04b0c..c74684c93d65 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 @@ -1,102 +1,109 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] class Operations(object): """Operations operations. - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + 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.v2020_03_01.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2020-03-01". """ models = models def __init__(self, client, config, serializer, deserializer): - self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-01" - - self.config = config + self._config = config def list( - self, custom_headers=None, raw=False, **operation_config): + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationListResult"] """Gets a list of compute operations. - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of OperationValue - :rtype: - ~azure.mgmt.containerservice.v2020_03_01.models.OperationValuePaged[~azure.mgmt.containerservice.v2020_03_01.models.OperationValue] - :raises: :class:`CloudError` + :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] + :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', {})) + 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'] - + url = self.list.metadata['url'] # type: ignore # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) return request - def internal_paging(next_link=None): + 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) - response = self._client.send(request, stream=False, **operation_config) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.OperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return pipeline_response - return deserialized - list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} + 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/v2020_03_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/version.py deleted file mode 100644 index 500c4bb0269d..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2020-03-01" - 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 new file mode 100644 index 000000000000..eb3d7ba7a265 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 new file mode 100644 index 000000000000..24e19acdd8ea --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class 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, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-04-01" + 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 = policies.BearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..c83e263363a5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_container_service_client.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from . import models + + +class ContainerServiceClient(object): + """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 + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize) + + 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/v2020_04_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_metadata.json new file mode 100644 index 000000000000..2c803c051a27 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_metadata.json @@ -0,0 +1,62 @@ +{ + "chosen_version": "2020-04-01", + "total_api_version_list": ["2020-04-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..fb539a3eea08 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2020-04-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..b077ca4268ba --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_container_service_client.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2020_04_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..6cc7d0701ae0 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_04_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2020_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..058c9ea34752 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1239 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_04_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2020_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. **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.v2020_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..46cc1fb7600a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_04_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2020_04_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/__init__.py new file mode 100644 index 000000000000..4361ad6f8d43 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/__init__.py @@ -0,0 +1,189 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import 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 ._container_service_client_enums import ( + AgentPoolMode, + AgentPoolType, + ContainerServiceStorageProfileTypes, + ContainerServiceVMSizeTypes, + Count, + LoadBalancerSku, + ManagedClusterSKUName, + ManagedClusterSKUTier, + NetworkMode, + NetworkPlugin, + NetworkPolicy, + OSType, + OutboundType, + ResourceIdentityType, + ScaleSetEvictionPolicy, + ScaleSetPriority, +) + +__all__ = [ + 'AgentPool', + 'AgentPoolAvailableVersions', + 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', + 'AgentPoolUpgradeProfile', + 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'AgentPoolUpgradeSettings', + 'BaseManagedCluster', + 'CloudErrorBody', + 'ContainerServiceDiagnosticsProfile', + 'ContainerServiceLinuxProfile', + 'ContainerServiceMasterProfile', + 'ContainerServiceNetworkProfile', + 'ContainerServiceSshConfiguration', + 'ContainerServiceSshPublicKey', + 'ContainerServiceVMDiagnostics', + 'CredentialResult', + 'CredentialResults', + 'ManagedCluster', + 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', + 'ManagedClusterAccessProfile', + 'ManagedClusterAddonProfile', + 'ManagedClusterAddonProfileIdentity', + 'ManagedClusterAgentPoolProfile', + 'ManagedClusterAgentPoolProfileProperties', + 'ManagedClusterIdentity', + 'ManagedClusterListResult', + 'ManagedClusterLoadBalancerProfile', + 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', + 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', + 'ManagedClusterLoadBalancerProfileOutboundIPs', + 'ManagedClusterPoolUpgradeProfile', + 'ManagedClusterPoolUpgradeProfileUpgradesItem', + 'ManagedClusterPropertiesAutoScalerProfile', + 'ManagedClusterPropertiesIdentityProfileValue', + 'ManagedClusterSKU', + 'ManagedClusterServicePrincipalProfile', + 'ManagedClusterUpgradeProfile', + 'ManagedClusterWindowsProfile', + 'OperationListResult', + 'OperationValue', + 'Resource', + 'ResourceReference', + 'SubResource', + 'TagsObject', + 'UserAssignedIdentity', + 'AgentPoolMode', + 'AgentPoolType', + 'ContainerServiceStorageProfileTypes', + 'ContainerServiceVMSizeTypes', + 'Count', + 'LoadBalancerSku', + 'ManagedClusterSKUName', + 'ManagedClusterSKUTier', + 'NetworkMode', + 'NetworkPlugin', + 'NetworkPolicy', + 'OSType', + 'OutboundType', + 'ResourceIdentityType', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', +] 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 new file mode 100644 index 000000000000..a1c59e35e778 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_container_service_client_enums.py @@ -0,0 +1,317 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """AgentPoolMode represents mode of an agent pool. + """ + + SYSTEM = "System" + USER = "User" + +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)): + """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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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)): + """Name of a managed cluster SKU. + """ + + BASIC = "Basic" + +class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of a managed cluster SKU. + """ + + PAID = "Paid" + FREE = "Free" + +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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """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)): + """The outbound (egress) routing method. + """ + + LOAD_BALANCER = "loadBalancer" + USER_DEFINED_ROUTING = "userDefinedRouting" + +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 + principal will be used instead. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" + +class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale + set. Default to Delete. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +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" 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 new file mode 100644 index 000000000000..2af7a89045eb --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models.py @@ -0,0 +1,2247 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.UserAssignedIdentity] + """ + + _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': '{UserAssignedIdentity}'}, + } + + 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.UserAssignedIdentity] + :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': '{UserAssignedIdentity}'}, + '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.UserAssignedIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + } + + 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. The administrator username to use for Windows VMs. + :type admin_username: str + :param admin_password: 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': {'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(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 new file mode 100644 index 000000000000..d0f9e7f7eb19 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models_py3.py @@ -0,0 +1,2496 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 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 + :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, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + node_image_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + super(AgentPool, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.vnet_subnet_id = vnet_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.type_properties_type = type_properties_type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.node_image_version = node_image_version + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + 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 + + +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, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): + 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. + + :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, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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: 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, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + latest_node_image_version: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + max_surge: Optional[str] = None, + **kwargs + ): + super(AgentPoolUpgradeSettings, self).__init__(**kwargs) + self.max_surge = max_surge + + +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.UserAssignedIdentity] + """ + + _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': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + **kwargs + ): + super(BaseManagedCluster, self).__init__(**kwargs) + self.identity = identity + self.provisioning_state = None + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn = None + self.private_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.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.network_profile = network_profile + self.aad_profile = aad_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 + + +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, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + 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. + + :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, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): + 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. + + :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, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): + 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. + + :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, + *, + 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 + ): + 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. + + :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, + *, + 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, + **kwargs + ): + 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 + + +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, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): + 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. + + :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, + *, + key_data: str, + **kwargs + ): + 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. + + :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, + *, + enabled: bool, + **kwargs + ): + super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) + self.enabled = 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, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +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.UserAssignedIdentity] + :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': '{UserAssignedIdentity}'}, + '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, + *, + location: str, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + tags: Optional[Dict[str, str]] = None, + sku: Optional["ManagedClusterSKU"] = None, + **kwargs + ): + 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 + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn = None + self.private_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.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.network_profile = network_profile + self.aad_profile = aad_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.sku = sku + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.sku = sku + + +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, + *, + managed: 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 + ): + super(ManagedClusterAADProfile, self).__init__(**kwargs) + self.managed = managed + 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 + :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, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): + 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. + + :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.UserAssignedIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + } + + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ManagedClusterAddonProfile, self).__init__(**kwargs) + self.enabled = enabled + self.config = config + 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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + node_image_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.vnet_subnet_id = vnet_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.type = type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.node_image_version = node_image_version + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + 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 + + +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, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + node_image_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + 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 + + +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, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) + self.authorized_ip_ranges = authorized_ip_ranges + self.enable_private_cluster = enable_private_cluster + + +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, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + **kwargs + ): + super(ManagedClusterIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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, + *, + 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, + **kwargs + ): + 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 + + +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, + *, + count: Optional[int] = 1, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) + self.count = count + + +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, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): + 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. + + :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, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) + self.public_i_ps = public_i_ps + + +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, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): + 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. + + :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, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + balance_similar_node_groups: 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, + max_graceful_termination_sec: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) + self.balance_similar_node_groups = balance_similar_node_groups + 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.max_graceful_termination_sec = max_graceful_termination_sec + + +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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **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, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): + super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) + self.client_id = client_id + self.secret = secret + + +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, + *, + name: Optional[Union[str, "ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, + **kwargs + ): + 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: 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, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): + 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 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: 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': {'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, + *, + admin_username: str, + admin_password: Optional[str] = None, + **kwargs + ): + super(ManagedClusterWindowsProfile, self).__init__(**kwargs) + self.admin_username = admin_username + self.admin_password = admin_password + + +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, + *, + id: Optional[str] = None, + **kwargs + ): + super(ResourceReference, self).__init__(**kwargs) + self.id = id + + +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, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TagsObject, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/__init__.py new file mode 100644 index 000000000000..5aac40228eec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/__init__.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', +] 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 new file mode 100644 index 000000000000..fec6d50d22b1 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_agent_pools_operations.py @@ -0,0 +1,562 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_04_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + agent_pool_name, # type: str + parameters, # type: "models.AgentPool" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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"] + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + 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" + """Gets upgrade profile for an agent pool. + + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. + + :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.v2020_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get_available_agent_pool_versions( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..489799760072 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_managed_clusters_operations.py @@ -0,0 +1,1263 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_04_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def get_upgrade_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + and name. + + :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.v2020_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get_access_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + resource group and name. **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.v2020_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_admin_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_user_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_monitoring_user_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_04_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_04_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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"] + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + 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"] + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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] + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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] + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..258faa472f6f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_04_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.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] + :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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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/v2020_04_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file 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 new file mode 100644 index 000000000000..eb3d7ba7a265 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 new file mode 100644 index 000000000000..516cb1668945 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class 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, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-06-01" + 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 = policies.BearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..deefd69d8aaa --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_container_service_client.py @@ -0,0 +1,84 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .operations import PrivateEndpointConnectionsOperations +from . import models + + +class ContainerServiceClient(object): + """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 + :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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2020_06_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_metadata.json new file mode 100644 index 000000000000..0ab6e6e1ecfa --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_metadata.json @@ -0,0 +1,63 @@ +{ + "chosen_version": "2020-06-01", + "total_api_version_list": ["2020-06-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..b3bb469c1d64 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2020-06-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..867fa5309004 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_container_service_client.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .operations import PrivateEndpointConnectionsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2020_06_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/__init__.py new file mode 100644 index 000000000000..fdbf34a0f841 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', +] 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 new file mode 100644 index 000000000000..a5e073276715 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..c1dd23be4245 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1239 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. **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.v2020_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..bcbeedcbfa93 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/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 new file mode 100644 index 000000000000..1bc316723af7 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,350 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + returns properties of each 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 + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Gets the private endpoint connection. + + Gets the details of the private endpoint connection by managed cluster and resource group. + + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "models.PrivateEndpointConnection", + **kwargs + ) -> "models.PrivateEndpointConnection": + """Updates a private endpoint connection. + + Updates a private endpoint connection 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 private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to the Update a private endpoint connection operation. + :type parameters: ~azure.mgmt.containerservice.v2020_06_01.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.v2020_06_01.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', {})) + 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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 + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. + + Deletes the private endpoint connection 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 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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/v2020_06_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/__init__.py new file mode 100644 index 000000000000..622f72e11912 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/__init__.py @@ -0,0 +1,208 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import 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 ._container_service_client_enums import ( + AgentPoolMode, + AgentPoolType, + ConnectionStatus, + ContainerServiceStorageProfileTypes, + ContainerServiceVMSizeTypes, + Count, + LoadBalancerSku, + ManagedClusterSKUName, + ManagedClusterSKUTier, + NetworkMode, + NetworkPlugin, + NetworkPolicy, + OSType, + OutboundType, + PrivateEndpointConnectionProvisioningState, + ResourceIdentityType, + ScaleSetEvictionPolicy, + ScaleSetPriority, +) + +__all__ = [ + 'AgentPool', + 'AgentPoolAvailableVersions', + 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', + 'AgentPoolUpgradeProfile', + 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'AgentPoolUpgradeSettings', + 'BaseManagedCluster', + 'CloudErrorBody', + 'ContainerServiceDiagnosticsProfile', + 'ContainerServiceLinuxProfile', + 'ContainerServiceMasterProfile', + 'ContainerServiceNetworkProfile', + 'ContainerServiceSshConfiguration', + 'ContainerServiceSshPublicKey', + 'ContainerServiceVMDiagnostics', + 'CredentialResult', + 'CredentialResults', + 'ManagedCluster', + 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', + 'ManagedClusterAccessProfile', + 'ManagedClusterAddonProfile', + 'ManagedClusterAddonProfileIdentity', + 'ManagedClusterAgentPoolProfile', + 'ManagedClusterAgentPoolProfileProperties', + 'ManagedClusterIdentity', + 'ManagedClusterIdentityUserAssignedIdentitiesValue', + 'ManagedClusterListResult', + 'ManagedClusterLoadBalancerProfile', + 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', + 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', + 'ManagedClusterLoadBalancerProfileOutboundIPs', + 'ManagedClusterPoolUpgradeProfile', + 'ManagedClusterPoolUpgradeProfileUpgradesItem', + 'ManagedClusterPropertiesAutoScalerProfile', + 'ManagedClusterPropertiesIdentityProfileValue', + 'ManagedClusterSKU', + 'ManagedClusterServicePrincipalProfile', + 'ManagedClusterUpgradeProfile', + 'ManagedClusterWindowsProfile', + 'OperationListResult', + 'OperationValue', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkServiceConnectionState', + 'Resource', + 'ResourceReference', + 'SubResource', + 'TagsObject', + 'UserAssignedIdentity', + 'AgentPoolMode', + 'AgentPoolType', + 'ConnectionStatus', + 'ContainerServiceStorageProfileTypes', + 'ContainerServiceVMSizeTypes', + 'Count', + 'LoadBalancerSku', + 'ManagedClusterSKUName', + 'ManagedClusterSKUTier', + 'NetworkMode', + 'NetworkPlugin', + 'NetworkPolicy', + 'OSType', + 'OutboundType', + 'PrivateEndpointConnectionProvisioningState', + 'ResourceIdentityType', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', +] 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 new file mode 100644 index 000000000000..8230244dfb78 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_container_service_client_enums.py @@ -0,0 +1,336 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """AgentPoolMode represents mode of an agent pool. + """ + + SYSTEM = "System" + USER = "User" + +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)): + """The private link service connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + +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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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)): + """Name of a managed cluster SKU. + """ + + BASIC = "Basic" + +class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of a managed cluster SKU. + """ + + PAID = "Paid" + FREE = "Free" + +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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """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)): + """The outbound (egress) routing method. + """ + + LOAD_BALANCER = "loadBalancer" + USER_DEFINED_ROUTING = "userDefinedRouting" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +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 + principal will be used instead. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + NONE = "None" + +class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale + set. Default to Delete. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +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" 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 new file mode 100644 index 000000000000..2faf38e1d196 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models.py @@ -0,0 +1,2415 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.UserAssignedIdentity] + """ + + _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': '{UserAssignedIdentity}'}, + } + + 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.UserAssignedIdentity] + :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': '{UserAssignedIdentity}'}, + '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.UserAssignedIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + } + + 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. The administrator username to use for Windows VMs. + :type admin_username: str + :param admin_password: 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': {'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(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 new file mode 100644 index 000000000000..0f5eb551e692 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models_py3.py @@ -0,0 +1,2679 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 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 + :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, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + node_image_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + super(AgentPool, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.vnet_subnet_id = vnet_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.type_properties_type = type_properties_type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.node_image_version = node_image_version + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + 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 + + +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, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): + 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. + + :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, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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: 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, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + latest_node_image_version: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + max_surge: Optional[str] = None, + **kwargs + ): + super(AgentPoolUpgradeSettings, self).__init__(**kwargs) + self.max_surge = max_surge + + +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.UserAssignedIdentity] + """ + + _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': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + **kwargs + ): + super(BaseManagedCluster, self).__init__(**kwargs) + self.identity = identity + self.provisioning_state = None + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn = None + self.private_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.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.network_profile = network_profile + self.aad_profile = aad_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 + + +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, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + 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. + + :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, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): + 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. + + :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, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): + 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. + + :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, + *, + 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 + ): + 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. + + :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, + *, + 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, + **kwargs + ): + 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 + + +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, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): + 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. + + :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, + *, + key_data: str, + **kwargs + ): + 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. + + :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, + *, + enabled: bool, + **kwargs + ): + super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) + self.enabled = 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, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +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.UserAssignedIdentity] + :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': '{UserAssignedIdentity}'}, + '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, + *, + location: str, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + tags: Optional[Dict[str, str]] = None, + sku: Optional["ManagedClusterSKU"] = None, + **kwargs + ): + 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 + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn = None + self.private_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.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.network_profile = network_profile + self.aad_profile = aad_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.sku = sku + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.sku = sku + + +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, + *, + 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 + ): + 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 + :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, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): + 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. + + :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.UserAssignedIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + } + + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ManagedClusterAddonProfile, self).__init__(**kwargs) + self.enabled = enabled + self.config = config + 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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + node_image_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.vnet_subnet_id = vnet_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.type = type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.node_image_version = node_image_version + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + 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 + + +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, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + node_image_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + 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 + + +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, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) + self.authorized_ip_ranges = authorized_ip_ranges + self.enable_private_cluster = enable_private_cluster + + +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, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ManagedClusterIdentityUserAssignedIdentitiesValue"]] = None, + **kwargs + ): + super(ManagedClusterIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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, + *, + 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, + **kwargs + ): + 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 + + +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, + *, + count: Optional[int] = 1, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) + self.count = count + + +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, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): + 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. + + :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, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) + self.public_i_ps = public_i_ps + + +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, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): + 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. + + :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, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + balance_similar_node_groups: 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, + max_graceful_termination_sec: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) + self.balance_similar_node_groups = balance_similar_node_groups + 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.max_graceful_termination_sec = max_graceful_termination_sec + + +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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **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, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): + super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) + self.client_id = client_id + self.secret = secret + + +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, + *, + name: Optional[Union[str, "ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, + **kwargs + ): + 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: 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, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): + 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 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: 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': {'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, + *, + admin_username: str, + admin_password: Optional[str] = None, + **kwargs + ): + super(ManagedClusterWindowsProfile, self).__init__(**kwargs) + self.admin_username = admin_username + self.admin_password = admin_password + + +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, + *, + id: Optional[str] = None, + **kwargs + ): + 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.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, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + 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. + + :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, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +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, + *, + status: Optional[Union[str, "ConnectionStatus"]] = None, + description: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + + +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, + *, + id: Optional[str] = None, + **kwargs + ): + super(ResourceReference, self).__init__(**kwargs) + self.id = id + + +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, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TagsObject, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/__init__.py new file mode 100644 index 000000000000..fdbf34a0f841 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', +] 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 new file mode 100644 index 000000000000..18c0831b9663 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_agent_pools_operations.py @@ -0,0 +1,562 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + agent_pool_name, # type: str + parameters, # type: "models.AgentPool" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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"] + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + 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" + """Gets upgrade profile for an agent pool. + + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. + + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get_available_agent_pool_versions( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 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 new file mode 100644 index 000000000000..67741b48bac0 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_managed_clusters_operations.py @@ -0,0 +1,1263 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def get_upgrade_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + and name. + + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get_access_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + resource group and name. **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.v2020_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_admin_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_user_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_monitoring_user_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_06_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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"] + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + 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"] + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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] + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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] + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..c2a121a02cc1 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.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] + :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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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/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 new file mode 100644 index 000000000000..7c91f8c41b26 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,359 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + returns properties of each 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 + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Gets the private endpoint connection. + + Gets the details of the private endpoint connection by managed cluster and resource group. + + :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.v2020_06_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + 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" + """Updates a private endpoint connection. + + Updates a private endpoint connection 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 private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to the Update a private endpoint connection operation. + :type parameters: ~azure.mgmt.containerservice.v2020_06_01.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.v2020_06_01.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', {})) + 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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 + + 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] + """Deletes a private endpoint connection. + + Deletes the private endpoint connection 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 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + 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) + kwargs.pop('content_type', 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/v2020_06_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file 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 new file mode 100644 index 000000000000..eb3d7ba7a265 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 new file mode 100644 index 000000000000..a23663709ad8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class 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, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-07-01" + 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 = policies.BearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..4277e63c8d66 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_container_service_client.py @@ -0,0 +1,84 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .operations import PrivateEndpointConnectionsOperations +from . import models + + +class ContainerServiceClient(object): + """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 + :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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2020_07_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_metadata.json new file mode 100644 index 000000000000..7c54aff24646 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_metadata.json @@ -0,0 +1,63 @@ +{ + "chosen_version": "2020-07-01", + "total_api_version_list": ["2020-07-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..efc93159e68c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2020-07-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..baff96083b54 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_container_service_client.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import AgentPoolsOperations +from .operations import PrivateEndpointConnectionsOperations +from .. import models + + +class ContainerServiceClient(object): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2020_07_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/__init__.py new file mode 100644 index 000000000000..fdbf34a0f841 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', +] 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 new file mode 100644 index 000000000000..492644127475 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,668 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + 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 + + async def begin_upgrade_node_image_version( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Upgrade node image version of an agent pool to the latest. + + Upgrade node image version of an agent pool to the latest. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["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) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_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_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 new file mode 100644 index 000000000000..505a0d98fd00 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1239 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. **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.v2020_07_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_07_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_07_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_07_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..9f5c672b1476 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/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 new file mode 100644 index 000000000000..c1169afc8d81 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,350 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + returns properties of each 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 + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Gets the private endpoint connection. + + Gets the details of the private endpoint connection by managed cluster and resource group. + + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "models.PrivateEndpointConnection", + **kwargs + ) -> "models.PrivateEndpointConnection": + """Updates a private endpoint connection. + + Updates a private endpoint connection 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 private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to the Update a private endpoint connection operation. + :type parameters: ~azure.mgmt.containerservice.v2020_07_01.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.v2020_07_01.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', {})) + 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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 + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. + + Deletes the private endpoint connection 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 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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/v2020_07_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/__init__.py new file mode 100644 index 000000000000..7e013a7f822d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/__init__.py @@ -0,0 +1,210 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import 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 ._container_service_client_enums import ( + AgentPoolMode, + AgentPoolType, + ConnectionStatus, + ContainerServiceStorageProfileTypes, + ContainerServiceVMSizeTypes, + Count, + LicenseType, + LoadBalancerSku, + ManagedClusterSKUName, + ManagedClusterSKUTier, + NetworkMode, + NetworkPlugin, + NetworkPolicy, + OSType, + OutboundType, + PrivateEndpointConnectionProvisioningState, + ResourceIdentityType, + ScaleSetEvictionPolicy, + ScaleSetPriority, +) + +__all__ = [ + 'AgentPool', + 'AgentPoolAvailableVersions', + 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', + 'AgentPoolUpgradeProfile', + 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'AgentPoolUpgradeSettings', + 'BaseManagedCluster', + 'CloudErrorBody', + 'ContainerServiceDiagnosticsProfile', + 'ContainerServiceLinuxProfile', + 'ContainerServiceMasterProfile', + 'ContainerServiceNetworkProfile', + 'ContainerServiceSshConfiguration', + 'ContainerServiceSshPublicKey', + 'ContainerServiceVMDiagnostics', + 'CredentialResult', + 'CredentialResults', + 'ManagedCluster', + 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', + 'ManagedClusterAccessProfile', + 'ManagedClusterAddonProfile', + 'ManagedClusterAddonProfileIdentity', + 'ManagedClusterAgentPoolProfile', + 'ManagedClusterAgentPoolProfileProperties', + 'ManagedClusterIdentity', + 'ManagedClusterIdentityUserAssignedIdentitiesValue', + 'ManagedClusterListResult', + 'ManagedClusterLoadBalancerProfile', + 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', + 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', + 'ManagedClusterLoadBalancerProfileOutboundIPs', + 'ManagedClusterPoolUpgradeProfile', + 'ManagedClusterPoolUpgradeProfileUpgradesItem', + 'ManagedClusterPropertiesAutoScalerProfile', + 'ManagedClusterPropertiesIdentityProfileValue', + 'ManagedClusterSKU', + 'ManagedClusterServicePrincipalProfile', + 'ManagedClusterUpgradeProfile', + 'ManagedClusterWindowsProfile', + 'OperationListResult', + 'OperationValue', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkServiceConnectionState', + 'Resource', + 'ResourceReference', + 'SubResource', + 'TagsObject', + 'UserAssignedIdentity', + 'AgentPoolMode', + 'AgentPoolType', + 'ConnectionStatus', + 'ContainerServiceStorageProfileTypes', + 'ContainerServiceVMSizeTypes', + 'Count', + 'LicenseType', + 'LoadBalancerSku', + 'ManagedClusterSKUName', + 'ManagedClusterSKUTier', + 'NetworkMode', + 'NetworkPlugin', + 'NetworkPolicy', + 'OSType', + 'OutboundType', + 'PrivateEndpointConnectionProvisioningState', + 'ResourceIdentityType', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', +] 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 new file mode 100644 index 000000000000..fc37a592f4a7 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_container_service_client_enums.py @@ -0,0 +1,344 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """AgentPoolMode represents mode of an agent pool. + """ + + SYSTEM = "System" + USER = "User" + +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)): + """The private link service connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + +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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 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. + """ + + NONE = "None" + WINDOWS_SERVER = "Windows_Server" + +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)): + """Name of a managed cluster SKU. + """ + + BASIC = "Basic" + +class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of a managed cluster SKU. + """ + + PAID = "Paid" + FREE = "Free" + +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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """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)): + """The outbound (egress) routing method. + """ + + LOAD_BALANCER = "loadBalancer" + USER_DEFINED_ROUTING = "userDefinedRouting" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +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 + principal will be used instead. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + NONE = "None" + +class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale + set. Default to Delete. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +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" 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 new file mode 100644 index 000000000000..31af0fe4b2ac --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models.py @@ -0,0 +1,2423 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.UserAssignedIdentity] + """ + + _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': '{UserAssignedIdentity}'}, + } + + 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.UserAssignedIdentity] + :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': '{UserAssignedIdentity}'}, + '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.UserAssignedIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + } + + 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. The administrator username to use for Windows VMs. + :type admin_username: str + :param admin_password: The administrator password to use for Windows VMs. + :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, 'pattern': r'^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$'}, + 'admin_password': {'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'}, + '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 new file mode 100644 index 000000000000..0f28f5436350 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models_py3.py @@ -0,0 +1,2685 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 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 + :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, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = 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, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + super(AgentPool, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.vnet_subnet_id = vnet_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + 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.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + 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 + + +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, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): + 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. + + :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, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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: 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, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + latest_node_image_version: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + max_surge: Optional[str] = None, + **kwargs + ): + super(AgentPoolUpgradeSettings, self).__init__(**kwargs) + self.max_surge = max_surge + + +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.UserAssignedIdentity] + """ + + _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': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + **kwargs + ): + super(BaseManagedCluster, self).__init__(**kwargs) + self.identity = identity + self.provisioning_state = None + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn = None + self.private_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.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.network_profile = network_profile + self.aad_profile = aad_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 + + +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, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + 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. + + :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, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): + 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. + + :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, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): + 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. + + :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, + *, + 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 + ): + 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. + + :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, + *, + 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, + **kwargs + ): + 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 + + +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, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): + 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. + + :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, + *, + key_data: str, + **kwargs + ): + 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. + + :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, + *, + enabled: bool, + **kwargs + ): + super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) + self.enabled = 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, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +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.UserAssignedIdentity] + :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': '{UserAssignedIdentity}'}, + '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, + *, + location: str, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + tags: Optional[Dict[str, str]] = None, + sku: Optional["ManagedClusterSKU"] = None, + **kwargs + ): + 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 + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn = None + self.private_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.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.network_profile = network_profile + self.aad_profile = aad_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.sku = sku + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.sku = sku + + +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, + *, + 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 + ): + 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 + :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, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): + 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. + + :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.UserAssignedIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + } + + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ManagedClusterAddonProfile, self).__init__(**kwargs) + self.enabled = enabled + self.config = config + 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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.vnet_subnet_id = vnet_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + 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.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + 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 + + +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, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + 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 + + +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, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) + self.authorized_ip_ranges = authorized_ip_ranges + self.enable_private_cluster = enable_private_cluster + + +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, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ManagedClusterIdentityUserAssignedIdentitiesValue"]] = None, + **kwargs + ): + super(ManagedClusterIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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, + *, + 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, + **kwargs + ): + 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 + + +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, + *, + count: Optional[int] = 1, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) + self.count = count + + +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, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): + 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. + + :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, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) + self.public_i_ps = public_i_ps + + +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, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): + 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. + + :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, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + balance_similar_node_groups: 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, + max_graceful_termination_sec: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) + self.balance_similar_node_groups = balance_similar_node_groups + 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.max_graceful_termination_sec = max_graceful_termination_sec + + +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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **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, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): + super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) + self.client_id = client_id + self.secret = secret + + +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, + *, + name: Optional[Union[str, "ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, + **kwargs + ): + 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: 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, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): + 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 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: The administrator password to use for Windows VMs. + :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, 'pattern': r'^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$'}, + 'admin_password': {'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'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + } + + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + license_type: Optional[Union[str, "LicenseType"]] = None, + **kwargs + ): + super(ManagedClusterWindowsProfile, self).__init__(**kwargs) + self.admin_username = admin_username + self.admin_password = admin_password + self.license_type = license_type + + +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, + *, + id: Optional[str] = None, + **kwargs + ): + 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.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, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + 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. + + :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, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +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, + *, + status: Optional[Union[str, "ConnectionStatus"]] = None, + description: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + + +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, + *, + id: Optional[str] = None, + **kwargs + ): + super(ResourceReference, self).__init__(**kwargs) + self.id = id + + +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, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TagsObject, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/__init__.py new file mode 100644 index 000000000000..fdbf34a0f841 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._agent_pools_operations import AgentPoolsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', +] 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 new file mode 100644 index 000000000000..6538ddee305a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py @@ -0,0 +1,682 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + agent_pool_name, # type: str + parameters, # type: "models.AgentPool" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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"] + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + 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" + """Gets upgrade profile for an agent pool. + + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. + + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get_available_agent_pool_versions( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + 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 + + 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"] + """Upgrade node image version of an agent pool to the latest. + + Upgrade node image version of an agent pool to the latest. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["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) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_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_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 new file mode 100644 index 000000000000..2f0582659e4d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py @@ -0,0 +1,1263 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def get_upgrade_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + and name. + + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get_access_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + resource group and name. **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.v2020_07_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_admin_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_07_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_user_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_07_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_monitoring_user_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_07_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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"] + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + 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"] + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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] + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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] + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._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) + kwargs.pop('content_type', 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 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 new file mode 100644 index 000000000000..c9ea825a78d3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.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] + :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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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/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 new file mode 100644 index 000000000000..133c92bae2a1 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,359 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + returns properties of each 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 + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Gets the private endpoint connection. + + Gets the details of the private endpoint connection by managed cluster and resource group. + + :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.v2020_07_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + 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" + """Updates a private endpoint connection. + + Updates a private endpoint connection 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 private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to the Update a private endpoint connection operation. + :type parameters: ~azure.mgmt.containerservice.v2020_07_01.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.v2020_07_01.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', {})) + 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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 + + 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] + """Deletes a private endpoint connection. + + Deletes the private endpoint connection 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 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + 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) + kwargs.pop('content_type', 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/v2020_07_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file 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 new file mode 100644 index 000000000000..eb3d7ba7a265 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass 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 new file mode 100644 index 000000000000..7016f7e6774d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class 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, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-09-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-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 = policies.BearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..e84f66a46838 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_container_service_client.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import 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): + """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 + :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 + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2020_09_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_metadata.json new file mode 100644 index 000000000000..4b2c8574dcc9 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_metadata.json @@ -0,0 +1,65 @@ +{ + "chosen_version": "2020-09-01", + "total_api_version_list": ["2020-09-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "method_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_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "method_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 + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "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 + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "agent_pools": "AgentPoolsOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "resolve_private_link_service_id": "ResolvePrivateLinkServiceIdOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] 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 new file mode 100644 index 000000000000..b36a0a9aed17 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class 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: + 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 + self.api_version = "2020-09-01" + 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 = policies.AsyncBearerTokenCredentialPolicy(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 new file mode 100644 index 000000000000..612c5b8f3ae5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_container_service_client.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import 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): + """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 + :ivar agent_pools: AgentPoolsOperations operations + :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 + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :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 + :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 str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.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 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/v2020_09_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/__init__.py new file mode 100644 index 000000000000..653c03870023 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._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 + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ResolvePrivateLinkServiceIdOperations', +] 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 new file mode 100644 index 000000000000..ff7ba763091d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,668 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> 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. The operation returns properties + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "models.AgentPool": + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "models.AgentPool", + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> "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 + managed cluster name. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.AgentPoolAvailableVersions": + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + 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 + + async def begin_upgrade_node_image_version( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs + ) -> AsyncLROPoller["models.AgentPool"]: + """Upgrade node image version of an agent pool to the latest. + + Upgrade node image version of an agent pool to the latest. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["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) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_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_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 new file mode 100644 index 000000000000..8b88e175a997 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1447 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs + ) -> "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 + resource group and name. **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.v2020_09_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_09_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_09_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_09_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "models.ManagedCluster": + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedCluster", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.TagsObject", + **kwargs + ) -> AsyncLROPoller["models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterServicePrincipalProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.ManagedClusterAADProfile", + **kwargs + ) -> AsyncLROPoller[None]: + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._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) + kwargs.pop('content_type', 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_stop( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Stop Managed Cluster. + + Stops a Running 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 + ) -> None: + cls = 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + async def begin_start( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Start Managed Cluster. + + Starts a Stopped 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 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 new file mode 100644 index 000000000000..e00874700a49 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> AsyncIterable["models.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.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"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('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/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 new file mode 100644 index 000000000000..ca3aa92ea157 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,350 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + returns properties of each 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 + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def get( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "models.PrivateEndpointConnection": + """Gets the private endpoint connection. + + Gets the details of the private endpoint connection by managed cluster and resource group. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "models.PrivateEndpointConnection", + **kwargs + ) -> "models.PrivateEndpointConnection": + """Updates a private endpoint connection. + + Updates a private endpoint connection 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 private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to the Update a private endpoint connection operation. + :type parameters: ~azure.mgmt.containerservice.v2020_09_01.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.v2020_09_01.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', {})) + 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + ) -> None: + cls = 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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 + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. + + Deletes the private endpoint connection 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 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + 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) + kwargs.pop('content_type', 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/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 new file mode 100644 index 000000000000..2030335164eb --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs + ) -> "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 + properties of each private link resource. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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/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 new file mode 100644 index 000000000000..f233208498c0 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: "models.PrivateLinkResource", + **kwargs + ) -> "models.PrivateLinkResource": + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID 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 (name, groupId) supplied in order to resolve a private link + service ID. + :type parameters: ~azure.mgmt.containerservice.v2020_09_01.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.v2020_09_01.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', {})) + 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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/v2020_09_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/__init__.py new file mode 100644 index 000000000000..46fd65fb15c2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/__init__.py @@ -0,0 +1,225 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import 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 ._container_service_client_enums import ( + AgentPoolMode, + AgentPoolType, + Code, + ConnectionStatus, + ContainerServiceStorageProfileTypes, + ContainerServiceVMSizeTypes, + Count, + Expander, + LicenseType, + LoadBalancerSku, + ManagedClusterSKUName, + ManagedClusterSKUTier, + NetworkMode, + NetworkPlugin, + NetworkPolicy, + OSDiskType, + OSType, + OutboundType, + PrivateEndpointConnectionProvisioningState, + ResourceIdentityType, + ScaleSetEvictionPolicy, + ScaleSetPriority, +) + +__all__ = [ + 'AgentPool', + 'AgentPoolAvailableVersions', + 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', + 'AgentPoolUpgradeProfile', + 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'AgentPoolUpgradeSettings', + 'BaseManagedCluster', + 'CloudErrorBody', + 'ContainerServiceDiagnosticsProfile', + 'ContainerServiceLinuxProfile', + 'ContainerServiceMasterProfile', + 'ContainerServiceNetworkProfile', + 'ContainerServiceSshConfiguration', + 'ContainerServiceSshPublicKey', + 'ContainerServiceVMDiagnostics', + 'CredentialResult', + 'CredentialResults', + 'ManagedCluster', + 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', + 'ManagedClusterAccessProfile', + 'ManagedClusterAddonProfile', + 'ManagedClusterAddonProfileIdentity', + 'ManagedClusterAgentPoolProfile', + 'ManagedClusterAgentPoolProfileProperties', + 'ManagedClusterIdentity', + 'ManagedClusterIdentityUserAssignedIdentitiesValue', + 'ManagedClusterListResult', + 'ManagedClusterLoadBalancerProfile', + 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', + 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', + 'ManagedClusterLoadBalancerProfileOutboundIPs', + 'ManagedClusterPoolUpgradeProfile', + 'ManagedClusterPoolUpgradeProfileUpgradesItem', + 'ManagedClusterPropertiesAutoScalerProfile', + 'ManagedClusterPropertiesIdentityProfileValue', + 'ManagedClusterSKU', + 'ManagedClusterServicePrincipalProfile', + 'ManagedClusterUpgradeProfile', + 'ManagedClusterWindowsProfile', + 'OperationListResult', + 'OperationValue', + 'PowerState', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourcesListResult', + 'PrivateLinkServiceConnectionState', + 'Resource', + 'ResourceReference', + 'SubResource', + 'TagsObject', + 'UserAssignedIdentity', + 'AgentPoolMode', + 'AgentPoolType', + 'Code', + 'ConnectionStatus', + 'ContainerServiceStorageProfileTypes', + 'ContainerServiceVMSizeTypes', + 'Count', + 'Expander', + 'LicenseType', + 'LoadBalancerSku', + 'ManagedClusterSKUName', + 'ManagedClusterSKUTier', + 'NetworkMode', + 'NetworkPlugin', + 'NetworkPolicy', + 'OSDiskType', + 'OSType', + 'OutboundType', + 'PrivateEndpointConnectionProvisioningState', + 'ResourceIdentityType', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', +] 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 new file mode 100644 index 000000000000..27ed4c7406fd --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_container_service_client_enums.py @@ -0,0 +1,364 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """AgentPoolMode represents mode of an agent pool. + """ + + SYSTEM = "System" + USER = "User" + +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)): + """Tells whether the cluster is Running or Stopped + """ + + RUNNING = "Running" + 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)): + """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. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. + """ + + 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 Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + LEAST_WASTE = "least-waste" + MOST_PODS = "most-pods" + RANDOM = "random" + +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. + """ + + NONE = "None" + WINDOWS_SERVER = "Windows_Server" + +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)): + """Name of a managed cluster SKU. + """ + + BASIC = "Basic" + +class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tier of a managed cluster SKU. + """ + + PAID = "Paid" + FREE = "Free" + +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)): + """Network plugin used for building Kubernetes network. + """ + + AZURE = "azure" + KUBENET = "kubenet" + +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)): + """OSDiskType represents the type of an OS disk on an agent pool. + """ + + MANAGED = "Managed" + EPHEMERAL = "Ephemeral" + +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)): + """The outbound (egress) routing method. + """ + + LOAD_BALANCER = "loadBalancer" + USER_DEFINED_ROUTING = "userDefinedRouting" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +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 + principal will be used instead. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + NONE = "None" + +class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale + set. Default to Delete. + """ + + DELETE = "Delete" + DEALLOCATE = "Deallocate" + +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" 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 new file mode 100644 index 000000000000..835ad628c3a7 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models.py @@ -0,0 +1,2577 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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.UserAssignedIdentity] + """ + + _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': '{UserAssignedIdentity}'}, + } + + 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.UserAssignedIdentity] + :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': '{UserAssignedIdentity}'}, + '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.UserAssignedIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + } + + 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. The administrator username to use for Windows VMs. + :type admin_username: str + :param admin_password: The administrator password to use for Windows VMs. + :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, 'pattern': r'^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$'}, + 'admin_password': {'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'}, + '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 new file mode 100644 index 000000000000..4474cf562f64 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models_py3.py @@ -0,0 +1,2859 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 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 + :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, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = 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, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + 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.vnet_subnet_id = vnet_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + 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 = None + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + 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 + + +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, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): + 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. + + :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, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + 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: 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, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + latest_node_image_version: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + max_surge: Optional[str] = None, + **kwargs + ): + super(AgentPoolUpgradeSettings, self).__init__(**kwargs) + self.max_surge = max_surge + + +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.UserAssignedIdentity] + """ + + _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': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + **kwargs + ): + super(BaseManagedCluster, self).__init__(**kwargs) + self.identity = identity + self.provisioning_state = None + self.power_state = None + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn = None + self.private_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.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.network_profile = network_profile + self.aad_profile = aad_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 + + +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, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + 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. + + :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, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): + 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. + + :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, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): + 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. + + :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, + *, + 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 + ): + 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. + + :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, + *, + 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, + **kwargs + ): + 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 + + +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, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): + 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. + + :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, + *, + key_data: str, + **kwargs + ): + 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. + + :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, + *, + enabled: bool, + **kwargs + ): + super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) + self.enabled = 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, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +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.UserAssignedIdentity] + :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': '{UserAssignedIdentity}'}, + '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, + *, + location: str, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: 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, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = 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, + tags: Optional[Dict[str, str]] = None, + sku: Optional["ManagedClusterSKU"] = None, + **kwargs + ): + 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 + self.power_state = None + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn = None + self.private_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.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.network_profile = network_profile + self.aad_profile = aad_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.sku = sku + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.sku = sku + + +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, + *, + 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 + ): + 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 + :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, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): + 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. + + :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.UserAssignedIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + } + + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ManagedClusterAddonProfile, self).__init__(**kwargs) + self.enabled = enabled + self.config = config + 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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + 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. + + :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, + *, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + 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.vnet_subnet_id = vnet_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + 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 = None + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + 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 + + +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, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[Union[str, "ContainerServiceVMSizeTypes"]] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + vnet_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = 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, + **kwargs + ): + 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 + + +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, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) + self.authorized_ip_ranges = authorized_ip_ranges + self.enable_private_cluster = enable_private_cluster + + +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, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ManagedClusterIdentityUserAssignedIdentitiesValue"]] = None, + **kwargs + ): + super(ManagedClusterIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +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, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + 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, + *, + 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, + **kwargs + ): + 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 + + +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, + *, + count: Optional[int] = 1, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) + self.count = count + + +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, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): + 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. + + :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, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) + self.public_i_ps = public_i_ps + + +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, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): + 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. + + :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, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + 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. + + :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, + *, + 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_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 + ): + 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_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 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, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPropertiesIdentityProfileValue, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **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, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): + super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) + self.client_id = client_id + self.secret = secret + + +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, + *, + name: Optional[Union[str, "ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, + **kwargs + ): + 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: 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, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): + 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 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: The administrator password to use for Windows VMs. + :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, 'pattern': r'^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$'}, + 'admin_password': {'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'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + } + + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + license_type: Optional[Union[str, "LicenseType"]] = None, + **kwargs + ): + super(ManagedClusterWindowsProfile, self).__init__(**kwargs) + self.admin_username = admin_username + self.admin_password = admin_password + self.license_type = license_type + + +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, + *, + code: Optional[Union[str, "Code"]] = None, + **kwargs + ): + super(PowerState, self).__init__(**kwargs) + self.code = code + + +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, + *, + id: Optional[str] = None, + **kwargs + ): + 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.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, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + 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. + + :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, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + 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. + + :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, + *, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + group_id: Optional[str] = None, + required_members: Optional[List[str]] = None, + **kwargs + ): + 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. + + :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, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = value + + +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, + *, + status: Optional[Union[str, "ConnectionStatus"]] = None, + description: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + + +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, + *, + id: Optional[str] = None, + **kwargs + ): + super(ResourceReference, self).__init__(**kwargs) + self.id = id + + +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, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TagsObject, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/__init__.py new file mode 100644 index 000000000000..653c03870023 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 ._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 + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ResolvePrivateLinkServiceIdOperations', +] 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 new file mode 100644 index 000000000000..41fdc2dbcf5f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py @@ -0,0 +1,682 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 + of each 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 + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPool" + """Gets the agent pool. + + Gets the details of the agent pool by managed cluster and resource group. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + agent_pool_name, # type: str + parameters, # type: "models.AgentPool" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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"] + """Creates or updates an agent pool. + + 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: Parameters supplied to the Create or Update an agent pool operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an agent pool. + + Deletes the 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + 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) + kwargs.pop('content_type', 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 + + 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" + """Gets upgrade profile for an agent pool. + + Gets the details of the upgrade profile for an agent pool with a specified resource group and + managed cluster name. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get_available_agent_pool_versions( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AgentPoolAvailableVersions" + """Gets a list of supported versions for the specified agent pool. + + Gets a list of supported versions for the specified 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 + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + 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 + + 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"] + """Upgrade node image version of an agent pool to the latest. + + Upgrade node image version of an agent pool to the latest. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["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) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_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_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 new file mode 100644 index 000000000000..a99d6d722925 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_managed_clusters_operations.py @@ -0,0 +1,1475 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.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] + :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', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 + properties of each managed cluster. + + :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] + :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', {})) + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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 + + def get_upgrade_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + and name. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get_access_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + resource group and name. **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.v2020_09_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_admin_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_09_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_user_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_09_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def list_cluster_monitoring_user_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + and name. + + :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: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2020_09_01.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', {})) + 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedCluster" + """Gets a managed cluster. + + Gets the details of the managed cluster with a specified resource group and name. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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"] + """Creates or updates a managed cluster. + + Creates or updates a managed cluster with the specified configuration for agents and Kubernetes + version. + + :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 Create or Update a Managed Cluster operation. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + parameters, # type: "models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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 + + 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"] + """Updates tags on a managed cluster. + + Updates a managed cluster with the specified tags. + + :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.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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('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, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a managed cluster. + + Deletes the managed cluster with a specified resource group and name. + + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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] + """Reset Service Principal Profile of a managed cluster. + + Update the service principal Profile for 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 Reset Service Principal Profile operation for a + Managed Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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, # type: str + resource_name, # type: str + parameters, # type: "models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + 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 + + 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] + """Reset AAD Profile of a managed cluster. + + Update the AAD Profile for 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 Reset AAD Profile operation for a Managed + Cluster. + :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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + 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, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Rotate certificates of a managed cluster. + + Rotate certificates 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 + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._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) + kwargs.pop('content_type', 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, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + def begin_stop( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Stop Managed Cluster. + + Stops a Running 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [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 + + def begin_start( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Start Managed Cluster. + + Starts a Stopped 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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 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 new file mode 100644 index 000000000000..46657665ef4d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.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] + :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', {})) + api_version = "2020-09-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('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/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 new file mode 100644 index 000000000000..d3696b7491a3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,359 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + returns properties of each 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 + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateEndpointConnection" + """Gets the private endpoint connection. + + Gets the details of the private endpoint connection by managed cluster and resource group. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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 + + 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" + """Updates a private endpoint connection. + + Updates a private endpoint connection 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 private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to the Update a private endpoint connection operation. + :type parameters: ~azure.mgmt.containerservice.v2020_09_01.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.v2020_09_01.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', {})) + 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 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 + + 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] + """Deletes a private endpoint connection. + + Deletes the private endpoint connection 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 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: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + 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) + kwargs.pop('content_type', 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/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 new file mode 100644 index 000000000000..934956126777 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_link_resources_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "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 + properties of each private link resource. + + :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.v2020_09_01.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', {})) + 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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('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/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 new file mode 100644 index 000000000000..a775fa210ec1 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.v2020_09_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def post( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "models.PrivateLinkResource" + **kwargs # type: Any + ): + # type: (...) -> "models.PrivateLinkResource" + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID 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 (name, groupId) supplied in order to resolve a private link + service ID. + :type parameters: ~azure.mgmt.containerservice.v2020_09_01.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.v2020_09_01.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', {})) + 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, '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 + + if response.status_code not in [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/v2020_09_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/setup.py b/sdk/containerservice/azure-mgmt-containerservice/setup.py index 628c0a2ab545..8b923784e481 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/setup.py +++ b/sdk/containerservice/azure-mgmt-containerservice/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)