From 4d7a6dc8ba05e827af56ab45c57d8cacfc2faa4a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 9 Sep 2021 02:52:56 +0000 Subject: [PATCH] CodeGen from PR 15954 in Azure/azure-rest-api-specs Merge Dev-containerservice-microsoft.containerservice-2021-08-01 branch to main (#15954) * Adds base for updating Microsoft.ContainerService from version stable/2021-07-01 to version 2021-08-01 * Updates readme * Updates API version in new specs and examples * add publicNetworkAccess property per network platform's request (#15489) * add publicNetworkAccess per network platform's request * fix quota Co-authored-by: Li Ma * update readme for 2021-08-01 sdk generation (#15476) * update readme for sdk generation * update readme for sdk generation Co-authored-by: Charlie Li * allow disabling of runcommand (#15481) * allow disabling of runcommand * rename file * another rename * fix prittier check * fix stupid prettier check * change publicNetworkAccess to enum (#15564) Co-authored-by: Li Ma * Add CreationData property to Agentpool level in 2021-08-01 API (#15563) * Add CreationData property to Agentpool level in 2021-08-01 API * fix json format * fix swagger spell check Co-authored-by: Charlie Li * chore: add enableMultipleStandardLoadBalancers to loadBalancerProfile (#15579) * Add snapshot related new APIs and properties to AKS 2021-08-01 swagger (#15586) * Add CreationData property to Agentpool level in 2021-08-01 API * Add snapshot related APIs and properties to AKS 2021-08-01 swagger * fix lint and spell checks * fix lint and spell checks * fix PrettierCheck * Change some Nodepool to NodePool * some changes according to ARM team's review comments Co-authored-by: Charlie Li * fix tag typo to match tag convention (#15683) * add workload runtime to agent pool api (#15726) * add workload runtime to agent pool api * reference example * add custom words * fix: workload runtime description (#15782) * fix: workload runtime description * add wasmtime to custom words * clarify single workload type per node Co-authored-by: Matthew Christopher Co-authored-by: Matthew Christopher * fix typo in readme.python.md (#15903) * Add CreationData property to Agentpool level in 2021-08-01 API * fix typos in readme.python.md Co-authored-by: Charlie Li * merge recent custom-words.txt changes from main branch to resolve conflicts (#15938) * Add CreationData property to Agentpool level in 2021-08-01 API * merge recent custom-words.txt changes from main branch to resolve conflicts Co-authored-by: Charlie Li * pull custom-words.txt from main * add a new word - NodePool * add two more words Co-authored-by: Super Co-authored-by: Li Ma Co-authored-by: Charlie Li Co-authored-by: Haitao Chen Co-authored-by: Qi Ni Co-authored-by: Ariel Silverman Co-authored-by: Ace Eldeib Co-authored-by: Matthew Christopher --- .../azure-mgmt-containerservice/_meta.json | 2 +- .../_container_service_client.py | 40 +- .../aio/_container_service_client.py | 40 +- .../azure/mgmt/containerservice/models.py | 2 +- .../containerservice/v2021_08_01/__init__.py | 16 + .../v2021_08_01/_configuration.py | 70 + .../v2021_08_01/_container_service_client.py | 124 + .../v2021_08_01/_metadata.json | 110 + .../v2021_08_01/aio/__init__.py | 10 + .../v2021_08_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 117 + .../v2021_08_01/aio/operations/__init__.py | 27 + .../aio/operations/_agent_pools_operations.py | 691 +++ .../_maintenance_configurations_operations.py | 315 ++ .../_managed_clusters_operations.py | 1842 +++++++ .../v2021_08_01/aio/operations/_operations.py | 106 + ...private_endpoint_connections_operations.py | 358 ++ .../_private_link_resources_operations.py | 102 + ...olve_private_link_service_id_operations.py | 109 + .../aio/operations/_snapshots_operations.py | 439 ++ .../v2021_08_01/models/__init__.py | 339 ++ .../models/_container_service_client_enums.py | 584 +++ .../v2021_08_01/models/_models.py | 3826 +++++++++++++++ .../v2021_08_01/models/_models_py3.py | 4281 +++++++++++++++++ .../v2021_08_01/operations/__init__.py | 27 + .../operations/_agent_pools_operations.py | 705 +++ .../_maintenance_configurations_operations.py | 323 ++ .../_managed_clusters_operations.py | 1875 ++++++++ .../v2021_08_01/operations/_operations.py | 111 + ...private_endpoint_connections_operations.py | 367 ++ .../_private_link_resources_operations.py | 107 + ...olve_private_link_service_id_operations.py | 114 + .../operations/_snapshots_operations.py | 449 ++ .../containerservice/v2021_08_01/py.typed | 1 + 34 files changed, 17691 insertions(+), 4 deletions(-) create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/py.typed diff --git a/sdk/containerservice/azure-mgmt-containerservice/_meta.json b/sdk/containerservice/azure-mgmt-containerservice/_meta.json index 0dbdcb5c2e19..b3b1f583ddc1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/_meta.json +++ b/sdk/containerservice/azure-mgmt-containerservice/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "f528ab6315c8d4dd4c36f363851d491798a78146", + "commit": "c800afa8bcc12ee1c3df0ec26fb012d48b93ce0c", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/containerservice/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/containerservice/resource-manager/readme.md" 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 7c3ce487fc0e..0ff066541854 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 @@ -56,7 +56,7 @@ class ContainerServiceClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2021-07-01' + DEFAULT_API_VERSION = '2021-08-01' _PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -119,6 +119,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-03-01: :mod:`v2021_03_01.models` * 2021-05-01: :mod:`v2021_05_01.models` * 2021-07-01: :mod:`v2021_07_01.models` + * 2021-08-01: :mod:`v2021_08_01.models` """ if api_version == '2017-07-01': from .v2017_07_01 import models @@ -198,6 +199,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-07-01': from .v2021_07_01 import models return models + elif api_version == '2021-08-01': + from .v2021_08_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -223,6 +227,7 @@ def agent_pools(self): * 2021-03-01: :class:`AgentPoolsOperations` * 2021-05-01: :class:`AgentPoolsOperations` * 2021-07-01: :class:`AgentPoolsOperations` + * 2021-08-01: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -263,6 +268,8 @@ def agent_pools(self): from .v2021_05_01.operations import AgentPoolsOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import AgentPoolsOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.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))) @@ -289,6 +296,7 @@ def maintenance_configurations(self): * 2021-03-01: :class:`MaintenanceConfigurationsOperations` * 2021-05-01: :class:`MaintenanceConfigurationsOperations` * 2021-07-01: :class:`MaintenanceConfigurationsOperations` + * 2021-08-01: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') if api_version == '2020-12-01': @@ -301,6 +309,8 @@ def maintenance_configurations(self): from .v2021_05_01.operations import MaintenanceConfigurationsOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.operations import MaintenanceConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'maintenance_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -330,6 +340,7 @@ def managed_clusters(self): * 2021-03-01: :class:`ManagedClustersOperations` * 2021-05-01: :class:`ManagedClustersOperations` * 2021-07-01: :class:`ManagedClustersOperations` + * 2021-08-01: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -374,6 +385,8 @@ def managed_clusters(self): from .v2021_05_01.operations import ManagedClustersOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import ManagedClustersOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.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))) @@ -425,6 +438,7 @@ def operations(self): * 2021-03-01: :class:`Operations` * 2021-05-01: :class:`Operations` * 2021-07-01: :class:`Operations` + * 2021-08-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -469,6 +483,8 @@ def operations(self): from .v2021_05_01.operations import Operations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import Operations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_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))) @@ -486,6 +502,7 @@ def private_endpoint_connections(self): * 2021-03-01: :class:`PrivateEndpointConnectionsOperations` * 2021-05-01: :class:`PrivateEndpointConnectionsOperations` * 2021-07-01: :class:`PrivateEndpointConnectionsOperations` + * 2021-08-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-06-01': @@ -506,6 +523,8 @@ def private_endpoint_connections(self): from .v2021_05_01.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.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))) @@ -521,6 +540,7 @@ def private_link_resources(self): * 2021-03-01: :class:`PrivateLinkResourcesOperations` * 2021-05-01: :class:`PrivateLinkResourcesOperations` * 2021-07-01: :class:`PrivateLinkResourcesOperations` + * 2021-08-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-09-01': @@ -537,6 +557,8 @@ def private_link_resources(self): from .v2021_05_01.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_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))) @@ -552,6 +574,7 @@ def resolve_private_link_service_id(self): * 2021-03-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-05-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-07-01: :class:`ResolvePrivateLinkServiceIdOperations` + * 2021-08-01: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-09-01': @@ -568,10 +591,25 @@ def resolve_private_link_service_id(self): from .v2021_05_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_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))) + @property + def snapshots(self): + """Instance depends on the API version: + + * 2021-08-01: :class:`SnapshotsOperations` + """ + api_version = self._get_api_version('snapshots') + if api_version == '2021-08-01': + from .v2021_08_01.operations import SnapshotsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'snapshots'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + def close(self): self._client.close() def __enter__(self): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py index 3453c79346be..ff3a561414fb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py @@ -54,7 +54,7 @@ class ContainerServiceClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2021-07-01' + DEFAULT_API_VERSION = '2021-08-01' _PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -117,6 +117,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-03-01: :mod:`v2021_03_01.models` * 2021-05-01: :mod:`v2021_05_01.models` * 2021-07-01: :mod:`v2021_07_01.models` + * 2021-08-01: :mod:`v2021_08_01.models` """ if api_version == '2017-07-01': from ..v2017_07_01 import models @@ -196,6 +197,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-07-01': from ..v2021_07_01 import models return models + elif api_version == '2021-08-01': + from ..v2021_08_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -221,6 +225,7 @@ def agent_pools(self): * 2021-03-01: :class:`AgentPoolsOperations` * 2021-05-01: :class:`AgentPoolsOperations` * 2021-07-01: :class:`AgentPoolsOperations` + * 2021-08-01: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -261,6 +266,8 @@ def agent_pools(self): from ..v2021_05_01.aio.operations import AgentPoolsOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_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))) @@ -287,6 +294,7 @@ def maintenance_configurations(self): * 2021-03-01: :class:`MaintenanceConfigurationsOperations` * 2021-05-01: :class:`MaintenanceConfigurationsOperations` * 2021-07-01: :class:`MaintenanceConfigurationsOperations` + * 2021-08-01: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') if api_version == '2020-12-01': @@ -299,6 +307,8 @@ def maintenance_configurations(self): from ..v2021_05_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'maintenance_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -328,6 +338,7 @@ def managed_clusters(self): * 2021-03-01: :class:`ManagedClustersOperations` * 2021-05-01: :class:`ManagedClustersOperations` * 2021-07-01: :class:`ManagedClustersOperations` + * 2021-08-01: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -372,6 +383,8 @@ def managed_clusters(self): from ..v2021_05_01.aio.operations import ManagedClustersOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_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))) @@ -423,6 +436,7 @@ def operations(self): * 2021-03-01: :class:`Operations` * 2021-05-01: :class:`Operations` * 2021-07-01: :class:`Operations` + * 2021-08-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -467,6 +481,8 @@ def operations(self): from ..v2021_05_01.aio.operations import Operations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import Operations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_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))) @@ -484,6 +500,7 @@ def private_endpoint_connections(self): * 2021-03-01: :class:`PrivateEndpointConnectionsOperations` * 2021-05-01: :class:`PrivateEndpointConnectionsOperations` * 2021-07-01: :class:`PrivateEndpointConnectionsOperations` + * 2021-08-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-06-01': @@ -504,6 +521,8 @@ def private_endpoint_connections(self): from ..v2021_05_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_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))) @@ -519,6 +538,7 @@ def private_link_resources(self): * 2021-03-01: :class:`PrivateLinkResourcesOperations` * 2021-05-01: :class:`PrivateLinkResourcesOperations` * 2021-07-01: :class:`PrivateLinkResourcesOperations` + * 2021-08-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-09-01': @@ -535,6 +555,8 @@ def private_link_resources(self): from ..v2021_05_01.aio.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_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))) @@ -550,6 +572,7 @@ def resolve_private_link_service_id(self): * 2021-03-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-05-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-07-01: :class:`ResolvePrivateLinkServiceIdOperations` + * 2021-08-01: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-09-01': @@ -566,10 +589,25 @@ def resolve_private_link_service_id(self): from ..v2021_05_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_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))) + @property + def snapshots(self): + """Instance depends on the API version: + + * 2021-08-01: :class:`SnapshotsOperations` + """ + api_version = self._get_api_version('snapshots') + if api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import SnapshotsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'snapshots'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + async def close(self): await self._client.close() async def __aenter__(self): 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 32c068dc4ded..127a073e5bf5 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 .v2021_07_01.models import * +from .v2021_08_01.models import * diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py new file mode 100644 index 000000000000..eb3d7ba7a265 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_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/v2021_08_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py new file mode 100644 index 000000000000..36777d882373 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_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 = "2021-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/v2021_08_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py new file mode 100644 index 000000000000..5827c29f4681 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import MaintenanceConfigurationsOperations +from .operations import AgentPoolsOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ResolvePrivateLinkServiceIdOperations +from .operations import SnapshotsOperations +from . import models + + +class ContainerServiceClient(object): + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2021_08_01.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: azure.mgmt.containerservice.v2021_08_01.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_08_01.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: azure.mgmt.containerservice.v2021_08_01.operations.AgentPoolsOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_08_01.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.containerservice.v2021_08_01.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_08_01.operations.ResolvePrivateLinkServiceIdOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: azure.mgmt.containerservice.v2021_08_01.operations.SnapshotsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :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._serialize.client_side_validation = False + 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.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ContainerServiceClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json new file mode 100644 index 000000000000..cc02a82d3151 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json @@ -0,0 +1,110 @@ +{ + "chosen_version": "2021-08-01", + "total_api_version_list": ["2021-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, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "maintenance_configurations": "MaintenanceConfigurationsOperations", + "agent_pools": "AgentPoolsOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "resolve_private_link_service_id": "ResolvePrivateLinkServiceIdOperations", + "snapshots": "SnapshotsOperations" + } +} \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_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/v2021_08_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py new file mode 100644 index 000000000000..b848bd081877 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_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 = "2021-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/v2021_08_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py new file mode 100644 index 000000000000..c160224555c8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import MaintenanceConfigurationsOperations +from .operations import AgentPoolsOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ResolvePrivateLinkServiceIdOperations +from .operations import SnapshotsOperations +from .. import models + + +class ContainerServiceClient(object): + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2021_08_01.aio.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: azure.mgmt.containerservice.v2021_08_01.aio.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_08_01.aio.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: azure.mgmt.containerservice.v2021_08_01.aio.operations.AgentPoolsOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_08_01.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.containerservice.v2021_08_01.aio.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_08_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: azure.mgmt.containerservice.v2021_08_01.aio.operations.SnapshotsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :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._serialize.client_side_validation = False + 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.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ContainerServiceClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5e1e5e72fa59 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._snapshots_operations import SnapshotsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'MaintenanceConfigurationsOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ResolvePrivateLinkServiceIdOperations', + 'SnapshotsOperations', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..35246f92999e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,691 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AgentPoolsOperations: + """AgentPoolsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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: Any + ) -> AsyncIterable["_models.AgentPoolListResult"]: + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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: Any + ) -> "_models.AgentPool": + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPool, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> "_models.AgentPool": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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: Any + ) -> AsyncLROPoller["_models.AgentPool"]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param parameters: The agent pool to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + 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 + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> AsyncLROPoller[None]: + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_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: Any + ) -> "_models.AgentPoolUpgradeProfile": + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_upgrade_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> "_models.AgentPoolAvailableVersions": + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolAvailableVersions, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_available_agent_pool_versions.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> Optional["_models.AgentPool"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> AsyncLROPoller["_models.AgentPool"]: + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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 + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..665aa8a3b8cd --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py @@ -0,0 +1,315 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MaintenanceConfigurationsOperations: + """MaintenanceConfigurationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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_by_managed_cluster( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.MaintenanceConfigurationListResult"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_managed_cluster.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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('MaintenanceConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :param parameters: The maintenance configuration to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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, 'MaintenanceConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..9a7cbf8d7f64 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1842 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ManagedClustersOperations: + """ManagedClustersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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 + + async def get_os_options( + self, + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OSOptionProfile": + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of a supported Azure region. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OSOptionProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OSOptionProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_os_options.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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('OSOptionProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.ManagedClusterListResult"]: + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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: Any + ) -> AsyncIterable["_models.ManagedClusterListResult"]: + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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: Any + ) -> "_models.ManagedClusterUpgradeProfile": + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_upgrade_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> "_models.ManagedClusterAccessProfile": + """Gets an access profile of a managed cluster. + + **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param role_name: The name of the role for managed cluster accessProfile resource. + :type role_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterAccessProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_access_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the user credentials of a managed cluster. + + Lists the user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_user_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> "_models.ManagedCluster": + """Gets a managed cluster. + + Gets a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> "_models.ManagedCluster": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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: Any + ) -> AsyncLROPoller["_models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The managed cluster to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + 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 + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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: Any + ) -> AsyncLROPoller["_models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates tags on a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + 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 + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def _reset_service_principal_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The service principal profile to set on the managed cluster. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + async def _reset_aad_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._reset_aad_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + Reset the AAD Profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + async def _rotate_cluster_certificates_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> AsyncLROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + async def _stop_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> AsyncLROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + async def _start_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> AsyncLROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._run_command_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request_payload, 'RunCommandRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> AsyncLROPoller["_models.RunCommandResult"]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param request_payload: The run command request. + :type request_payload: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + async def get_command_result( + self, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the Managed Cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param command_id: Id of the command. + :type command_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunCommandResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_command_result.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'commandId': self._serialize.url("command_id", command_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + def list_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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('OutboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py new file mode 100644 index 000000000000..0d3ad21a22b0 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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: Any + ) -> AsyncIterable["_models.OperationListResult"]: + """Gets a list of operations. + + Gets a list of operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_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/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..db60eeac5c58 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,358 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code 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 as _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.v2021_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 + + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> "_models.PrivateEndpointConnection": + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> "_models.PrivateEndpointConnection": + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: The updated private endpoint connection. + :type parameters: ~azure.mgmt.containerservice.v2021_08_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.v2021_08_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 = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..7a5893b6c4aa --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_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 as _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.v2021_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 + + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..848874421313 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_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 Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResolvePrivateLinkServiceIdOperations: + """ResolvePrivateLinkServiceIdOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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 + + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters required in order to resolve a private link service ID. + :type parameters: ~azure.mgmt.containerservice.v2021_08_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.v2021_08_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 = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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/v2021_08_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py new file mode 100644 index 000000000000..164d57e3b7bf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py @@ -0,0 +1,439 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code 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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SnapshotsOperations: + """SnapshotsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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: Any + ) -> AsyncIterable["_models.SnapshotListResult"]: + """Gets a list of snapshots in the specified subscription. + + Gets a list of snapshots in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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('SnapshotListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SnapshotListResult"]: + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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('SnapshotListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.Snapshot": + """Gets a snapshot. + + Gets a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.Snapshot", + **kwargs: Any + ) -> "_models.Snapshot": + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The snapshot to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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, 'Snapshot') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.Snapshot": + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update snapshot Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + """Deletes a snapshot. + + Deletes a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py new file mode 100644 index 000000000000..ae984aa96041 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py @@ -0,0 +1,339 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for 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 CloudErrorBody + from ._models_py3 import ContainerServiceDiagnosticsProfile + from ._models_py3 import ContainerServiceLinuxProfile + from ._models_py3 import ContainerServiceMasterProfile + from ._models_py3 import ContainerServiceNetworkProfile + from ._models_py3 import ContainerServiceSshConfiguration + from ._models_py3 import ContainerServiceSshPublicKey + from ._models_py3 import ContainerServiceVMDiagnostics + from ._models_py3 import CreationData + from ._models_py3 import CredentialResult + from ._models_py3 import CredentialResults + from ._models_py3 import EndpointDependency + from ._models_py3 import EndpointDetail + from ._models_py3 import ExtendedLocation + from ._models_py3 import KubeletConfig + from ._models_py3 import LinuxOSConfig + from ._models_py3 import MaintenanceConfiguration + from ._models_py3 import MaintenanceConfigurationListResult + from ._models_py3 import ManagedCluster + from ._models_py3 import ManagedClusterAADProfile + from ._models_py3 import ManagedClusterAPIServerAccessProfile + from ._models_py3 import ManagedClusterAccessProfile + from ._models_py3 import ManagedClusterAddonProfile + from ._models_py3 import ManagedClusterAddonProfileIdentity + from ._models_py3 import ManagedClusterAgentPoolProfile + from ._models_py3 import ManagedClusterAgentPoolProfileProperties + from ._models_py3 import ManagedClusterAutoUpgradeProfile + from ._models_py3 import ManagedClusterHTTPProxyConfig + from ._models_py3 import ManagedClusterIdentity + from ._models_py3 import ManagedClusterListResult + from ._models_py3 import ManagedClusterLoadBalancerProfile + from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs + from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes + from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs + from ._models_py3 import ManagedClusterManagedOutboundIPProfile + from ._models_py3 import ManagedClusterNATGatewayProfile + from ._models_py3 import ManagedClusterPodIdentity + from ._models_py3 import ManagedClusterPodIdentityException + from ._models_py3 import ManagedClusterPodIdentityProfile + from ._models_py3 import ManagedClusterPodIdentityProvisioningError + from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody + from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo + from ._models_py3 import ManagedClusterPoolUpgradeProfile + from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem + from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile + from ._models_py3 import ManagedClusterSKU + from ._models_py3 import ManagedClusterSecurityProfile + from ._models_py3 import ManagedClusterSecurityProfileAzureDefender + from ._models_py3 import ManagedClusterServicePrincipalProfile + from ._models_py3 import ManagedClusterUpgradeProfile + from ._models_py3 import ManagedClusterWindowsProfile + from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue + from ._models_py3 import OSOptionProfile + from ._models_py3 import OSOptionProperty + from ._models_py3 import OperationListResult + from ._models_py3 import OperationValue + from ._models_py3 import OutboundEnvironmentEndpoint + from ._models_py3 import OutboundEnvironmentEndpointCollection + from ._models_py3 import PowerState + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourcesListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import Resource + from ._models_py3 import ResourceReference + from ._models_py3 import RunCommandRequest + from ._models_py3 import RunCommandResult + from ._models_py3 import Snapshot + from ._models_py3 import SnapshotListResult + from ._models_py3 import SubResource + from ._models_py3 import SysctlConfig + from ._models_py3 import SystemData + from ._models_py3 import TagsObject + from ._models_py3 import TimeInWeek + from ._models_py3 import TimeSpan + from ._models_py3 import UserAssignedIdentity +except (SyntaxError, ImportError): + from ._models import AgentPool # type: ignore + from ._models import AgentPoolAvailableVersions # type: ignore + from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore + from ._models import AgentPoolListResult # type: ignore + from ._models import AgentPoolUpgradeProfile # type: ignore + from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore + from ._models import AgentPoolUpgradeSettings # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import ContainerServiceDiagnosticsProfile # type: ignore + from ._models import ContainerServiceLinuxProfile # type: ignore + from ._models import ContainerServiceMasterProfile # type: ignore + from ._models import ContainerServiceNetworkProfile # type: ignore + from ._models import ContainerServiceSshConfiguration # type: ignore + from ._models import ContainerServiceSshPublicKey # type: ignore + from ._models import ContainerServiceVMDiagnostics # type: ignore + from ._models import CreationData # type: ignore + from ._models import CredentialResult # type: ignore + from ._models import CredentialResults # type: ignore + from ._models import EndpointDependency # type: ignore + from ._models import EndpointDetail # type: ignore + from ._models import ExtendedLocation # type: ignore + from ._models import KubeletConfig # type: ignore + from ._models import LinuxOSConfig # type: ignore + from ._models import MaintenanceConfiguration # type: ignore + from ._models import MaintenanceConfigurationListResult # type: ignore + from ._models import ManagedCluster # type: ignore + from ._models import ManagedClusterAADProfile # type: ignore + from ._models import ManagedClusterAPIServerAccessProfile # type: ignore + from ._models import ManagedClusterAccessProfile # type: ignore + from ._models import ManagedClusterAddonProfile # type: ignore + from ._models import ManagedClusterAddonProfileIdentity # type: ignore + from ._models import ManagedClusterAgentPoolProfile # type: ignore + from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore + from ._models import ManagedClusterAutoUpgradeProfile # type: ignore + from ._models import ManagedClusterHTTPProxyConfig # type: ignore + from ._models import ManagedClusterIdentity # type: ignore + from ._models import ManagedClusterListResult # type: ignore + from ._models import ManagedClusterLoadBalancerProfile # type: ignore + from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore + from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore + from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore + from ._models import ManagedClusterManagedOutboundIPProfile # type: ignore + from ._models import ManagedClusterNATGatewayProfile # type: ignore + from ._models import ManagedClusterPodIdentity # type: ignore + from ._models import ManagedClusterPodIdentityException # type: ignore + from ._models import ManagedClusterPodIdentityProfile # type: ignore + from ._models import ManagedClusterPodIdentityProvisioningError # type: ignore + from ._models import ManagedClusterPodIdentityProvisioningErrorBody # type: ignore + from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore + from ._models import ManagedClusterPoolUpgradeProfile # type: ignore + from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore + from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore + from ._models import ManagedClusterSKU # type: ignore + from ._models import ManagedClusterSecurityProfile # type: ignore + from ._models import ManagedClusterSecurityProfileAzureDefender # type: ignore + from ._models import ManagedClusterServicePrincipalProfile # type: ignore + from ._models import ManagedClusterUpgradeProfile # type: ignore + from ._models import ManagedClusterWindowsProfile # type: ignore + from ._models import ManagedServiceIdentityUserAssignedIdentitiesValue # type: ignore + from ._models import OSOptionProfile # type: ignore + from ._models import OSOptionProperty # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import OperationValue # type: ignore + from ._models import OutboundEnvironmentEndpoint # type: ignore + from ._models import OutboundEnvironmentEndpointCollection # type: ignore + from ._models import PowerState # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourcesListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceReference # type: ignore + from ._models import RunCommandRequest # type: ignore + from ._models import RunCommandResult # type: ignore + from ._models import Snapshot # type: ignore + from ._models import SnapshotListResult # type: ignore + from ._models import SubResource # type: ignore + from ._models import SysctlConfig # type: ignore + from ._models import SystemData # type: ignore + from ._models import TagsObject # type: ignore + from ._models import TimeInWeek # type: ignore + from ._models import TimeSpan # type: ignore + from ._models import UserAssignedIdentity # type: ignore + +from ._container_service_client_enums import ( + AgentPoolMode, + AgentPoolType, + Code, + ConnectionStatus, + ContainerServiceStorageProfileTypes, + ContainerServiceVMSizeTypes, + Count, + CreatedByType, + Expander, + ExtendedLocationTypes, + GPUInstanceProfile, + KubeletDiskType, + LicenseType, + LoadBalancerSku, + ManagedClusterPodIdentityProvisioningState, + ManagedClusterSKUName, + ManagedClusterSKUTier, + NetworkMode, + NetworkPlugin, + NetworkPolicy, + OSDiskType, + OSSKU, + OSType, + OutboundType, + PrivateEndpointConnectionProvisioningState, + PublicNetworkAccess, + ResourceIdentityType, + ScaleDownMode, + ScaleSetEvictionPolicy, + ScaleSetPriority, + SnapshotType, + UpgradeChannel, + WeekDay, + WorkloadRuntime, +) + +__all__ = [ + 'AgentPool', + 'AgentPoolAvailableVersions', + 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', + 'AgentPoolUpgradeProfile', + 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'AgentPoolUpgradeSettings', + 'CloudErrorBody', + 'ContainerServiceDiagnosticsProfile', + 'ContainerServiceLinuxProfile', + 'ContainerServiceMasterProfile', + 'ContainerServiceNetworkProfile', + 'ContainerServiceSshConfiguration', + 'ContainerServiceSshPublicKey', + 'ContainerServiceVMDiagnostics', + 'CreationData', + 'CredentialResult', + 'CredentialResults', + 'EndpointDependency', + 'EndpointDetail', + 'ExtendedLocation', + 'KubeletConfig', + 'LinuxOSConfig', + 'MaintenanceConfiguration', + 'MaintenanceConfigurationListResult', + 'ManagedCluster', + 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', + 'ManagedClusterAccessProfile', + 'ManagedClusterAddonProfile', + 'ManagedClusterAddonProfileIdentity', + 'ManagedClusterAgentPoolProfile', + 'ManagedClusterAgentPoolProfileProperties', + 'ManagedClusterAutoUpgradeProfile', + 'ManagedClusterHTTPProxyConfig', + 'ManagedClusterIdentity', + 'ManagedClusterListResult', + 'ManagedClusterLoadBalancerProfile', + 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', + 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', + 'ManagedClusterLoadBalancerProfileOutboundIPs', + 'ManagedClusterManagedOutboundIPProfile', + 'ManagedClusterNATGatewayProfile', + 'ManagedClusterPodIdentity', + 'ManagedClusterPodIdentityException', + 'ManagedClusterPodIdentityProfile', + 'ManagedClusterPodIdentityProvisioningError', + 'ManagedClusterPodIdentityProvisioningErrorBody', + 'ManagedClusterPodIdentityProvisioningInfo', + 'ManagedClusterPoolUpgradeProfile', + 'ManagedClusterPoolUpgradeProfileUpgradesItem', + 'ManagedClusterPropertiesAutoScalerProfile', + 'ManagedClusterSKU', + 'ManagedClusterSecurityProfile', + 'ManagedClusterSecurityProfileAzureDefender', + 'ManagedClusterServicePrincipalProfile', + 'ManagedClusterUpgradeProfile', + 'ManagedClusterWindowsProfile', + 'ManagedServiceIdentityUserAssignedIdentitiesValue', + 'OSOptionProfile', + 'OSOptionProperty', + 'OperationListResult', + 'OperationValue', + 'OutboundEnvironmentEndpoint', + 'OutboundEnvironmentEndpointCollection', + 'PowerState', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourcesListResult', + 'PrivateLinkServiceConnectionState', + 'Resource', + 'ResourceReference', + 'RunCommandRequest', + 'RunCommandResult', + 'Snapshot', + 'SnapshotListResult', + 'SubResource', + 'SysctlConfig', + 'SystemData', + 'TagsObject', + 'TimeInWeek', + 'TimeSpan', + 'UserAssignedIdentity', + 'AgentPoolMode', + 'AgentPoolType', + 'Code', + 'ConnectionStatus', + 'ContainerServiceStorageProfileTypes', + 'ContainerServiceVMSizeTypes', + 'Count', + 'CreatedByType', + 'Expander', + 'ExtendedLocationTypes', + 'GPUInstanceProfile', + 'KubeletDiskType', + 'LicenseType', + 'LoadBalancerSku', + 'ManagedClusterPodIdentityProvisioningState', + 'ManagedClusterSKUName', + 'ManagedClusterSKUTier', + 'NetworkMode', + 'NetworkPlugin', + 'NetworkPolicy', + 'OSDiskType', + 'OSSKU', + 'OSType', + 'OutboundType', + 'PrivateEndpointConnectionProvisioningState', + 'PublicNetworkAccess', + 'ResourceIdentityType', + 'ScaleDownMode', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', + 'SnapshotType', + 'UpgradeChannel', + 'WeekDay', + 'WorkloadRuntime', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py new file mode 100644 index 000000000000..9eeb9d5f0677 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py @@ -0,0 +1,584 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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)): + """A cluster must have at least one 'System' Agent Pool at all times. For additional information + on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools + """ + + #: System agent pools are primarily for hosting critical system pods such as CoreDNS and + #: metrics-server. System agent pools osType must be Linux. System agent pools VM SKU must have at + #: least 2vCPUs and 4GB of memory. + SYSTEM = "System" + #: User agent pools are primarily for hosting your application pods. + USER = "User" + +class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of Agent Pool. + """ + + #: Create an Agent Pool backed by a Virtual Machine Scale Set. + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + #: Use of this is strongly discouraged. + AVAILABILITY_SET = "AvailabilitySet" + +class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tells whether the cluster is Running or Stopped + """ + + #: The cluster is running. + RUNNING = "Running" + #: The cluster is stopped. + STOPPED = "Stopped" + +class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The private link service connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + +class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf + based on the choice of orchestrator. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. Note: This is no longer maintained. + """ + + STANDARD_A1 = "Standard_A1" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2 = "Standard_A2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_A9 = "Standard_A9" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D11 = "Standard_D11" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D11_V2_PROMO = "Standard_D11_v2_Promo" + STANDARD_D12 = "Standard_D12" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D12_V2_PROMO = "Standard_D12_v2_Promo" + STANDARD_D13 = "Standard_D13" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D13_V2_PROMO = "Standard_D13_v2_Promo" + STANDARD_D14 = "Standard_D14" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D14_V2_PROMO = "Standard_D14_v2_Promo" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2 = "Standard_D2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D2_V2_PROMO = "Standard_D2_v2_Promo" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D3 = "Standard_D3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D3_V2_PROMO = "Standard_D3_v2_Promo" + STANDARD_D4 = "Standard_D4" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D4_V2_PROMO = "Standard_D4_v2_Promo" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D5_V2_PROMO = "Standard_D5_v2_Promo" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS11_V2_PROMO = "Standard_DS11_v2_Promo" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS12_V2_PROMO = "Standard_DS12_v2_Promo" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS13_V2_PROMO = "Standard_DS13_v2_Promo" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS14_V2_PROMO = "Standard_DS14_v2_Promo" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS2_V2_PROMO = "Standard_DS2_v2_Promo" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS3_V2_PROMO = "Standard_DS3_v2_Promo" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS4_V2_PROMO = "Standard_DS4_v2_Promo" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS5_V2_PROMO = "Standard_DS5_v2_Promo" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E32_16_S_V3 = "Standard_E32-16s_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F16 = "Standard_F16" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2 = "Standard_F2" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F4 = "Standard_F4" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_F8 = "Standard_F8" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H16 = "Standard_H16" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H8 = "Standard_H8" + STANDARD_H8_M = "Standard_H8m" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M64_S = "Standard_M64s" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" + STANDARD_NV6 = "Standard_NV6" + +class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): + """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The + default value is 1. + """ + + ONE = 1 + THREE = 3 + FIVE = 5 + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """If not specified, the default is 'random'. See `expanders + `_ + for more information. + """ + + #: Selects the node group that will have the least idle CPU (if tied, unused memory) after + #: scale-up. This is useful when you have different classes of nodes, for example, high CPU or + #: high memory nodes, and only want to expand those when there are pending pods that need a lot of + #: those resources. + LEAST_WASTE = "least-waste" + #: Selects the node group that would be able to schedule the most pods when scaling up. This is + #: useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note + #: that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple + #: smaller nodes at once. + MOST_PODS = "most-pods" + #: Selects the node group that has the highest priority assigned by the user. It's configuration + #: is described in more details `here + #: `_. + PRIORITY = "priority" + #: Used when you don't have a particular need for the node groups to scale differently. + RANDOM = "random" + +class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of extendedLocation. + """ + + EDGE_ZONE = "EdgeZone" + +class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + """ + + MIG1_G = "MIG1g" + MIG2_G = "MIG2g" + MIG3_G = "MIG3g" + MIG4_G = "MIG4g" + MIG7_G = "MIG7g" + +class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet + ephemeral storage. + """ + + #: Kubelet will use the OS disk for its data. + OS = "OS" + #: Kubelet will use the temporary disk for its data. + TEMPORARY = "Temporary" + +class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. + """ + + #: No additional licensing is applied. + NONE = "None" + #: Enables Azure Hybrid User Benefits for Windows VMs. + WINDOWS_SERVER = "Windows_Server" + +class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. + """ + + #: Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For more information + #: about on working with the load balancer in the managed cluster, see the `standard Load Balancer + #: `_ article. + STANDARD = "standard" + #: Use a basic Load Balancer with limited functionality. + BASIC = "basic" + +class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state of the pod identity. + """ + + ASSIGNED = "Assigned" + UPDATING = "Updating" + DELETING = "Deleting" + FAILED = "Failed" + +class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The name of a managed cluster SKU. + """ + + BASIC = "Basic" + +class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. + """ + + #: Guarantees 99.95% availability of the Kubernetes API server endpoint for clusters that use + #: Availability Zones and 99.9% of availability for clusters that don't use Availability Zones. + PAID = "Paid" + #: No guaranteed SLA, no additional charges. Free tier clusters have an SLO of 99.5%. + FREE = "Free" + +class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This cannot be specified if networkPlugin is anything other than 'azure'. + """ + + #: No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure + #: CNI. See `Transparent Mode `_ for + #: more information. + TRANSPARENT = "transparent" + #: This is no longer supported. + BRIDGE = "bridge" + +class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network plugin used for building the Kubernetes network. + """ + + #: Use the Azure CNI network plugin. See `Azure CNI (advanced) networking + #: `_ for + #: more information. + AZURE = "azure" + #: Use the Kubenet network plugin. See `Kubenet (basic) networking + #: `_ for more + #: information. + KUBENET = "kubenet" + +class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network policy used for building the Kubernetes network. + """ + + #: Use Calico network policies. See `differences between Azure and Calico policies + #: `_ + #: for more information. + CALICO = "calico" + #: Use Azure network policies. See `differences between Azure and Calico policies + #: `_ + #: for more information. + AZURE = "azure" + +class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested + OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more + information see `Ephemeral OS + `_. + """ + + #: Azure replicates the operating system disk for a virtual machine to Azure storage to avoid data + #: loss should the VM need to be relocated to another host. Since containers aren't designed to + #: have local state persisted, this behavior offers limited value while providing some drawbacks, + #: including slower node provisioning and higher read/write latency. + MANAGED = "Managed" + #: Ephemeral OS disks are stored only on the host machine, just like a temporary disk. This + #: provides lower read/write latency, along with faster node scaling and cluster upgrades. + EPHEMERAL = "Ephemeral" + +class OSSKU(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies an OS SKU. This value must not be specified if OSType is Windows. + """ + + UBUNTU = "Ubuntu" + CBL_MARINER = "CBLMariner" + +class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operating system type. The default is Linux. + """ + + #: Use Linux. + LINUX = "Linux" + #: Use Windows. + WINDOWS = "Windows" + +class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This can only be set at cluster creation time and cannot be changed later. For more information + see `egress outbound type `_. + """ + + #: The load balancer is used for egress through an AKS assigned public IP. This supports + #: Kubernetes services of type 'loadBalancer'. For more information see `outbound type + #: loadbalancer + #: `_. + LOAD_BALANCER = "loadBalancer" + #: Egress paths must be defined by the user. This is an advanced scenario and requires proper + #: network configuration. For more information see `outbound type userDefinedRouting + #: `_. + USER_DEFINED_ROUTING = "userDefinedRouting" + #: The AKS-managed NAT gateway is used for egress. + MANAGED_NAT_GATEWAY = "managedNATGateway" + #: The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an + #: advanced scenario and requires proper network configuration. + USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Default value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private + cluster + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """For more information see `use managed identities in AKS + `_. + """ + + #: Use an implicitly created system assigned managed identity to manage cluster resources. Master + #: components in the control plane such as kube-controller-manager will use the system assigned + #: managed identity to manipulate Azure resources. + SYSTEM_ASSIGNED = "SystemAssigned" + #: Use a user-specified identity to manage cluster resources. Master components in the control + #: plane such as kube-controller-manager will use the specified user assigned managed identity to + #: manipulate Azure resources. + USER_ASSIGNED = "UserAssigned" + #: Do not use a managed identity for the Managed Cluster, service principal will be used instead. + NONE = "None" + +class ScaleDownMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Describes how VMs are added to or removed from Agent Pools. See `billing states + `_. + """ + + #: Create new instances during scale up and remove instances during scale down. + DELETE = "Delete" + #: Attempt to start deallocated instances (if they exist) during scale up and deallocate instances + #: during scale down. + DEALLOCATE = "Deallocate" + +class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. + For more information about eviction see `spot VMs + `_ + """ + + #: Nodes in the underlying Scale Set of the node pool are deleted when they're evicted. + DELETE = "Delete" + #: Nodes in the underlying Scale Set of the node pool are set to the stopped-deallocated state + #: upon eviction. Nodes in the stopped-deallocated state count against your compute quota and can + #: cause issues with cluster scaling or upgrading. + DEALLOCATE = "Deallocate" + +class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Virtual Machine Scale Set priority. + """ + + #: Spot priority VMs will be used. There is no SLA for spot nodes. See `spot on AKS + #: `_ for more information. + SPOT = "Spot" + #: Regular VMs will be used. + REGULAR = "Regular" + +class SnapshotType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of a snapshot. The default is NodePool. + """ + + #: The snapshot is a snapshot of a node pool. + NODE_POOL = "NodePool" + +class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """For more information see `setting the AKS cluster auto-upgrade channel + `_. + """ + + #: Automatically upgrade the cluster to the latest supported patch release on the latest supported + #: minor version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor + #: version where N is the latest supported minor version, the cluster first upgrades to the latest + #: supported patch version on N-1 minor version. For example, if a cluster is running version + #: 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is + #: upgraded to 1.18.6, then is upgraded to 1.19.1. + RAPID = "rapid" + #: Automatically upgrade the cluster to the latest supported patch release on minor version N-1, + #: where N is the latest supported minor version. For example, if a cluster is running version + #: 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded + #: to 1.18.6. + STABLE = "stable" + #: Automatically upgrade the cluster to the latest supported patch version when it becomes + #: available while keeping the minor version the same. For example, if a cluster is running + #: version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is + #: upgraded to 1.17.9. + PATCH = "patch" + #: Automatically upgrade the node image to the latest version available. Microsoft provides + #: patches and new images for image nodes frequently (usually weekly), but your running nodes + #: won't get the new images unless you do a node image upgrade. Turning on the node-image channel + #: will automatically update your node images whenever a new version is available. + NODE_IMAGE = "node-image" + #: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. + NONE = "none" + +class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The weekday enum. + """ + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + +class WorkloadRuntime(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Determines the type of workload a node can run. + """ + + #: Nodes will use Kubelet to run standard OCI container workloads. + OCI_CONTAINER = "OCIContainer" + #: Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview). + WASM_WASI = "WasmWasi" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py new file mode 100644 index 000000000000..5e46c3f29cab --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py @@ -0,0 +1,3826 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import msrest.serialization + + +class SubResource(msrest.serialization.Model): + """Reference to another subresource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AgentPool(SubResource): + """Agent Pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :type type_properties_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'count': {'key': 'properties.count', 'type': 'int'}, + 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'properties.workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, + 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, + 'min_count': {'key': 'properties.minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'properties.scaleDownMode', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, + 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'properties.enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPool, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.vm_size = kwargs.get('vm_size', None) + self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) + self.os_disk_type = kwargs.get('os_disk_type', None) + self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) + self.workload_runtime = kwargs.get('workload_runtime', None) + self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) + self.pod_subnet_id = kwargs.get('pod_subnet_id', None) + self.max_pods = kwargs.get('max_pods', None) + self.os_type = kwargs.get('os_type', "Linux") + self.os_sku = kwargs.get('os_sku', None) + self.max_count = kwargs.get('max_count', None) + self.min_count = kwargs.get('min_count', None) + self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) + self.scale_down_mode = kwargs.get('scale_down_mode', None) + self.type_properties_type = kwargs.get('type_properties_type', None) + self.mode = kwargs.get('mode', None) + self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.node_image_version = None + self.upgrade_settings = kwargs.get('upgrade_settings', None) + self.provisioning_state = None + self.power_state = None + self.availability_zones = kwargs.get('availability_zones', None) + self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) + self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) + self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") + self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") + self.spot_max_price = kwargs.get('spot_max_price', -1) + self.tags = kwargs.get('tags', None) + self.node_labels = kwargs.get('node_labels', None) + self.node_taints = kwargs.get('node_taints', None) + self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) + self.kubelet_config = kwargs.get('kubelet_config', None) + self.linux_os_config = kwargs.get('linux_os_config', None) + self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) + self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) + self.enable_fips = kwargs.get('enable_fips', None) + self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) + self.creation_data = kwargs.get('creation_data', None) + + +class AgentPoolAvailableVersions(msrest.serialization.Model): + """The list of available versions for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the agent pool version list. + :vartype id: str + :ivar name: The name of the agent pool version list. + :vartype name: str + :ivar type: Type of the agent pool version list. + :vartype type: str + :param agent_pool_versions: List of versions available for agent pool. + :type agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolAvailableVersions, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.agent_pool_versions = kwargs.get('agent_pool_versions', None) + + +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): + """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. + + :param default: Whether this version is the default agent pool version. + :type default: bool + :param kubernetes_version: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'default': {'key': 'default', 'type': 'bool'}, + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) + self.default = kwargs.get('default', None) + self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.is_preview = kwargs.get('is_preview', None) + + +class AgentPoolListResult(msrest.serialization.Model): + """The response from the List Agent Pools operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of agent pools. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :ivar next_link: The URL to get the next set of agent pool results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AgentPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class AgentPoolUpgradeProfile(msrest.serialization.Model): + """The list of available upgrades for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the agent pool upgrade profile. + :vartype id: str + :ivar name: The name of the agent pool upgrade profile. + :vartype name: str + :ivar type: The type of the agent pool upgrade profile. + :vartype type: str + :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param upgrades: List of orchestrator types and versions available for upgrade. + :type upgrades: + list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :param latest_node_image_version: The latest AKS supported node image version. + :type latest_node_image_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kubernetes_version': {'required': True}, + 'os_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, + 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolUpgradeProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kubernetes_version = kwargs['kubernetes_version'] + self.os_type = kwargs.get('os_type', "Linux") + self.upgrades = kwargs.get('upgrades', None) + self.latest_node_image_version = kwargs.get('latest_node_image_version', None) + + +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): + """AgentPoolUpgradeProfilePropertiesUpgradesItem. + + :param kubernetes_version: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether the Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) + self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.is_preview = kwargs.get('is_preview', None) + + +class AgentPoolUpgradeSettings(msrest.serialization.Model): + """Settings for upgrading an agentpool. + + :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). + If a percentage is specified, it is the percentage of the total agent pool size at the time of + the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is + 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :type max_surge: str + """ + + _attribute_map = { + 'max_surge': {'key': 'maxSurge', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolUpgradeSettings, self).__init__(**kwargs) + self.max_surge = kwargs.get('max_surge', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Container service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.containerservice.v2021_08_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): + """Profile for diagnostics on the container service cluster. + + All required parameters must be populated in order to send to Azure. + + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :type vm_diagnostics: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMDiagnostics + """ + + _validation = { + 'vm_diagnostics': {'required': True}, + } + + _attribute_map = { + 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) + self.vm_diagnostics = kwargs['vm_diagnostics'] + + +class ContainerServiceLinuxProfile(msrest.serialization.Model): + """Profile for Linux VMs in the container service cluster. + + All required parameters must be populated in order to send to Azure. + + :param admin_username: Required. The administrator username to use for Linux VMs. + :type admin_username: str + :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshConfiguration + """ + + _validation = { + 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, + 'ssh': {'required': True}, + } + + _attribute_map = { + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceLinuxProfile, self).__init__(**kwargs) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] + + +class ContainerServiceMasterProfile(msrest.serialization.Model): + """Profile for the container service master. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :type count: str or ~azure.mgmt.containerservice.v2021_08_01.models.Count + :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :type dns_prefix: str + :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :type vm_size: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMSizeTypes + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :type vnet_subnet_id: str + :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :type first_consecutive_static_ip: str + :param storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :type storage_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceStorageProfileTypes + :ivar fqdn: FQDN for the master pool. + :vartype fqdn: str + """ + + _validation = { + 'dns_prefix': {'required': True}, + 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceMasterProfile, self).__init__(**kwargs) + self.count = kwargs.get('count', "1") + self.dns_prefix = kwargs['dns_prefix'] + self.vm_size = kwargs['vm_size'] + self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) + self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) + self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") + self.storage_profile = kwargs.get('storage_profile', None) + self.fqdn = None + + +class ContainerServiceNetworkProfile(msrest.serialization.Model): + """Profile of network configuration. + + :param network_plugin: Network plugin used for building the Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :type network_plugin: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPlugin + :param network_policy: Network policy used for building the Kubernetes network. Possible values + include: "calico", "azure". + :type network_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPolicy + :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. + Possible values include: "transparent", "bridge". + :type network_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkMode + :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :type pod_cidr: str + :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + not overlap with any Subnet IP ranges. + :type service_cidr: str + :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :type dns_service_ip: str + :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :type docker_bridge_cidr: str + :param outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default + value: "loadBalancer". + :type outbound_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OutboundType + :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.LoadBalancerSku + :param load_balancer_profile: Profile of the cluster load balancer. + :type load_balancer_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfile + :param nat_gateway_profile: Profile of the cluster NAT gateway. + :type nat_gateway_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterNATGatewayProfile + """ + + _validation = { + 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, + 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + } + + _attribute_map = { + 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, + 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, + 'network_mode': {'key': 'networkMode', 'type': 'str'}, + 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, + 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, + 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, + 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + 'outbound_type': {'key': 'outboundType', 'type': 'str'}, + 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, + 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, + 'nat_gateway_profile': {'key': 'natGatewayProfile', 'type': 'ManagedClusterNATGatewayProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceNetworkProfile, self).__init__(**kwargs) + self.network_plugin = kwargs.get('network_plugin', "kubenet") + self.network_policy = kwargs.get('network_policy', None) + self.network_mode = kwargs.get('network_mode', None) + self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") + self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") + self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") + self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") + self.outbound_type = kwargs.get('outbound_type', "loadBalancer") + self.load_balancer_sku = kwargs.get('load_balancer_sku', None) + self.load_balancer_profile = kwargs.get('load_balancer_profile', None) + self.nat_gateway_profile = kwargs.get('nat_gateway_profile', None) + + +class ContainerServiceSshConfiguration(msrest.serialization.Model): + """SSH configuration for Linux-based VMs running on Azure. + + All required parameters must be populated in order to send to Azure. + + :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + VMs. A maximum of 1 key may be specified. + :type public_keys: + list[~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshPublicKey] + """ + + _validation = { + 'public_keys': {'required': True}, + } + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceSshConfiguration, self).__init__(**kwargs) + self.public_keys = kwargs['public_keys'] + + +class ContainerServiceSshPublicKey(msrest.serialization.Model): + """Contains information about SSH certificate public key data. + + All required parameters must be populated in order to send to Azure. + + :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :type key_data: str + """ + + _validation = { + 'key_data': {'required': True}, + } + + _attribute_map = { + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceSshPublicKey, self).__init__(**kwargs) + self.key_data = kwargs['key_data'] + + +class ContainerServiceVMDiagnostics(msrest.serialization.Model): + """Profile for diagnostics on the container service VMs. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :type enabled: bool + :ivar storage_uri: The URI of the storage account where diagnostics are stored. + :vartype storage_uri: str + """ + + _validation = { + 'enabled': {'required': True}, + 'storage_uri': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.storage_uri = None + + +class CreationData(msrest.serialization.Model): + """Data used when creating a target resource from a source resource. + + :param source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :type source_resource_id: str + """ + + _attribute_map = { + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CreationData, self).__init__(**kwargs) + self.source_resource_id = kwargs.get('source_resource_id', None) + + +class CredentialResult(msrest.serialization.Model): + """The credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the credential. + :vartype name: str + :ivar value: Base64-encoded Kubernetes configuration file. + :vartype value: bytearray + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'bytearray'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialResult, self).__init__(**kwargs) + self.name = None + self.value = None + + +class CredentialResults(msrest.serialization.Model): + """The list credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_08_01.models.CredentialResult] + """ + + _validation = { + 'kubeconfigs': {'readonly': True}, + } + + _attribute_map = { + 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialResults, self).__init__(**kwargs) + self.kubeconfigs = None + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that AKS agent nodes are reaching at. + + :param domain_name: The domain name of the dependency. + :type domain_name: str + :param endpoint_details: The Ports and Protocols used when connecting to domainName. + :type endpoint_details: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.endpoint_details = kwargs.get('endpoint_details', None) + + +class EndpointDetail(msrest.serialization.Model): + """connect information from the AKS agent nodes to a single endpoint. + + :param ip_address: An IP Address that Domain Name currently resolves to. + :type ip_address: str + :param port: The port an endpoint is connected to. + :type port: int + :param protocol: The protocol used for connection. + :type protocol: str + :param description: Description of the detail. + :type description: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.description = kwargs.get('description', None) + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class KubeletConfig(msrest.serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :type cpu_manager_policy: str + :param cpu_cfs_quota: The default is true. + :type cpu_cfs_quota: bool + :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :type cpu_cfs_quota_period: str + :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + 85%. + :type image_gc_high_threshold: int + :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + is 80%. + :type image_gc_low_threshold: int + :param topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :type topology_manager_policy: str + :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\ ). + :type allowed_unsafe_sysctls: list[str] + :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :type fail_swap_on: bool + :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + is rotated. + :type container_log_max_size_mb: int + :param container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :type container_log_max_files: int + :param pod_max_pids: The maximum number of processes per pod. + :type pod_max_pids: int + """ + + _validation = { + 'container_log_max_files': {'minimum': 2}, + } + + _attribute_map = { + 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, + 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, + 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, + 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, + 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, + 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, + 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, + 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, + 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, + 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, + 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(KubeletConfig, self).__init__(**kwargs) + self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) + self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) + self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) + self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) + self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) + self.topology_manager_policy = kwargs.get('topology_manager_policy', None) + self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) + self.fail_swap_on = kwargs.get('fail_swap_on', None) + self.container_log_max_size_mb = kwargs.get('container_log_max_size_mb', None) + self.container_log_max_files = kwargs.get('container_log_max_files', None) + self.pod_max_pids = kwargs.get('pod_max_pids', None) + + +class LinuxOSConfig(msrest.serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :param sysctls: Sysctl settings for Linux agent nodes. + :type sysctls: ~azure.mgmt.containerservice.v2021_08_01.models.SysctlConfig + :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :type transparent_huge_page_enabled: str + :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :type transparent_huge_page_defrag: str + :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :type swap_file_size_mb: int + """ + + _attribute_map = { + 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, + 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, + 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, + 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(LinuxOSConfig, self).__init__(**kwargs) + self.sysctls = kwargs.get('sysctls', None) + self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) + self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) + self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) + + +class MaintenanceConfiguration(SubResource): + """See `planned maintenance `_ for more information about planned maintenance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData + :param time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :type time_in_week: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeInWeek] + :param not_allowed_time: Time slots on which upgrade is not allowed. + :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeSpan] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, + 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, + } + + def __init__( + self, + **kwargs + ): + super(MaintenanceConfiguration, self).__init__(**kwargs) + self.system_data = None + self.time_in_week = kwargs.get('time_in_week', None) + self.not_allowed_time = kwargs.get('not_allowed_time', None) + + +class MaintenanceConfigurationListResult(msrest.serialization.Model): + """The response from the List maintenance configurations operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of maintenance configurations. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration] + :ivar next_link: The URL to get the next set of maintenance configuration results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MaintenanceConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class Resource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class ManagedCluster(Resource): + """Managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The managed cluster SKU. + :type sku: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKU + :param extended_location: The extended location of the Virtual Machine. + :type extended_location: ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocation + :param identity: The identity of the managed cluster, if configured. + :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterIdentity + :ivar provisioning_state: The current provisioning state. + :vartype provisioning_state: str + :ivar power_state: The Power State of the cluster. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :ivar max_agent_pools: The max number of agent pools for the managed cluster. + :vartype max_agent_pools: int + :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + cannot be skipped. All upgrades must be performed sequentially by major version number. For + example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> + 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :type kubernetes_version: str + :param dns_prefix: This cannot be updated once the Managed Cluster has been created. + :type dns_prefix: str + :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :type fqdn_subdomain: str + :ivar fqdn: The FQDN of the master pool. + :vartype fqdn: str + :ivar private_fqdn: The FQDN of private cluster. + :vartype private_fqdn: str + :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) + headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. + This special FQDN supports CORS, allowing the Azure Portal to function properly. + :vartype azure_portal_fqdn: str + :param agent_pool_profiles: The agent pool properties. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAgentPoolProfile] + :param linux_profile: The profile for Linux VMs in the Managed Cluster. + :type linux_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceLinuxProfile + :param windows_profile: The profile for Windows VMs in the Managed Cluster. + :type windows_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterWindowsProfile + :param service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :type service_principal_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :param addon_profiles: The profile of managed cluster add-on. + :type addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfile] + :param pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :type pod_identity_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProfile + :param node_resource_group: The name of the resource group containing agent pool nodes. + :type node_resource_group: str + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :type enable_rbac: bool + :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :type enable_pod_security_policy: bool + :param network_profile: The network configuration profile. + :type network_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceNetworkProfile + :param aad_profile: The Azure Active Directory configuration. + :type aad_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile + :param auto_upgrade_profile: The auto upgrade configuration. + :type auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAutoUpgradeProfile + :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :type auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPropertiesAutoScalerProfile + :param api_server_access_profile: The access profile for managed cluster API server. + :type api_server_access_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAPIServerAccessProfile + :param disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :type disk_encryption_set_id: str + :param identity_profile: Identities associated with the cluster. + :type identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity] + :param private_link_resources: Private link resources associated with the cluster. + :type private_link_resources: + list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] + :param disable_local_accounts: If set to true, getting static credentials will be disabled for + this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details + see `disable local accounts + `_. + :type disable_local_accounts: bool + :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :type http_proxy_config: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterHTTPProxyConfig + :param security_profile: Security profile for the managed cluster. + :type security_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfile + :param public_network_access: Default value is 'Enabled' (case insensitive). Could be set to + 'Disabled' to enable private cluster. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or + ~azure.mgmt.containerservice.v2021_08_01.models.PublicNetworkAccess + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + 'max_agent_pools': {'readonly': True}, + 'fqdn': {'readonly': True}, + 'private_fqdn': {'readonly': True}, + 'azure_portal_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ManagedClusterSKU'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, + 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, + 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, + 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, + 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, + 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, + 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, + 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, + 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, + 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, + 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, + 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, + 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, + 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, + 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, + 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, + 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, + 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, + 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, + 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'ManagedClusterSecurityProfile'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedCluster, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.extended_location = kwargs.get('extended_location', None) + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.power_state = None + self.max_agent_pools = None + self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.dns_prefix = kwargs.get('dns_prefix', None) + self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) + self.fqdn = None + self.private_fqdn = None + self.azure_portal_fqdn = None + self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.linux_profile = kwargs.get('linux_profile', None) + self.windows_profile = kwargs.get('windows_profile', None) + self.service_principal_profile = kwargs.get('service_principal_profile', None) + self.addon_profiles = kwargs.get('addon_profiles', None) + self.pod_identity_profile = kwargs.get('pod_identity_profile', None) + self.node_resource_group = kwargs.get('node_resource_group', None) + self.enable_rbac = kwargs.get('enable_rbac', None) + self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) + self.network_profile = kwargs.get('network_profile', None) + self.aad_profile = kwargs.get('aad_profile', None) + self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) + self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) + self.api_server_access_profile = kwargs.get('api_server_access_profile', None) + self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) + self.identity_profile = kwargs.get('identity_profile', None) + self.private_link_resources = kwargs.get('private_link_resources', None) + self.disable_local_accounts = kwargs.get('disable_local_accounts', None) + self.http_proxy_config = kwargs.get('http_proxy_config', None) + self.security_profile = kwargs.get('security_profile', None) + self.public_network_access = kwargs.get('public_network_access', None) + + +class ManagedClusterAADProfile(msrest.serialization.Model): + """For more details see `managed AAD on AKS `_. + + :param managed: Whether to enable managed AAD. + :type managed: bool + :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :type enable_azure_rbac: bool + :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :type admin_group_object_i_ds: list[str] + :param client_app_id: The client AAD application ID. + :type client_app_id: str + :param server_app_id: The server AAD application ID. + :type server_app_id: str + :param server_app_secret: The server AAD application secret. + :type server_app_secret: str + :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :type tenant_id: str + """ + + _attribute_map = { + 'managed': {'key': 'managed', 'type': 'bool'}, + 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, + 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, + 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, + 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, + 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, + 'tenant_id': {'key': 'tenantID', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAADProfile, self).__init__(**kwargs) + self.managed = kwargs.get('managed', None) + self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) + self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) + self.client_app_id = kwargs.get('client_app_id', None) + self.server_app_id = kwargs.get('server_app_id', None) + self.server_app_secret = kwargs.get('server_app_secret', None) + self.tenant_id = kwargs.get('tenant_id', None) + + +class ManagedClusterAccessProfile(Resource): + """Managed cluster Access Profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param kube_config: Base64-encoded Kubernetes configuration file. + :type kube_config: bytearray + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAccessProfile, self).__init__(**kwargs) + self.kube_config = kwargs.get('kube_config', None) + + +class ManagedClusterAddonProfile(msrest.serialization.Model): + """A Kubernetes add-on profile for a managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the add-on is enabled or not. + :type enabled: bool + :param config: Key-value pairs for configuring an add-on. + :type config: dict[str, str] + :ivar identity: Information of user assigned identity used by this add-on. + :vartype identity: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfileIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAddonProfile, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.config = kwargs.get('config', None) + self.identity = None + + +class UserAssignedIdentity(msrest.serialization.Model): + """Details about a user assigned identity. + + :param resource_id: The resource ID of the user assigned identity. + :type resource_id: str + :param client_id: The client ID of the user assigned identity. + :type client_id: str + :param object_id: The object ID of the user assigned identity. + :type object_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.client_id = kwargs.get('client_id', None) + self.object_id = kwargs.get('object_id', None) + + +class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): + """Information of user assigned identity used by this add-on. + + :param resource_id: The resource ID of the user assigned identity. + :type resource_id: str + :param client_id: The client ID of the user assigned identity. + :type client_id: str + :param object_id: The object ID of the user assigned identity. + :type object_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) + + +class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): + """Properties for the container service agent pool profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + """ + + _validation = { + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'maxPods', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_sku': {'key': 'osSKU', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.vm_size = kwargs.get('vm_size', None) + self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) + self.os_disk_type = kwargs.get('os_disk_type', None) + self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) + self.workload_runtime = kwargs.get('workload_runtime', None) + self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) + self.pod_subnet_id = kwargs.get('pod_subnet_id', None) + self.max_pods = kwargs.get('max_pods', None) + self.os_type = kwargs.get('os_type', "Linux") + self.os_sku = kwargs.get('os_sku', None) + self.max_count = kwargs.get('max_count', None) + self.min_count = kwargs.get('min_count', None) + self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) + self.scale_down_mode = kwargs.get('scale_down_mode', None) + self.type = kwargs.get('type', None) + self.mode = kwargs.get('mode', None) + self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.node_image_version = None + self.upgrade_settings = kwargs.get('upgrade_settings', None) + self.provisioning_state = None + self.power_state = None + self.availability_zones = kwargs.get('availability_zones', None) + self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) + self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) + self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") + self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") + self.spot_max_price = kwargs.get('spot_max_price', -1) + self.tags = kwargs.get('tags', None) + self.node_labels = kwargs.get('node_labels', None) + self.node_taints = kwargs.get('node_taints', None) + self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) + self.kubelet_config = kwargs.get('kubelet_config', None) + self.linux_os_config = kwargs.get('linux_os_config', None) + self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) + self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) + self.enable_fips = kwargs.get('enable_fips', None) + self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) + self.creation_data = kwargs.get('creation_data', None) + + +class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): + """Profile for the container service agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :param name: Required. Windows agent pool names must be 6 characters or less. + :type name: str + """ + + _validation = { + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'maxPods', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_sku': {'key': 'osSKU', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): + """Access profile for managed cluster API server. + + :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :type authorized_ip_ranges: list[str] + :param enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :type enable_private_cluster: bool + :param private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :type private_dns_zone: str + :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + cluster or not. + :type enable_private_cluster_public_fqdn: bool + :param disable_run_command: Whether to disable run command for the cluster or not. + :type disable_run_command: bool + """ + + _attribute_map = { + 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, + 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, + 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, + 'enable_private_cluster_public_fqdn': {'key': 'enablePrivateClusterPublicFQDN', 'type': 'bool'}, + 'disable_run_command': {'key': 'disableRunCommand', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) + self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) + self.enable_private_cluster = kwargs.get('enable_private_cluster', None) + self.private_dns_zone = kwargs.get('private_dns_zone', None) + self.enable_private_cluster_public_fqdn = kwargs.get('enable_private_cluster_public_fqdn', None) + self.disable_run_command = kwargs.get('disable_run_command', None) + + +class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): + """Auto upgrade profile for a managed cluster. + + :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel + `_. Possible + values include: "rapid", "stable", "patch", "node-image", "none". + :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_08_01.models.UpgradeChannel + """ + + _attribute_map = { + 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) + self.upgrade_channel = kwargs.get('upgrade_channel', None) + + +class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): + """Cluster HTTP proxy configuration. + + :param http_proxy: The HTTP proxy server endpoint to use. + :type http_proxy: str + :param https_proxy: The HTTPS proxy server endpoint to use. + :type https_proxy: str + :param no_proxy: The endpoints that should not go through proxy. + :type no_proxy: list[str] + :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :type trusted_ca: str + """ + + _attribute_map = { + 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, + 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, + 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, + 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) + self.http_proxy = kwargs.get('http_proxy', None) + self.https_proxy = kwargs.get('https_proxy', None) + self.no_proxy = kwargs.get('no_proxy', None) + self.trusted_ca = kwargs.get('trusted_ca', None) + + +class ManagedClusterIdentity(msrest.serialization.Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity which is used by master + components. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is used by master + components. + :vartype tenant_id: str + :param type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ResourceIdentityType + :param user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ManagedClusterListResult(msrest.serialization.Model): + """The response from the List Managed Clusters operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of managed clusters. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :ivar next_link: The URL to get the next set of managed cluster results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagedCluster]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): + """Profile of the managed cluster load balancer. + + :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :type managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :type outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :type outbound_i_ps: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :type effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :type allocated_outbound_ports: int + :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :type idle_timeout_in_minutes: int + :param enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + cluster or not. + :type enable_multiple_standard_load_balancers: bool + """ + + _validation = { + 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, + 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + } + + _attribute_map = { + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, + 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, + 'enable_multiple_standard_load_balancers': {'key': 'enableMultipleStandardLoadBalancers', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) + self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) + self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) + self.outbound_i_ps = kwargs.get('outbound_i_ps', None) + self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) + self.enable_multiple_standard_load_balancers = kwargs.get('enable_multiple_standard_load_balancers', None) + + +class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): + """Desired managed outbound IPs for the cluster load balancer. + + :param count: The desired number of outbound IPs created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :type count: int + """ + + _validation = { + 'count': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) + self.count = kwargs.get('count', 1) + + +class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): + """Desired outbound IP Prefix resources for the cluster load balancer. + + :param public_ip_prefixes: A list of public IP prefix resources. + :type public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + """ + + _attribute_map = { + 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) + self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) + + +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): + """Desired outbound IP resources for the cluster load balancer. + + :param public_i_ps: A list of public IP resources. + :type public_i_ps: list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + """ + + _attribute_map = { + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) + self.public_i_ps = kwargs.get('public_i_ps', None) + + +class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): + """Profile of the managed outbound IP resources of the managed cluster. + + :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must + be in the range of 1 to 16 (inclusive). The default value is 1. + :type count: int + """ + + _validation = { + 'count': {'maximum': 16, 'minimum': 1}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) + self.count = kwargs.get('count', 1) + + +class ManagedClusterNATGatewayProfile(msrest.serialization.Model): + """Profile of the managed cluster NAT gateway. + + :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster + NAT gateway. + :type managed_outbound_ip_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterManagedOutboundIPProfile + :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. + :type effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + :type idle_timeout_in_minutes: int + """ + + _validation = { + 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + } + + _attribute_map = { + 'managed_outbound_ip_profile': {'key': 'managedOutboundIPProfile', 'type': 'ManagedClusterManagedOutboundIPProfile'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) + self.managed_outbound_ip_profile = kwargs.get('managed_outbound_ip_profile', None) + self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 4) + + +class ManagedClusterPodIdentity(msrest.serialization.Model): + """Details about the pod identity assigned to the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the pod identity. + :type name: str + :param namespace: Required. The namespace of the pod identity. + :type namespace: str + :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :type binding_selector: str + :param identity: Required. The user assigned identity details. + :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity + :ivar provisioning_state: The current provisioning state of the pod identity. Possible values + include: "Assigned", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningState + :ivar provisioning_info: + :vartype provisioning_info: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningInfo + """ + + _validation = { + 'name': {'required': True}, + 'namespace': {'required': True}, + 'identity': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'provisioning_info': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentity, self).__init__(**kwargs) + self.name = kwargs['name'] + self.namespace = kwargs['namespace'] + self.binding_selector = kwargs.get('binding_selector', None) + self.identity = kwargs['identity'] + self.provisioning_state = None + self.provisioning_info = None + + +class ManagedClusterPodIdentityException(msrest.serialization.Model): + """See `disable AAD Pod Identity for a specific Pod/Application `_ for more details. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the pod identity exception. + :type name: str + :param namespace: Required. The namespace of the pod identity exception. + :type namespace: str + :param pod_labels: Required. The pod labels to match. + :type pod_labels: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'namespace': {'required': True}, + 'pod_labels': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentityException, self).__init__(**kwargs) + self.name = kwargs['name'] + self.namespace = kwargs['namespace'] + self.pod_labels = kwargs['pod_labels'] + + +class ManagedClusterPodIdentityProfile(msrest.serialization.Model): + """See `use AAD pod identity `_ for more details on pod identity integration. + + :param enabled: Whether the pod identity addon is enabled. + :type enabled: bool + :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :type allow_network_plugin_kubenet: bool + :param user_assigned_identities: The pod identities to use in the cluster. + :type user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentity] + :param user_assigned_identity_exceptions: The pod identity exceptions to allow. + :type user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityException] + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, + 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.allow_network_plugin_kubenet = kwargs.get('allow_network_plugin_kubenet', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) + + +class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): + """An error response from the pod identity provisioning. + + :param error: Details about the error. + :type error: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningErrorBody'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): + """An error response from the pod identity provisioning. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ManagedClusterPodIdentityProvisioningErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): + """ManagedClusterPodIdentityProvisioningInfo. + + :param error: Pod identity assignment error (if any). + :type error: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningError'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): + """The list of available upgrade versions. + + All required parameters must be populated in order to send to Azure. + + :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param name: The Agent Pool name. + :type name: str + :param os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param upgrades: List of orchestrator types and versions available for upgrade. + :type upgrades: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ + + _validation = { + 'kubernetes_version': {'required': True}, + 'os_type': {'required': True}, + } + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) + self.kubernetes_version = kwargs['kubernetes_version'] + self.name = kwargs.get('name', None) + self.os_type = kwargs.get('os_type', "Linux") + self.upgrades = kwargs.get('upgrades', None) + + +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): + """ManagedClusterPoolUpgradeProfileUpgradesItem. + + :param kubernetes_version: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether the Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) + self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.is_preview = kwargs.get('is_preview', None) + + +class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): + """Parameters to be applied to the cluster-autoscaler when enabled. + + :param balance_similar_node_groups: Valid values are 'true' and 'false'. + :type balance_similar_node_groups: str + :param expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :type expander: str or ~azure.mgmt.containerservice.v2021_08_01.models.Expander + :param max_empty_bulk_delete: The default is 10. + :type max_empty_bulk_delete: str + :param max_graceful_termination_sec: The default is 600. + :type max_graceful_termination_sec: str + :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type max_node_provision_time: str + :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :type max_total_unready_percentage: str + :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :type new_pod_scale_up_delay: str + :param ok_total_unready_count: This must be an integer. The default is 3. + :type ok_total_unready_count: str + :param scan_interval: The default is '10'. Values must be an integer number of seconds. + :type scan_interval: str + :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_add: str + :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_delete: str + :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_failure: str + :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_unneeded_time: str + :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_unready_time: str + :param scale_down_utilization_threshold: The default is '0.5'. + :type scale_down_utilization_threshold: str + :param skip_nodes_with_local_storage: The default is true. + :type skip_nodes_with_local_storage: str + :param skip_nodes_with_system_pods: The default is true. + :type skip_nodes_with_system_pods: str + """ + + _attribute_map = { + 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, + 'expander': {'key': 'expander', 'type': 'str'}, + 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, + 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, + 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, + 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, + 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, + 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, + 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, + 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, + 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, + 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, + 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, + 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, + 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, + 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, + 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) + self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) + self.expander = kwargs.get('expander', None) + self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) + self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) + self.max_node_provision_time = kwargs.get('max_node_provision_time', None) + self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) + self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) + self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) + self.scan_interval = kwargs.get('scan_interval', None) + self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) + self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) + self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) + self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) + self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) + self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) + self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) + self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) + + +class ManagedClusterSecurityProfile(msrest.serialization.Model): + """Security profile for the container service cluster. + + :param azure_defender: Azure Defender settings for the security profile. + :type azure_defender: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfileAzureDefender + """ + + _attribute_map = { + 'azure_defender': {'key': 'azureDefender', 'type': 'ManagedClusterSecurityProfileAzureDefender'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterSecurityProfile, self).__init__(**kwargs) + self.azure_defender = kwargs.get('azure_defender', None) + + +class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): + """Azure Defender settings for the security profile. + + :param enabled: Whether to enable Azure Defender. + :type enabled: bool + :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Azure Defender. When Azure Defender is enabled, this field is required and + must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. + :type log_analytics_workspace_resource_id: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'log_analytics_workspace_resource_id': {'key': 'logAnalyticsWorkspaceResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.log_analytics_workspace_resource_id = kwargs.get('log_analytics_workspace_resource_id', None) + + +class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): + """Information about a service principal identity for the cluster to use for manipulating Azure APIs. + + All required parameters must be populated in order to send to Azure. + + :param client_id: Required. The ID for the service principal. + :type client_id: str + :param secret: The secret password associated with the service principal in plain text. + :type secret: str + """ + + _validation = { + 'client_id': {'required': True}, + } + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) + self.client_id = kwargs['client_id'] + self.secret = kwargs.get('secret', None) + + +class ManagedClusterSKU(msrest.serialization.Model): + """The SKU of a Managed Cluster. + + :param name: The name of a managed cluster SKU. Possible values include: "Basic". + :type name: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUName + :param tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :type tier: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterSKU, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class ManagedClusterUpgradeProfile(msrest.serialization.Model): + """The list of available upgrades for compute pools. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the upgrade profile. + :vartype id: str + :ivar name: The name of the upgrade profile. + :vartype name: str + :ivar type: The type of the upgrade profile. + :vartype type: str + :param control_plane_profile: Required. The list of available upgrade versions for the control + plane. + :type control_plane_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile + :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'control_plane_profile': {'required': True}, + 'agent_pool_profiles': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.control_plane_profile = kwargs['control_plane_profile'] + self.agent_pool_profiles = kwargs['agent_pool_profiles'] + + +class ManagedClusterWindowsProfile(msrest.serialization.Model): + """Profile for Windows VMs in the managed cluster. + + All required parameters must be populated in order to send to Azure. + + :param admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :type admin_username: str + :param admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :type admin_password: str + :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :type license_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.LicenseType + :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :type enable_csi_proxy: bool + """ + + _validation = { + 'admin_username': {'required': True}, + } + + _attribute_map = { + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterWindowsProfile, self).__init__(**kwargs) + self.admin_username = kwargs['admin_username'] + self.admin_password = kwargs.get('admin_password', None) + self.license_type = kwargs.get('license_type', None) + self.enable_csi_proxy = kwargs.get('enable_csi_proxy', None) + + +class ManagedServiceIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """ManagedServiceIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class OperationListResult(msrest.serialization.Model): + """The List Operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of operations. + :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.OperationValue] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationValue]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + + +class OperationValue(msrest.serialization.Model): + """Describes the properties of a Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the operation. + :vartype origin: str + :ivar name: The name of the operation. + :vartype name: str + :ivar operation: The display name of the operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class OSOptionProfile(msrest.serialization.Model): + """The OS option profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the OS option resource. + :vartype id: str + :ivar name: The name of the OS option resource. + :vartype name: str + :ivar type: The type of the OS option resource. + :vartype type: str + :param os_option_property_list: Required. The list of OS options. + :type os_option_property_list: + list[~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProperty] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'os_option_property_list': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, + } + + def __init__( + self, + **kwargs + ): + super(OSOptionProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.os_option_property_list = kwargs['os_option_property_list'] + + +class OSOptionProperty(msrest.serialization.Model): + """OS option property. + + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. The OS type. + :type os_type: str + :param enable_fips_image: Required. Whether the image is FIPS-enabled. + :type enable_fips_image: bool + """ + + _validation = { + 'os_type': {'required': True}, + 'enable_fips_image': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'os-type', 'type': 'str'}, + 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(OSOptionProperty, self).__init__(**kwargs) + self.os_type = kwargs['os_type'] + self.enable_fips_image = kwargs['enable_fips_image'] + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Egress endpoints which AKS agent nodes connect to for common purpose. + + :param category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :type category: str + :param endpoints: The endpoints that AKS agent nodes connect to. + :type endpoints: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.endpoints = kwargs.get('endpoints', None) + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of OutboundEnvironmentEndpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PowerState(msrest.serialization.Model): + """Describes the Power State of the cluster. + + :param code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :type code: str or ~azure.mgmt.containerservice.v2021_08_01.models.Code + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PowerState, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + + +class PrivateEndpoint(msrest.serialization.Model): + """Private endpoint which a connection belongs to. + + :param id: The resource ID of the private endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class PrivateEndpointConnection(msrest.serialization.Model): + """A private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private endpoint connection. + :vartype id: str + :ivar name: The name of the private endpoint connection. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", + "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionProvisioningState + :param private_endpoint: The resource of private endpoint. + :type private_endpoint: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """A list of private endpoint connections. + + :param value: The collection value. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The ID of the private link resource. + :type id: str + :param name: The name of the private link resource. + :type name: str + :param type: The resource type. + :type type: str + :param group_id: The group ID of the resource. + :type group_id: str + :param required_members: The RequiredMembers of the resource. + :type required_members: list[str] + :ivar private_link_service_id: The private link service ID of the resource, this field is + exposed only to NRP internally. + :vartype private_link_service_id: str + """ + + _validation = { + 'private_link_service_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.group_id = kwargs.get('group_id', None) + self.required_members = kwargs.get('required_members', None) + self.private_link_service_id = None + + +class PrivateLinkResourcesListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: The collection value. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """The state of a private link service connection. + + :param status: The private link service connection status. Possible values include: "Pending", + "Approved", "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.containerservice.v2021_08_01.models.ConnectionStatus + :param description: The private link service connection description. + :type description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + + +class ResourceReference(msrest.serialization.Model): + """A reference to an Azure resource. + + :param id: The fully qualified Azure resource id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class RunCommandRequest(msrest.serialization.Model): + """A run command request. + + All required parameters must be populated in order to send to Azure. + + :param command: Required. The command to run. + :type command: str + :param context: A base64 encoded zip file containing the files required by the command. + :type context: str + :param cluster_token: AuthToken issued for AKS AAD Server App. + :type cluster_token: str + """ + + _validation = { + 'command': {'required': True}, + } + + _attribute_map = { + 'command': {'key': 'command', 'type': 'str'}, + 'context': {'key': 'context', 'type': 'str'}, + 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandRequest, self).__init__(**kwargs) + self.command = kwargs['command'] + self.context = kwargs.get('context', None) + self.cluster_token = kwargs.get('cluster_token', None) + + +class RunCommandResult(msrest.serialization.Model): + """run command result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The command id. + :vartype id: str + :ivar provisioning_state: provisioning State. + :vartype provisioning_state: str + :ivar exit_code: The exit code of the command. + :vartype exit_code: int + :ivar started_at: The time when the command started. + :vartype started_at: ~datetime.datetime + :ivar finished_at: The time when the command finished. + :vartype finished_at: ~datetime.datetime + :ivar logs: The command output. + :vartype logs: str + :ivar reason: An explanation of why provisioningState is set to failed (if so). + :vartype reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'exit_code': {'readonly': True}, + 'started_at': {'readonly': True}, + 'finished_at': {'readonly': True}, + 'logs': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, + 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, + 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, + 'logs': {'key': 'properties.logs', 'type': 'str'}, + 'reason': {'key': 'properties.reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandResult, self).__init__(**kwargs) + self.id = None + self.provisioning_state = None + self.exit_code = None + self.started_at = None + self.finished_at = None + self.logs = None + self.reason = None + + +class Snapshot(Resource): + """A node pool snapshot resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this snapshot. + :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData + :param creation_data: CreationData to be used to specify the source agent pool resource ID to + create this snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :param snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: + "NodePool". Default value: "NodePool". + :type snapshot_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.SnapshotType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'snapshot_type': {'key': 'properties.snapshotType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Snapshot, self).__init__(**kwargs) + self.system_data = None + self.creation_data = kwargs.get('creation_data', None) + self.snapshot_type = kwargs.get('snapshot_type', "NodePool") + + +class SnapshotListResult(msrest.serialization.Model): + """The response from the List Snapshots operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of snapshots. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.Snapshot] + :ivar next_link: The URL to get the next set of snapshot results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class SysctlConfig(msrest.serialization.Model): + """Sysctl settings for Linux agent nodes. + + :param net_core_somaxconn: Sysctl setting net.core.somaxconn. + :type net_core_somaxconn: int + :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :type net_core_netdev_max_backlog: int + :param net_core_rmem_default: Sysctl setting net.core.rmem_default. + :type net_core_rmem_default: int + :param net_core_rmem_max: Sysctl setting net.core.rmem_max. + :type net_core_rmem_max: int + :param net_core_wmem_default: Sysctl setting net.core.wmem_default. + :type net_core_wmem_default: int + :param net_core_wmem_max: Sysctl setting net.core.wmem_max. + :type net_core_wmem_max: int + :param net_core_optmem_max: Sysctl setting net.core.optmem_max. + :type net_core_optmem_max: int + :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :type net_ipv4_tcp_max_syn_backlog: int + :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :type net_ipv4_tcp_max_tw_buckets: int + :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :type net_ipv4_tcp_fin_timeout: int + :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :type net_ipv4_tcp_keepalive_time: int + :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :type net_ipv4_tcp_keepalive_probes: int + :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :type net_ipv4_tcpkeepalive_intvl: int + :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :type net_ipv4_tcp_tw_reuse: bool + :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :type net_ipv4_ip_local_port_range: str + :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :type net_ipv4_neigh_default_gc_thresh1: int + :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :type net_ipv4_neigh_default_gc_thresh2: int + :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :type net_ipv4_neigh_default_gc_thresh3: int + :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :type net_netfilter_nf_conntrack_max: int + :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :type net_netfilter_nf_conntrack_buckets: int + :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :type fs_inotify_max_user_watches: int + :param fs_file_max: Sysctl setting fs.file-max. + :type fs_file_max: int + :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :type fs_aio_max_nr: int + :param fs_nr_open: Sysctl setting fs.nr_open. + :type fs_nr_open: int + :param kernel_threads_max: Sysctl setting kernel.threads-max. + :type kernel_threads_max: int + :param vm_max_map_count: Sysctl setting vm.max_map_count. + :type vm_max_map_count: int + :param vm_swappiness: Sysctl setting vm.swappiness. + :type vm_swappiness: int + :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :type vm_vfs_cache_pressure: int + """ + + _attribute_map = { + 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, + 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, + 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, + 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, + 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, + 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, + 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, + 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, + 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, + 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, + 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, + 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, + 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, + 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, + 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, + 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, + 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, + 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, + 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, + 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, + 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, + 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, + 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, + 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, + 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, + 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, + 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, + 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SysctlConfig, self).__init__(**kwargs) + self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) + self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) + self.net_core_rmem_default = kwargs.get('net_core_rmem_default', None) + self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) + self.net_core_wmem_default = kwargs.get('net_core_wmem_default', None) + self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) + self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) + self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) + self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) + self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) + self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) + self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) + self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) + self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) + self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) + self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) + self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) + self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) + self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) + self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) + self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) + self.fs_file_max = kwargs.get('fs_file_max', None) + self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) + self.fs_nr_open = kwargs.get('fs_nr_open', None) + self.kernel_threads_max = kwargs.get('kernel_threads_max', None) + self.vm_max_map_count = kwargs.get('vm_max_map_count', None) + self.vm_swappiness = kwargs.get('vm_swappiness', None) + self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :param created_at: The UTC timestamp of resource creation. + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TagsObject(msrest.serialization.Model): + """Tags object for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(TagsObject, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class TimeInWeek(msrest.serialization.Model): + """Time in a week. + + :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :type day: str or ~azure.mgmt.containerservice.v2021_08_01.models.WeekDay + :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :type hour_slots: list[int] + """ + + _attribute_map = { + 'day': {'key': 'day', 'type': 'str'}, + 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, + } + + def __init__( + self, + **kwargs + ): + super(TimeInWeek, self).__init__(**kwargs) + self.day = kwargs.get('day', None) + self.hour_slots = kwargs.get('hour_slots', None) + + +class TimeSpan(msrest.serialization.Model): + """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + + :param start: The start of a time span. + :type start: ~datetime.datetime + :param end: The end of a time span. + :type end: ~datetime.datetime + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'iso-8601'}, + 'end': {'key': 'end', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(TimeSpan, self).__init__(**kwargs) + self.start = kwargs.get('start', None) + self.end = kwargs.get('end', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py new file mode 100644 index 000000000000..0086dd7d2680 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py @@ -0,0 +1,4281 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +import msrest.serialization + +from ._container_service_client_enums import * + + +class SubResource(msrest.serialization.Model): + """Reference to another subresource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AgentPool(SubResource): + """Agent Pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :type type_properties_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'count': {'key': 'properties.count', 'type': 'int'}, + 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'properties.workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, + 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, + 'min_count': {'key': 'properties.minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'properties.scaleDownMode', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, + 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'properties.enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "WorkloadRuntime"]] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + os_sku: Optional[Union[str, "OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "ScaleDownMode"]] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + spot_max_price: Optional[float] = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["KubeletConfig"] = None, + linux_os_config: Optional["LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, + creation_data: Optional["CreationData"] = None, + **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.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + self.type_properties_type = type_properties_type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.node_image_version = None + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = None + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + + +class AgentPoolAvailableVersions(msrest.serialization.Model): + """The list of available versions for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the agent pool version list. + :vartype id: str + :ivar name: The name of the agent pool version list. + :vartype name: str + :ivar type: Type of the agent pool version list. + :vartype type: str + :param agent_pool_versions: List of versions available for agent pool. + :type agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, + } + + def __init__( + self, + *, + 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: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'default': {'key': 'default', 'type': 'bool'}, + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + *, + 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.v2021_08_01.models.AgentPool] + :ivar next_link: The URL to get the next set of agent pool results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AgentPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + 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: The ID of the agent pool upgrade profile. + :vartype id: str + :ivar name: The name of the agent pool upgrade profile. + :vartype name: str + :ivar type: The type of the agent pool upgrade profile. + :vartype type: str + :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param upgrades: List of orchestrator types and versions available for upgrade. + :type upgrades: + list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :param latest_node_image_version: The latest AKS supported node image version. + :type latest_node_image_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kubernetes_version': {'required': True}, + 'os_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, + 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + 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: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether the Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + *, + 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: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). + If a percentage is specified, it is the percentage of the total agent pool size at the time of + the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is + 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :type max_surge: str + """ + + _attribute_map = { + 'max_surge': {'key': 'maxSurge', 'type': 'str'}, + } + + def __init__( + self, + *, + max_surge: Optional[str] = None, + **kwargs + ): + super(AgentPoolUpgradeSettings, self).__init__(**kwargs) + self.max_surge = max_surge + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Container service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.containerservice.v2021_08_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + 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.v2021_08_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. The SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshConfiguration + """ + + _validation = { + 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, + 'ssh': {'required': True}, + } + + _attribute_map = { + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, + } + + def __init__( + self, + *, + 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.v2021_08_01.models.Count + :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :type dns_prefix: str + :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :type vm_size: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMSizeTypes + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :type vnet_subnet_id: str + :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :type first_consecutive_static_ip: str + :param storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :type storage_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceStorageProfileTypes + :ivar fqdn: FQDN for the master pool. + :vartype fqdn: str + """ + + _validation = { + 'dns_prefix': {'required': True}, + 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + } + + def __init__( + self, + *, + 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 the Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :type network_plugin: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPlugin + :param network_policy: Network policy used for building the Kubernetes network. Possible values + include: "calico", "azure". + :type network_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPolicy + :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. + Possible values include: "transparent", "bridge". + :type network_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkMode + :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :type pod_cidr: str + :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + not overlap with any Subnet IP ranges. + :type service_cidr: str + :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :type dns_service_ip: str + :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :type docker_bridge_cidr: str + :param outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default + value: "loadBalancer". + :type outbound_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OutboundType + :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.LoadBalancerSku + :param load_balancer_profile: Profile of the cluster load balancer. + :type load_balancer_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfile + :param nat_gateway_profile: Profile of the cluster NAT gateway. + :type nat_gateway_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterNATGatewayProfile + """ + + _validation = { + 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, + 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + } + + _attribute_map = { + 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, + 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, + 'network_mode': {'key': 'networkMode', 'type': 'str'}, + 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, + 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, + 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, + 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + 'outbound_type': {'key': 'outboundType', 'type': 'str'}, + 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, + 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, + 'nat_gateway_profile': {'key': 'natGatewayProfile', 'type': 'ManagedClusterNATGatewayProfile'}, + } + + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "NetworkMode"]] = None, + pod_cidr: Optional[str] = "10.244.0.0/16", + service_cidr: Optional[str] = "10.0.0.0/16", + dns_service_ip: Optional[str] = "10.0.0.10", + docker_bridge_cidr: Optional[str] = "172.17.0.1/16", + outbound_type: Optional[Union[str, "OutboundType"]] = "loadBalancer", + load_balancer_sku: Optional[Union[str, "LoadBalancerSku"]] = None, + load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, + nat_gateway_profile: Optional["ManagedClusterNATGatewayProfile"] = None, + **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 + self.nat_gateway_profile = nat_gateway_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. A maximum of 1 key may be specified. + :type public_keys: + list[~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshPublicKey] + """ + + _validation = { + 'public_keys': {'required': True}, + } + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, + } + + def __init__( + self, + *, + 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 CreationData(msrest.serialization.Model): + """Data used when creating a target resource from a source resource. + + :param source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :type source_resource_id: str + """ + + _attribute_map = { + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + source_resource_id: Optional[str] = None, + **kwargs + ): + super(CreationData, self).__init__(**kwargs) + self.source_resource_id = source_resource_id + + +class CredentialResult(msrest.serialization.Model): + """The credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the credential. + :vartype name: str + :ivar value: Base64-encoded Kubernetes configuration file. + :vartype value: bytearray + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'bytearray'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialResult, self).__init__(**kwargs) + self.name = None + self.value = None + + +class CredentialResults(msrest.serialization.Model): + """The list credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_08_01.models.CredentialResult] + """ + + _validation = { + 'kubeconfigs': {'readonly': True}, + } + + _attribute_map = { + 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialResults, self).__init__(**kwargs) + self.kubeconfigs = None + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that AKS agent nodes are reaching at. + + :param domain_name: The domain name of the dependency. + :type domain_name: str + :param endpoint_details: The Ports and Protocols used when connecting to domainName. + :type endpoint_details: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[List["EndpointDetail"]] = None, + **kwargs + ): + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = domain_name + self.endpoint_details = endpoint_details + + +class EndpointDetail(msrest.serialization.Model): + """connect information from the AKS agent nodes to a single endpoint. + + :param ip_address: An IP Address that Domain Name currently resolves to. + :type ip_address: str + :param port: The port an endpoint is connected to. + :type port: int + :param protocol: The protocol used for connection. + :type protocol: str + :param description: Description of the detail. + :type description: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = ip_address + self.port = port + self.protocol = protocol + self.description = description + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "ExtendedLocationTypes"]] = None, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = type + + +class KubeletConfig(msrest.serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :type cpu_manager_policy: str + :param cpu_cfs_quota: The default is true. + :type cpu_cfs_quota: bool + :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :type cpu_cfs_quota_period: str + :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + 85%. + :type image_gc_high_threshold: int + :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + is 80%. + :type image_gc_low_threshold: int + :param topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :type topology_manager_policy: str + :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\ ). + :type allowed_unsafe_sysctls: list[str] + :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :type fail_swap_on: bool + :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + is rotated. + :type container_log_max_size_mb: int + :param container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :type container_log_max_files: int + :param pod_max_pids: The maximum number of processes per pod. + :type pod_max_pids: int + """ + + _validation = { + 'container_log_max_files': {'minimum': 2}, + } + + _attribute_map = { + 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, + 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, + 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, + 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, + 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, + 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, + 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, + 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, + 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, + 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, + 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, + } + + def __init__( + self, + *, + cpu_manager_policy: Optional[str] = None, + cpu_cfs_quota: Optional[bool] = None, + cpu_cfs_quota_period: Optional[str] = None, + image_gc_high_threshold: Optional[int] = None, + image_gc_low_threshold: Optional[int] = None, + topology_manager_policy: Optional[str] = None, + allowed_unsafe_sysctls: Optional[List[str]] = None, + fail_swap_on: Optional[bool] = None, + container_log_max_size_mb: Optional[int] = None, + container_log_max_files: Optional[int] = None, + pod_max_pids: Optional[int] = None, + **kwargs + ): + super(KubeletConfig, self).__init__(**kwargs) + self.cpu_manager_policy = cpu_manager_policy + self.cpu_cfs_quota = cpu_cfs_quota + self.cpu_cfs_quota_period = cpu_cfs_quota_period + self.image_gc_high_threshold = image_gc_high_threshold + self.image_gc_low_threshold = image_gc_low_threshold + self.topology_manager_policy = topology_manager_policy + self.allowed_unsafe_sysctls = allowed_unsafe_sysctls + self.fail_swap_on = fail_swap_on + self.container_log_max_size_mb = container_log_max_size_mb + self.container_log_max_files = container_log_max_files + self.pod_max_pids = pod_max_pids + + +class LinuxOSConfig(msrest.serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :param sysctls: Sysctl settings for Linux agent nodes. + :type sysctls: ~azure.mgmt.containerservice.v2021_08_01.models.SysctlConfig + :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :type transparent_huge_page_enabled: str + :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :type transparent_huge_page_defrag: str + :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :type swap_file_size_mb: int + """ + + _attribute_map = { + 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, + 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, + 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, + 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, + } + + def __init__( + self, + *, + sysctls: Optional["SysctlConfig"] = None, + transparent_huge_page_enabled: Optional[str] = None, + transparent_huge_page_defrag: Optional[str] = None, + swap_file_size_mb: Optional[int] = None, + **kwargs + ): + super(LinuxOSConfig, self).__init__(**kwargs) + self.sysctls = sysctls + self.transparent_huge_page_enabled = transparent_huge_page_enabled + self.transparent_huge_page_defrag = transparent_huge_page_defrag + self.swap_file_size_mb = swap_file_size_mb + + +class MaintenanceConfiguration(SubResource): + """See `planned maintenance `_ for more information about planned maintenance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData + :param time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :type time_in_week: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeInWeek] + :param not_allowed_time: Time slots on which upgrade is not allowed. + :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeSpan] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, + 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, + } + + def __init__( + self, + *, + time_in_week: Optional[List["TimeInWeek"]] = None, + not_allowed_time: Optional[List["TimeSpan"]] = None, + **kwargs + ): + super(MaintenanceConfiguration, self).__init__(**kwargs) + self.system_data = None + self.time_in_week = time_in_week + self.not_allowed_time = not_allowed_time + + +class MaintenanceConfigurationListResult(msrest.serialization.Model): + """The response from the List maintenance configurations operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of maintenance configurations. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration] + :ivar next_link: The URL to get the next set of maintenance configuration results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["MaintenanceConfiguration"]] = None, + **kwargs + ): + super(MaintenanceConfigurationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Resource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :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): + """Managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The managed cluster SKU. + :type sku: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKU + :param extended_location: The extended location of the Virtual Machine. + :type extended_location: ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocation + :param identity: The identity of the managed cluster, if configured. + :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterIdentity + :ivar provisioning_state: The current provisioning state. + :vartype provisioning_state: str + :ivar power_state: The Power State of the cluster. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :ivar max_agent_pools: The max number of agent pools for the managed cluster. + :vartype max_agent_pools: int + :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + cannot be skipped. All upgrades must be performed sequentially by major version number. For + example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> + 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :type kubernetes_version: str + :param dns_prefix: This cannot be updated once the Managed Cluster has been created. + :type dns_prefix: str + :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :type fqdn_subdomain: str + :ivar fqdn: The FQDN of the master pool. + :vartype fqdn: str + :ivar private_fqdn: The FQDN of private cluster. + :vartype private_fqdn: str + :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) + headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. + This special FQDN supports CORS, allowing the Azure Portal to function properly. + :vartype azure_portal_fqdn: str + :param agent_pool_profiles: The agent pool properties. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAgentPoolProfile] + :param linux_profile: The profile for Linux VMs in the Managed Cluster. + :type linux_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceLinuxProfile + :param windows_profile: The profile for Windows VMs in the Managed Cluster. + :type windows_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterWindowsProfile + :param service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :type service_principal_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :param addon_profiles: The profile of managed cluster add-on. + :type addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfile] + :param pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :type pod_identity_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProfile + :param node_resource_group: The name of the resource group containing agent pool nodes. + :type node_resource_group: str + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :type enable_rbac: bool + :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :type enable_pod_security_policy: bool + :param network_profile: The network configuration profile. + :type network_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceNetworkProfile + :param aad_profile: The Azure Active Directory configuration. + :type aad_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile + :param auto_upgrade_profile: The auto upgrade configuration. + :type auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAutoUpgradeProfile + :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :type auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPropertiesAutoScalerProfile + :param api_server_access_profile: The access profile for managed cluster API server. + :type api_server_access_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAPIServerAccessProfile + :param disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :type disk_encryption_set_id: str + :param identity_profile: Identities associated with the cluster. + :type identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity] + :param private_link_resources: Private link resources associated with the cluster. + :type private_link_resources: + list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] + :param disable_local_accounts: If set to true, getting static credentials will be disabled for + this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details + see `disable local accounts + `_. + :type disable_local_accounts: bool + :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :type http_proxy_config: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterHTTPProxyConfig + :param security_profile: Security profile for the managed cluster. + :type security_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfile + :param public_network_access: Default value is 'Enabled' (case insensitive). Could be set to + 'Disabled' to enable private cluster. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or + ~azure.mgmt.containerservice.v2021_08_01.models.PublicNetworkAccess + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + 'max_agent_pools': {'readonly': True}, + 'fqdn': {'readonly': True}, + 'private_fqdn': {'readonly': True}, + 'azure_portal_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ManagedClusterSKU'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, + 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, + 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, + 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, + 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, + 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, + 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, + 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, + 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, + 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, + 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, + 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, + 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, + 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, + 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, + 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, + 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, + 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, + 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, + 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'ManagedClusterSecurityProfile'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["ManagedClusterSKU"] = None, + extended_location: Optional["ExtendedLocation"] = None, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: Optional[str] = None, + fqdn_subdomain: Optional[str] = None, + agent_pool_profiles: Optional[List["ManagedClusterAgentPoolProfile"]] = None, + linux_profile: Optional["ContainerServiceLinuxProfile"] = None, + windows_profile: Optional["ManagedClusterWindowsProfile"] = None, + service_principal_profile: Optional["ManagedClusterServicePrincipalProfile"] = None, + addon_profiles: Optional[Dict[str, "ManagedClusterAddonProfile"]] = None, + pod_identity_profile: Optional["ManagedClusterPodIdentityProfile"] = None, + 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_upgrade_profile: Optional["ManagedClusterAutoUpgradeProfile"] = None, + auto_scaler_profile: Optional["ManagedClusterPropertiesAutoScalerProfile"] = None, + api_server_access_profile: Optional["ManagedClusterAPIServerAccessProfile"] = None, + disk_encryption_set_id: Optional[str] = None, + identity_profile: Optional[Dict[str, "UserAssignedIdentity"]] = None, + private_link_resources: Optional[List["PrivateLinkResource"]] = None, + disable_local_accounts: Optional[bool] = None, + http_proxy_config: Optional["ManagedClusterHTTPProxyConfig"] = None, + security_profile: Optional["ManagedClusterSecurityProfile"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + **kwargs + ): + super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.extended_location = extended_location + self.identity = identity + self.provisioning_state = None + self.power_state = None + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn_subdomain = fqdn_subdomain + self.fqdn = None + self.private_fqdn = None + self.azure_portal_fqdn = None + self.agent_pool_profiles = agent_pool_profiles + self.linux_profile = linux_profile + self.windows_profile = windows_profile + self.service_principal_profile = service_principal_profile + self.addon_profiles = addon_profiles + self.pod_identity_profile = pod_identity_profile + self.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_upgrade_profile = auto_upgrade_profile + self.auto_scaler_profile = auto_scaler_profile + self.api_server_access_profile = api_server_access_profile + self.disk_encryption_set_id = disk_encryption_set_id + self.identity_profile = identity_profile + self.private_link_resources = private_link_resources + self.disable_local_accounts = disable_local_accounts + self.http_proxy_config = http_proxy_config + self.security_profile = security_profile + self.public_network_access = public_network_access + + +class ManagedClusterAADProfile(msrest.serialization.Model): + """For more details see `managed AAD on AKS `_. + + :param managed: Whether to enable managed AAD. + :type managed: bool + :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :type enable_azure_rbac: bool + :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :type admin_group_object_i_ds: list[str] + :param client_app_id: The client AAD application ID. + :type client_app_id: str + :param server_app_id: The server AAD application ID. + :type server_app_id: str + :param server_app_secret: The server AAD application secret. + :type server_app_secret: str + :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :type tenant_id: str + """ + + _attribute_map = { + 'managed': {'key': 'managed', 'type': 'bool'}, + 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, + 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, + 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, + 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, + 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, + 'tenant_id': {'key': 'tenantID', 'type': 'str'}, + } + + def __init__( + self, + *, + 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.v2021_08_01.models.ManagedClusterAddonProfileIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + } + + def __init__( + self, + *, + 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): + """Details about a user assigned identity. + + :param resource_id: The resource ID of the user assigned identity. + :type resource_id: str + :param client_id: The client ID of the user assigned identity. + :type client_id: str + :param object_id: The object ID of the user assigned identity. + :type object_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + *, + 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 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + """ + + _validation = { + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'maxPods', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_sku': {'key': 'osSKU', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "WorkloadRuntime"]] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + os_sku: Optional[Union[str, "OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "ScaleDownMode"]] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + spot_max_price: Optional[float] = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["KubeletConfig"] = None, + linux_os_config: Optional["LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, + creation_data: Optional["CreationData"] = None, + **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.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + self.type = type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.node_image_version = None + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = None + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + + +class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): + """Profile for the container service agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :param name: Required. Windows agent pool names must be 6 characters or less. + :type name: str + """ + + _validation = { + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'maxPods', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_sku': {'key': 'osSKU', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "WorkloadRuntime"]] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + os_sku: Optional[Union[str, "OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "ScaleDownMode"]] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + spot_max_price: Optional[float] = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["KubeletConfig"] = None, + linux_os_config: Optional["LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, + creation_data: Optional["CreationData"] = None, + **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, kubelet_disk_type=kubelet_disk_type, workload_runtime=workload_runtime, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, os_sku=os_sku, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, scale_down_mode=scale_down_mode, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, node_public_ip_prefix_id=node_public_ip_prefix_id, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, enable_ultra_ssd=enable_ultra_ssd, enable_fips=enable_fips, gpu_instance_profile=gpu_instance_profile, creation_data=creation_data, **kwargs) + self.name = name + + +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): + """Access profile for managed cluster API server. + + :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :type authorized_ip_ranges: list[str] + :param enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :type enable_private_cluster: bool + :param private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :type private_dns_zone: str + :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + cluster or not. + :type enable_private_cluster_public_fqdn: bool + :param disable_run_command: Whether to disable run command for the cluster or not. + :type disable_run_command: bool + """ + + _attribute_map = { + 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, + 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, + 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, + 'enable_private_cluster_public_fqdn': {'key': 'enablePrivateClusterPublicFQDN', 'type': 'bool'}, + 'disable_run_command': {'key': 'disableRunCommand', 'type': 'bool'}, + } + + def __init__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + private_dns_zone: Optional[str] = None, + enable_private_cluster_public_fqdn: Optional[bool] = None, + disable_run_command: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) + self.authorized_ip_ranges = authorized_ip_ranges + self.enable_private_cluster = enable_private_cluster + self.private_dns_zone = private_dns_zone + self.enable_private_cluster_public_fqdn = enable_private_cluster_public_fqdn + self.disable_run_command = disable_run_command + + +class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): + """Auto upgrade profile for a managed cluster. + + :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel + `_. Possible + values include: "rapid", "stable", "patch", "node-image", "none". + :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_08_01.models.UpgradeChannel + """ + + _attribute_map = { + 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, + } + + def __init__( + self, + *, + upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, + **kwargs + ): + super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) + self.upgrade_channel = upgrade_channel + + +class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): + """Cluster HTTP proxy configuration. + + :param http_proxy: The HTTP proxy server endpoint to use. + :type http_proxy: str + :param https_proxy: The HTTPS proxy server endpoint to use. + :type https_proxy: str + :param no_proxy: The endpoints that should not go through proxy. + :type no_proxy: list[str] + :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :type trusted_ca: str + """ + + _attribute_map = { + 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, + 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, + 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, + 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, + } + + def __init__( + self, + *, + http_proxy: Optional[str] = None, + https_proxy: Optional[str] = None, + no_proxy: Optional[List[str]] = None, + trusted_ca: Optional[str] = None, + **kwargs + ): + super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) + self.http_proxy = http_proxy + self.https_proxy = https_proxy + self.no_proxy = no_proxy + self.trusted_ca = trusted_ca + + +class ManagedClusterIdentity(msrest.serialization.Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity which is used by master + components. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is used by master + components. + :vartype tenant_id: str + :param type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ResourceIdentityType + :param user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ManagedServiceIdentityUserAssignedIdentitiesValue"]] = 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 ManagedClusterListResult(msrest.serialization.Model): + """The response from the List Managed Clusters operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of managed clusters. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :ivar next_link: The URL to get the next set of managed cluster results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagedCluster]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + 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.v2021_08_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :type outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :type outbound_i_ps: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :type effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :type allocated_outbound_ports: int + :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :type idle_timeout_in_minutes: int + :param enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + cluster or not. + :type enable_multiple_standard_load_balancers: bool + """ + + _validation = { + 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, + 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + } + + _attribute_map = { + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, + 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, + 'enable_multiple_standard_load_balancers': {'key': 'enableMultipleStandardLoadBalancers', 'type': 'bool'}, + } + + def __init__( + self, + *, + managed_outbound_i_ps: Optional["ManagedClusterLoadBalancerProfileManagedOutboundIPs"] = None, + outbound_ip_prefixes: Optional["ManagedClusterLoadBalancerProfileOutboundIPPrefixes"] = None, + outbound_i_ps: Optional["ManagedClusterLoadBalancerProfileOutboundIPs"] = None, + effective_outbound_i_ps: Optional[List["ResourceReference"]] = None, + allocated_outbound_ports: Optional[int] = 0, + idle_timeout_in_minutes: Optional[int] = 30, + enable_multiple_standard_load_balancers: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) + self.managed_outbound_i_ps = managed_outbound_i_ps + self.outbound_ip_prefixes = outbound_ip_prefixes + self.outbound_i_ps = outbound_i_ps + self.effective_outbound_i_ps = effective_outbound_i_ps + self.allocated_outbound_ports = allocated_outbound_ports + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_multiple_standard_load_balancers = enable_multiple_standard_load_balancers + + +class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): + """Desired managed outbound IPs for the cluster load balancer. + + :param count: The desired number of outbound IPs created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :type count: int + """ + + _validation = { + 'count': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + *, + 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.v2021_08_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.v2021_08_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 ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): + """Profile of the managed outbound IP resources of the managed cluster. + + :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must + be in the range of 1 to 16 (inclusive). The default value is 1. + :type count: int + """ + + _validation = { + 'count': {'maximum': 16, 'minimum': 1}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + *, + count: Optional[int] = 1, + **kwargs + ): + super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) + self.count = count + + +class ManagedClusterNATGatewayProfile(msrest.serialization.Model): + """Profile of the managed cluster NAT gateway. + + :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster + NAT gateway. + :type managed_outbound_ip_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterManagedOutboundIPProfile + :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. + :type effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + :type idle_timeout_in_minutes: int + """ + + _validation = { + 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + } + + _attribute_map = { + 'managed_outbound_ip_profile': {'key': 'managedOutboundIPProfile', 'type': 'ManagedClusterManagedOutboundIPProfile'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, + } + + def __init__( + self, + *, + managed_outbound_ip_profile: Optional["ManagedClusterManagedOutboundIPProfile"] = None, + effective_outbound_i_ps: Optional[List["ResourceReference"]] = None, + idle_timeout_in_minutes: Optional[int] = 4, + **kwargs + ): + super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) + self.managed_outbound_ip_profile = managed_outbound_ip_profile + self.effective_outbound_i_ps = effective_outbound_i_ps + self.idle_timeout_in_minutes = idle_timeout_in_minutes + + +class ManagedClusterPodIdentity(msrest.serialization.Model): + """Details about the pod identity assigned to the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the pod identity. + :type name: str + :param namespace: Required. The namespace of the pod identity. + :type namespace: str + :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :type binding_selector: str + :param identity: Required. The user assigned identity details. + :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity + :ivar provisioning_state: The current provisioning state of the pod identity. Possible values + include: "Assigned", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningState + :ivar provisioning_info: + :vartype provisioning_info: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningInfo + """ + + _validation = { + 'name': {'required': True}, + 'namespace': {'required': True}, + 'identity': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'provisioning_info': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, + } + + def __init__( + self, + *, + name: str, + namespace: str, + identity: "UserAssignedIdentity", + binding_selector: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPodIdentity, self).__init__(**kwargs) + self.name = name + self.namespace = namespace + self.binding_selector = binding_selector + self.identity = identity + self.provisioning_state = None + self.provisioning_info = None + + +class ManagedClusterPodIdentityException(msrest.serialization.Model): + """See `disable AAD Pod Identity for a specific Pod/Application `_ for more details. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the pod identity exception. + :type name: str + :param namespace: Required. The namespace of the pod identity exception. + :type namespace: str + :param pod_labels: Required. The pod labels to match. + :type pod_labels: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'namespace': {'required': True}, + 'pod_labels': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, + } + + def __init__( + self, + *, + name: str, + namespace: str, + pod_labels: Dict[str, str], + **kwargs + ): + super(ManagedClusterPodIdentityException, self).__init__(**kwargs) + self.name = name + self.namespace = namespace + self.pod_labels = pod_labels + + +class ManagedClusterPodIdentityProfile(msrest.serialization.Model): + """See `use AAD pod identity `_ for more details on pod identity integration. + + :param enabled: Whether the pod identity addon is enabled. + :type enabled: bool + :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :type allow_network_plugin_kubenet: bool + :param user_assigned_identities: The pod identities to use in the cluster. + :type user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentity] + :param user_assigned_identity_exceptions: The pod identity exceptions to allow. + :type user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityException] + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, + 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + allow_network_plugin_kubenet: Optional[bool] = None, + user_assigned_identities: Optional[List["ManagedClusterPodIdentity"]] = None, + user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, + **kwargs + ): + super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) + self.enabled = enabled + self.allow_network_plugin_kubenet = allow_network_plugin_kubenet + self.user_assigned_identities = user_assigned_identities + self.user_assigned_identity_exceptions = user_assigned_identity_exceptions + + +class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): + """An error response from the pod identity provisioning. + + :param error: Details about the error. + :type error: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningErrorBody'}, + } + + def __init__( + self, + *, + error: Optional["ManagedClusterPodIdentityProvisioningErrorBody"] = None, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) + self.error = error + + +class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): + """An error response from the pod identity provisioning. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ManagedClusterPodIdentityProvisioningErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["ManagedClusterPodIdentityProvisioningErrorBody"]] = None, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): + """ManagedClusterPodIdentityProvisioningInfo. + + :param error: Pod identity assignment error (if any). + :type error: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningError'}, + } + + def __init__( + self, + *, + error: Optional["ManagedClusterPodIdentityProvisioningError"] = None, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) + self.error = error + + +class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): + """The list of available upgrade versions. + + All required parameters must be populated in order to send to Azure. + + :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param name: The Agent Pool name. + :type name: str + :param os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param upgrades: List of orchestrator types and versions available for upgrade. + :type upgrades: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ + + _validation = { + 'kubernetes_version': {'required': True}, + 'os_type': {'required': True}, + } + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, + } + + def __init__( + self, + *, + 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: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether the Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + *, + 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: Valid values are 'true' and 'false'. + :type balance_similar_node_groups: str + :param expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :type expander: str or ~azure.mgmt.containerservice.v2021_08_01.models.Expander + :param max_empty_bulk_delete: The default is 10. + :type max_empty_bulk_delete: str + :param max_graceful_termination_sec: The default is 600. + :type max_graceful_termination_sec: str + :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type max_node_provision_time: str + :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :type max_total_unready_percentage: str + :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :type new_pod_scale_up_delay: str + :param ok_total_unready_count: This must be an integer. The default is 3. + :type ok_total_unready_count: str + :param scan_interval: The default is '10'. Values must be an integer number of seconds. + :type scan_interval: str + :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_add: str + :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_delete: str + :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_failure: str + :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_unneeded_time: str + :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_unready_time: str + :param scale_down_utilization_threshold: The default is '0.5'. + :type scale_down_utilization_threshold: str + :param skip_nodes_with_local_storage: The default is true. + :type skip_nodes_with_local_storage: str + :param skip_nodes_with_system_pods: The default is true. + :type skip_nodes_with_system_pods: str + """ + + _attribute_map = { + 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, + 'expander': {'key': 'expander', 'type': 'str'}, + 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, + 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, + 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, + 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, + 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, + 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, + 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, + 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, + 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, + 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, + 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, + 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, + 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, + 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, + 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, + } + + def __init__( + self, + *, + balance_similar_node_groups: Optional[str] = None, + expander: Optional[Union[str, "Expander"]] = None, + max_empty_bulk_delete: Optional[str] = None, + max_graceful_termination_sec: Optional[str] = None, + max_node_provision_time: Optional[str] = None, + max_total_unready_percentage: Optional[str] = None, + new_pod_scale_up_delay: Optional[str] = None, + ok_total_unready_count: Optional[str] = None, + scan_interval: Optional[str] = None, + scale_down_delay_after_add: Optional[str] = None, + scale_down_delay_after_delete: Optional[str] = None, + scale_down_delay_after_failure: Optional[str] = None, + scale_down_unneeded_time: Optional[str] = None, + scale_down_unready_time: Optional[str] = None, + scale_down_utilization_threshold: Optional[str] = None, + skip_nodes_with_local_storage: Optional[str] = None, + skip_nodes_with_system_pods: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) + self.balance_similar_node_groups = balance_similar_node_groups + self.expander = expander + self.max_empty_bulk_delete = max_empty_bulk_delete + self.max_graceful_termination_sec = max_graceful_termination_sec + self.max_node_provision_time = max_node_provision_time + self.max_total_unready_percentage = max_total_unready_percentage + self.new_pod_scale_up_delay = new_pod_scale_up_delay + self.ok_total_unready_count = ok_total_unready_count + self.scan_interval = scan_interval + self.scale_down_delay_after_add = scale_down_delay_after_add + self.scale_down_delay_after_delete = scale_down_delay_after_delete + self.scale_down_delay_after_failure = scale_down_delay_after_failure + self.scale_down_unneeded_time = scale_down_unneeded_time + self.scale_down_unready_time = scale_down_unready_time + self.scale_down_utilization_threshold = scale_down_utilization_threshold + self.skip_nodes_with_local_storage = skip_nodes_with_local_storage + self.skip_nodes_with_system_pods = skip_nodes_with_system_pods + + +class ManagedClusterSecurityProfile(msrest.serialization.Model): + """Security profile for the container service cluster. + + :param azure_defender: Azure Defender settings for the security profile. + :type azure_defender: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfileAzureDefender + """ + + _attribute_map = { + 'azure_defender': {'key': 'azureDefender', 'type': 'ManagedClusterSecurityProfileAzureDefender'}, + } + + def __init__( + self, + *, + azure_defender: Optional["ManagedClusterSecurityProfileAzureDefender"] = None, + **kwargs + ): + super(ManagedClusterSecurityProfile, self).__init__(**kwargs) + self.azure_defender = azure_defender + + +class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): + """Azure Defender settings for the security profile. + + :param enabled: Whether to enable Azure Defender. + :type enabled: bool + :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Azure Defender. When Azure Defender is enabled, this field is required and + must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. + :type log_analytics_workspace_resource_id: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'log_analytics_workspace_resource_id': {'key': 'logAnalyticsWorkspaceResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + log_analytics_workspace_resource_id: Optional[str] = None, + **kwargs + ): + super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) + self.enabled = enabled + self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id + + +class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): + """Information about a service principal identity for the cluster to use for manipulating Azure APIs. + + All required parameters must be populated in order to send to Azure. + + :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): + """The SKU of a Managed Cluster. + + :param name: The name of a managed cluster SKU. Possible values include: "Basic". + :type name: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUName + :param tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :type tier: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + 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: The ID of the upgrade profile. + :vartype id: str + :ivar name: The name of the upgrade profile. + :vartype name: str + :ivar type: The type of the upgrade profile. + :vartype type: str + :param control_plane_profile: Required. The list of available upgrade versions for the control + plane. + :type control_plane_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile + :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'control_plane_profile': {'required': True}, + 'agent_pool_profiles': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, + } + + def __init__( + self, + *, + 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 managed cluster. + + All required parameters must be populated in order to send to Azure. + + :param admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :type admin_username: str + :param admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :type admin_password: str + :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :type license_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.LicenseType + :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :type enable_csi_proxy: bool + """ + + _validation = { + 'admin_username': {'required': True}, + } + + _attribute_map = { + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, + } + + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + license_type: Optional[Union[str, "LicenseType"]] = None, + enable_csi_proxy: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterWindowsProfile, self).__init__(**kwargs) + self.admin_username = admin_username + self.admin_password = admin_password + self.license_type = license_type + self.enable_csi_proxy = enable_csi_proxy + + +class ManagedServiceIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """ManagedServiceIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class OperationListResult(msrest.serialization.Model): + """The List Operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of operations. + :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.OperationValue] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationValue]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + + +class OperationValue(msrest.serialization.Model): + """Describes the properties of a Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the operation. + :vartype origin: str + :ivar name: The name of the operation. + :vartype name: str + :ivar operation: The display name of the operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class OSOptionProfile(msrest.serialization.Model): + """The OS option profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the OS option resource. + :vartype id: str + :ivar name: The name of the OS option resource. + :vartype name: str + :ivar type: The type of the OS option resource. + :vartype type: str + :param os_option_property_list: Required. The list of OS options. + :type os_option_property_list: + list[~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProperty] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'os_option_property_list': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, + } + + def __init__( + self, + *, + os_option_property_list: List["OSOptionProperty"], + **kwargs + ): + super(OSOptionProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.os_option_property_list = os_option_property_list + + +class OSOptionProperty(msrest.serialization.Model): + """OS option property. + + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. The OS type. + :type os_type: str + :param enable_fips_image: Required. Whether the image is FIPS-enabled. + :type enable_fips_image: bool + """ + + _validation = { + 'os_type': {'required': True}, + 'enable_fips_image': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'os-type', 'type': 'str'}, + 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, + } + + def __init__( + self, + *, + os_type: str, + enable_fips_image: bool, + **kwargs + ): + super(OSOptionProperty, self).__init__(**kwargs) + self.os_type = os_type + self.enable_fips_image = enable_fips_image + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Egress endpoints which AKS agent nodes connect to for common purpose. + + :param category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :type category: str + :param endpoints: The endpoints that AKS agent nodes connect to. + :type endpoints: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["EndpointDependency"]] = None, + **kwargs + ): + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = category + self.endpoints = endpoints + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of OutboundEnvironmentEndpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["OutboundEnvironmentEndpoint"], + **kwargs + ): + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PowerState(msrest.serialization.Model): + """Describes the Power State of the cluster. + + :param code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :type code: str or ~azure.mgmt.containerservice.v2021_08_01.models.Code + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + *, + 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 of the 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.v2021_08_01.models.PrivateEndpointConnectionProvisioningState + :param private_endpoint: The resource of private endpoint. + :type private_endpoint: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__( + self, + *, + 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.v2021_08_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: The RequiredMembers of the resource. + :type required_members: list[str] + :ivar private_link_service_id: The private link service ID of the resource, this field is + exposed only to NRP internally. + :vartype private_link_service_id: str + """ + + _validation = { + 'private_link_service_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, + } + + def __init__( + self, + *, + 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.v2021_08_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.v2021_08_01.models.ConnectionStatus + :param description: The private link service connection description. + :type description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + 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 RunCommandRequest(msrest.serialization.Model): + """A run command request. + + All required parameters must be populated in order to send to Azure. + + :param command: Required. The command to run. + :type command: str + :param context: A base64 encoded zip file containing the files required by the command. + :type context: str + :param cluster_token: AuthToken issued for AKS AAD Server App. + :type cluster_token: str + """ + + _validation = { + 'command': {'required': True}, + } + + _attribute_map = { + 'command': {'key': 'command', 'type': 'str'}, + 'context': {'key': 'context', 'type': 'str'}, + 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, + } + + def __init__( + self, + *, + command: str, + context: Optional[str] = None, + cluster_token: Optional[str] = None, + **kwargs + ): + super(RunCommandRequest, self).__init__(**kwargs) + self.command = command + self.context = context + self.cluster_token = cluster_token + + +class RunCommandResult(msrest.serialization.Model): + """run command result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The command id. + :vartype id: str + :ivar provisioning_state: provisioning State. + :vartype provisioning_state: str + :ivar exit_code: The exit code of the command. + :vartype exit_code: int + :ivar started_at: The time when the command started. + :vartype started_at: ~datetime.datetime + :ivar finished_at: The time when the command finished. + :vartype finished_at: ~datetime.datetime + :ivar logs: The command output. + :vartype logs: str + :ivar reason: An explanation of why provisioningState is set to failed (if so). + :vartype reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'exit_code': {'readonly': True}, + 'started_at': {'readonly': True}, + 'finished_at': {'readonly': True}, + 'logs': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, + 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, + 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, + 'logs': {'key': 'properties.logs', 'type': 'str'}, + 'reason': {'key': 'properties.reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandResult, self).__init__(**kwargs) + self.id = None + self.provisioning_state = None + self.exit_code = None + self.started_at = None + self.finished_at = None + self.logs = None + self.reason = None + + +class Snapshot(Resource): + """A node pool snapshot resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this snapshot. + :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData + :param creation_data: CreationData to be used to specify the source agent pool resource ID to + create this snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :param snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: + "NodePool". Default value: "NodePool". + :type snapshot_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.SnapshotType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'snapshot_type': {'key': 'properties.snapshotType', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + creation_data: Optional["CreationData"] = None, + snapshot_type: Optional[Union[str, "SnapshotType"]] = "NodePool", + **kwargs + ): + super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) + self.system_data = None + self.creation_data = creation_data + self.snapshot_type = snapshot_type + + +class SnapshotListResult(msrest.serialization.Model): + """The response from the List Snapshots operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of snapshots. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.Snapshot] + :ivar next_link: The URL to get the next set of snapshot results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Snapshot"]] = None, + **kwargs + ): + super(SnapshotListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SysctlConfig(msrest.serialization.Model): + """Sysctl settings for Linux agent nodes. + + :param net_core_somaxconn: Sysctl setting net.core.somaxconn. + :type net_core_somaxconn: int + :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :type net_core_netdev_max_backlog: int + :param net_core_rmem_default: Sysctl setting net.core.rmem_default. + :type net_core_rmem_default: int + :param net_core_rmem_max: Sysctl setting net.core.rmem_max. + :type net_core_rmem_max: int + :param net_core_wmem_default: Sysctl setting net.core.wmem_default. + :type net_core_wmem_default: int + :param net_core_wmem_max: Sysctl setting net.core.wmem_max. + :type net_core_wmem_max: int + :param net_core_optmem_max: Sysctl setting net.core.optmem_max. + :type net_core_optmem_max: int + :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :type net_ipv4_tcp_max_syn_backlog: int + :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :type net_ipv4_tcp_max_tw_buckets: int + :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :type net_ipv4_tcp_fin_timeout: int + :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :type net_ipv4_tcp_keepalive_time: int + :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :type net_ipv4_tcp_keepalive_probes: int + :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :type net_ipv4_tcpkeepalive_intvl: int + :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :type net_ipv4_tcp_tw_reuse: bool + :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :type net_ipv4_ip_local_port_range: str + :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :type net_ipv4_neigh_default_gc_thresh1: int + :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :type net_ipv4_neigh_default_gc_thresh2: int + :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :type net_ipv4_neigh_default_gc_thresh3: int + :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :type net_netfilter_nf_conntrack_max: int + :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :type net_netfilter_nf_conntrack_buckets: int + :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :type fs_inotify_max_user_watches: int + :param fs_file_max: Sysctl setting fs.file-max. + :type fs_file_max: int + :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :type fs_aio_max_nr: int + :param fs_nr_open: Sysctl setting fs.nr_open. + :type fs_nr_open: int + :param kernel_threads_max: Sysctl setting kernel.threads-max. + :type kernel_threads_max: int + :param vm_max_map_count: Sysctl setting vm.max_map_count. + :type vm_max_map_count: int + :param vm_swappiness: Sysctl setting vm.swappiness. + :type vm_swappiness: int + :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :type vm_vfs_cache_pressure: int + """ + + _attribute_map = { + 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, + 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, + 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, + 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, + 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, + 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, + 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, + 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, + 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, + 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, + 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, + 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, + 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, + 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, + 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, + 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, + 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, + 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, + 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, + 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, + 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, + 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, + 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, + 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, + 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, + 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, + 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, + 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, + } + + def __init__( + self, + *, + net_core_somaxconn: Optional[int] = None, + net_core_netdev_max_backlog: Optional[int] = None, + net_core_rmem_default: Optional[int] = None, + net_core_rmem_max: Optional[int] = None, + net_core_wmem_default: Optional[int] = None, + net_core_wmem_max: Optional[int] = None, + net_core_optmem_max: Optional[int] = None, + net_ipv4_tcp_max_syn_backlog: Optional[int] = None, + net_ipv4_tcp_max_tw_buckets: Optional[int] = None, + net_ipv4_tcp_fin_timeout: Optional[int] = None, + net_ipv4_tcp_keepalive_time: Optional[int] = None, + net_ipv4_tcp_keepalive_probes: Optional[int] = None, + net_ipv4_tcpkeepalive_intvl: Optional[int] = None, + net_ipv4_tcp_tw_reuse: Optional[bool] = None, + net_ipv4_ip_local_port_range: Optional[str] = None, + net_ipv4_neigh_default_gc_thresh1: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh2: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh3: Optional[int] = None, + net_netfilter_nf_conntrack_max: Optional[int] = None, + net_netfilter_nf_conntrack_buckets: Optional[int] = None, + fs_inotify_max_user_watches: Optional[int] = None, + fs_file_max: Optional[int] = None, + fs_aio_max_nr: Optional[int] = None, + fs_nr_open: Optional[int] = None, + kernel_threads_max: Optional[int] = None, + vm_max_map_count: Optional[int] = None, + vm_swappiness: Optional[int] = None, + vm_vfs_cache_pressure: Optional[int] = None, + **kwargs + ): + super(SysctlConfig, self).__init__(**kwargs) + self.net_core_somaxconn = net_core_somaxconn + self.net_core_netdev_max_backlog = net_core_netdev_max_backlog + self.net_core_rmem_default = net_core_rmem_default + self.net_core_rmem_max = net_core_rmem_max + self.net_core_wmem_default = net_core_wmem_default + self.net_core_wmem_max = net_core_wmem_max + self.net_core_optmem_max = net_core_optmem_max + self.net_ipv4_tcp_max_syn_backlog = net_ipv4_tcp_max_syn_backlog + self.net_ipv4_tcp_max_tw_buckets = net_ipv4_tcp_max_tw_buckets + self.net_ipv4_tcp_fin_timeout = net_ipv4_tcp_fin_timeout + self.net_ipv4_tcp_keepalive_time = net_ipv4_tcp_keepalive_time + self.net_ipv4_tcp_keepalive_probes = net_ipv4_tcp_keepalive_probes + self.net_ipv4_tcpkeepalive_intvl = net_ipv4_tcpkeepalive_intvl + self.net_ipv4_tcp_tw_reuse = net_ipv4_tcp_tw_reuse + self.net_ipv4_ip_local_port_range = net_ipv4_ip_local_port_range + self.net_ipv4_neigh_default_gc_thresh1 = net_ipv4_neigh_default_gc_thresh1 + self.net_ipv4_neigh_default_gc_thresh2 = net_ipv4_neigh_default_gc_thresh2 + self.net_ipv4_neigh_default_gc_thresh3 = net_ipv4_neigh_default_gc_thresh3 + self.net_netfilter_nf_conntrack_max = net_netfilter_nf_conntrack_max + self.net_netfilter_nf_conntrack_buckets = net_netfilter_nf_conntrack_buckets + self.fs_inotify_max_user_watches = fs_inotify_max_user_watches + self.fs_file_max = fs_file_max + self.fs_aio_max_nr = fs_aio_max_nr + self.fs_nr_open = fs_nr_open + self.kernel_threads_max = kernel_threads_max + self.vm_max_map_count = vm_max_map_count + self.vm_swappiness = vm_swappiness + self.vm_vfs_cache_pressure = vm_vfs_cache_pressure + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :param created_at: The UTC timestamp of resource creation. + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class 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 + + +class TimeInWeek(msrest.serialization.Model): + """Time in a week. + + :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :type day: str or ~azure.mgmt.containerservice.v2021_08_01.models.WeekDay + :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :type hour_slots: list[int] + """ + + _attribute_map = { + 'day': {'key': 'day', 'type': 'str'}, + 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, + } + + def __init__( + self, + *, + day: Optional[Union[str, "WeekDay"]] = None, + hour_slots: Optional[List[int]] = None, + **kwargs + ): + super(TimeInWeek, self).__init__(**kwargs) + self.day = day + self.hour_slots = hour_slots + + +class TimeSpan(msrest.serialization.Model): + """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + + :param start: The start of a time span. + :type start: ~datetime.datetime + :param end: The end of a time span. + :type end: ~datetime.datetime + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'iso-8601'}, + 'end': {'key': 'end', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + start: Optional[datetime.datetime] = None, + end: Optional[datetime.datetime] = None, + **kwargs + ): + super(TimeSpan, self).__init__(**kwargs) + self.start = start + self.end = end diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/__init__.py new file mode 100644 index 000000000000..5e1e5e72fa59 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._snapshots_operations import SnapshotsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'MaintenanceConfigurationsOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ResolvePrivateLinkServiceIdOperations', + 'SnapshotsOperations', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..d83f6642250f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py @@ -0,0 +1,705 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AgentPoolsOperations(object): + """AgentPoolsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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): + 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. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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 specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPool, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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 in the specified managed cluster. + + Creates or updates an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param parameters: The agent pool to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + 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 + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 in the specified managed cluster. + + Deletes an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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 the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_upgrade_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolAvailableVersions, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_available_agent_pool_versions.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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"] + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either 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 + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..9e5a0bf49af2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py @@ -0,0 +1,323 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MaintenanceConfigurationsOperations(object): + """MaintenanceConfigurationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_managed_cluster( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MaintenanceConfigurationListResult"] + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_managed_cluster.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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('MaintenanceConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + config_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MaintenanceConfiguration" + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + config_name, # type: str + parameters, # type: "_models.MaintenanceConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.MaintenanceConfiguration" + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :param parameters: The maintenance configuration to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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, 'MaintenanceConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + resource_name, # type: str + config_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..e031f202d911 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py @@ -0,0 +1,1875 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ManagedClustersOperations(object): + """ManagedClustersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_os_options( + self, + location, # type: str + resource_type=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.OSOptionProfile" + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of a supported Azure region. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OSOptionProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OSOptionProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_os_options.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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('OSOptionProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + 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. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] + :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 = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] + :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 = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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 the upgrade profile of a managed cluster. + + Gets the upgrade profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_upgrade_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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. + + **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param role_name: The name of the role for managed cluster accessProfile resource. + :type role_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterAccessProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_access_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 + server_fqdn=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CredentialResults" + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 + server_fqdn=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CredentialResults" + """Lists the user credentials of a managed cluster. + + Lists the user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_user_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 + server_fqdn=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CredentialResults" + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The managed cluster to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + 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 + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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 = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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 tags on a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + 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 + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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 = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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 the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The service principal profile to set on the managed cluster. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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 = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._reset_aad_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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 the AAD Profile of a managed cluster. + + Reset the AAD Profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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] + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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] + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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] + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + def _run_command_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + request_payload, # type: "_models.RunCommandRequest" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._run_command_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request_payload, 'RunCommandRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + def begin_run_command( + self, + resource_group_name, # type: str + resource_name, # type: str + request_payload, # type: "_models.RunCommandRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RunCommandResult"] + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param request_payload: The run command request. + :type request_payload: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + 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('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + def get_command_result( + self, + resource_group_name, # type: str + resource_name, # type: str + command_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.RunCommandResult"] + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the Managed Cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param command_id: Id of the command. + :type command_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunCommandResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_command_result.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'commandId': self._serialize.url("command_id", command_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + def list_outbound_network_dependencies_endpoints( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OutboundEnvironmentEndpointCollection"] + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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('OutboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py new file mode 100644 index 000000000000..82667caa7f0d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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): + 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 operations. + + Gets a list of operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OperationListResult] + :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 = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_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/v2021_08_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..a30cbec19e12 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,367 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by 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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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): + 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. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: The updated private endpoint connection. + :type parameters: ~azure.mgmt.containerservice.v2021_08_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.v2021_08_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 = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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 a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, 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, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..9daaf5960b07 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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): + 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. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_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 = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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/v2021_08_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..652ce0ee7d87 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResolvePrivateLinkServiceIdOperations(object): + """ResolvePrivateLinkServiceIdOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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): + 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 for the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters required in order to resolve a private link service ID. + :type parameters: ~azure.mgmt.containerservice.v2021_08_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.v2021_08_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 = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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/v2021_08_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py new file mode 100644 index 000000000000..fdbe3b380e0f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py @@ -0,0 +1,449 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SnapshotsOperations(object): + """SnapshotsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_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): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotListResult"] + """Gets a list of snapshots in the specified subscription. + + Gets a list of snapshots in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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('SnapshotListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotListResult"] + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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('SnapshotListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Snapshot" + """Gets a snapshot. + + Gets a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.Snapshot" + **kwargs # type: Any + ): + # type: (...) -> "_models.Snapshot" + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The snapshot to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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, 'Snapshot') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.Snapshot" + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update snapshot Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", 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('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a snapshot. + + Deletes a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file