From aa0b237d8a87df161979369f123c425735a7b73c Mon Sep 17 00:00:00 2001 From: Qingqing Date: Mon, 6 May 2019 16:47:35 -0700 Subject: [PATCH] [AKS] Get versions + get upgrades + add "preview" suffix after preview k8s version (#671) --- src/aks-preview/HISTORY.md | 6 + .../azext_aks_preview/_client_factory.py | 2 +- src/aks-preview/azext_aks_preview/_format.py | 62 ++++++++-- src/aks-preview/azext_aks_preview/_help.py | 9 ++ src/aks-preview/azext_aks_preview/commands.py | 16 ++- src/aks-preview/azext_aks_preview/custom.py | 4 + .../tests/latest/test_aks_command_preview.py | 8 +- .../container_service_client.py | 2 + .../v2019_04_01/container_service_client.py | 5 + .../v2019_04_01/models/__init__.py | 22 +++- .../models/container_service_client_enums.py | 12 ++ .../container_service_network_profile.py | 6 + .../container_service_network_profile_py3.py | 8 +- .../v2019_04_01/models/managed_cluster.py | 9 +- .../models/managed_cluster_identity.py | 52 +++++++++ .../models/managed_cluster_identity_py3.py | 52 +++++++++ .../managed_cluster_pool_upgrade_profile.py | 5 +- ...anaged_cluster_pool_upgrade_profile_py3.py | 5 +- ...ster_pool_upgrade_profile_upgrades_item.py | 32 +++++ ..._pool_upgrade_profile_upgrades_item_py3.py | 32 +++++ .../v2019_04_01/models/managed_cluster_py3.py | 11 +- .../models/orchestrator_profile.py | 7 +- .../models/orchestrator_profile_py3.py | 9 +- .../models/orchestrator_version_profile.py | 53 +++++++++ ...rchestrator_version_profile_list_result.py | 53 +++++++++ ...strator_version_profile_list_result_py3.py | 53 +++++++++ .../orchestrator_version_profile_py3.py | 53 +++++++++ .../v2019_04_01/operations/__init__.py | 2 + .../container_services_operations.py | 109 ++++++++++++++++++ src/aks-preview/setup.py | 2 +- src/index.json | 45 ++++++++ 31 files changed, 716 insertions(+), 30 deletions(-) create mode 100644 src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_identity.py create mode 100644 src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_identity_py3.py create mode 100644 src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_upgrades_item.py create mode 100644 src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_upgrades_item_py3.py create mode 100644 src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile.py create mode 100644 src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_list_result.py create mode 100644 src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_list_result_py3.py create mode 100644 src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_py3.py create mode 100644 src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/operations/container_services_operations.py diff --git a/src/aks-preview/HISTORY.md b/src/aks-preview/HISTORY.md index 8350330c395..0980be6c8d6 100644 --- a/src/aks-preview/HISTORY.md +++ b/src/aks-preview/HISTORY.md @@ -2,6 +2,12 @@ Release History =============== +0.4.1 ++++++ +* Add `az aks get-versions -l location` to allow users to see all managed cluster versions. +* Add `az aks get-upgrades` to get all available versions to upgrade. +* Add '(preview)' suffix if kubernetes version is preview when using `get-versions` and `get-upgrades` + 0.4.0 +++++ * Add support for Azure policy add-on. diff --git a/src/aks-preview/azext_aks_preview/_client_factory.py b/src/aks-preview/azext_aks_preview/_client_factory.py index 029cba62f09..81b18624ac0 100644 --- a/src/aks-preview/azext_aks_preview/_client_factory.py +++ b/src/aks-preview/azext_aks_preview/_client_factory.py @@ -22,7 +22,7 @@ def cf_container_services(cli_ctx, *_): def get_container_service_client(cli_ctx, **_): - return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS) + return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW) def cf_managed_clusters(cli_ctx, *_): diff --git a/src/aks-preview/azext_aks_preview/_format.py b/src/aks-preview/azext_aks_preview/_format.py index bc1f6a711e9..e8f3b142f35 100644 --- a/src/aks-preview/azext_aks_preview/_format.py +++ b/src/aks-preview/azext_aks_preview/_format.py @@ -58,16 +58,23 @@ def aks_upgrades_table_format(result): # pylint: disable=import-error from jmespath import compile as compile_jmes, Options + preview = [] + for i, j in result.items(): + if i == "controlPlaneProfile": + # the reason why we choose "upgrades" obejct, since only it has the isPreview boolean. + for item in j["upgrades"]: + if item["isPreview"]: + preview.append(item["kubernetesVersion"]) # This expression assumes there is one node pool, and that the master and nodes upgrade in lockstep. parsed = compile_jmes("""{ name: name, resourceGroup: resourceGroup, - masterVersion: controlPlaneProfile.kubernetesVersion || `unknown`, - nodePoolVersion: agentPoolProfiles[0].kubernetesVersion || `unknown`, - upgrades: controlPlaneProfile.upgrades || [`None available`] | sort_versions(@) | join(`, `, @) + masterVersion: controlPlaneProfile.kubernetesVersion || `unknown` | set_preview(@), + nodePoolVersion: agentPoolProfiles[0].kubernetesVersion || `unknown` | set_preview(@), + upgrades: controlPlaneProfile.upgrades[].kubernetesVersion || [`None available`] | sort_versions(@) | set_preview_array(@) | join(`, `, @) }""") # use ordered dicts so headers are predictable - return parsed.search(result, Options(dict_cls=OrderedDict, custom_functions=_custom_functions())) + return parsed.search(result, Options(dict_cls=OrderedDict, custom_functions=_custom_functions(preview))) def aks_versions_table_format(result): @@ -75,21 +82,31 @@ def aks_versions_table_format(result): # pylint: disable=import-error from jmespath import compile as compile_jmes, Options + # get preview orchestrator version + preview = [] + for key, value in result.items(): + if key == "orchestrators": + for i in value: + if i["isPreview"]: + preview.append(i["orchestratorVersion"]) + parsed = compile_jmes("""orchestrators[].{ - kubernetesVersion: orchestratorVersion, - upgrades: upgrades[].orchestratorVersion || [`None available`] | sort_versions(@) | join(`, `, @) + kubernetesVersion: orchestratorVersion | set_preview(@), + upgrades: upgrades[].orchestratorVersion || [`None available`] | sort_versions(@) | set_preview_array(@) | join(`, `, @) }""") # use ordered dicts so headers are predictable - results = parsed.search(result, Options(dict_cls=OrderedDict, custom_functions=_custom_functions())) + results = parsed.search(result, Options(dict_cls=OrderedDict, custom_functions=_custom_functions(preview))) return sorted(results, key=lambda x: version_to_tuple(x.get('kubernetesVersion')), reverse=True) def version_to_tuple(v): """Quick-and-dirty sort function to handle simple semantic versions like 1.7.12 or 1.8.7.""" + if v.endswith('(preview)'): + return tuple(map(int, (v[:-9].split('.')))) return tuple(map(int, (v.split('.')))) -def _custom_functions(): +def _custom_functions(preview_versions): # pylint: disable=import-error from jmespath import functions @@ -103,4 +120,33 @@ def _func_sort_versions(self, s): # pylint: disable=no-self-use except (TypeError, ValueError): # if it wasn't sortable, return the input so the pipeline continues return s + @functions.signature({'types': ['array']}) + def _func_set_preview_array(self, s): # pylint: disable=no-self-use + """Custom JMESPath `set_preview_array` function that suffixes preview version""" + try: + res = [] + for version in s: + preview = False + for i in preview_versions: + if version == i: + res.append(version + "(preview)") + preview = True + break + if not preview: + res.append(version) + return res + except(TypeError, ValueError): + return s + + @functions.signature({'types': ['string']}) + def _func_set_preview(self, s): # pylint: disable=no-self-use + """Custom JMESPath `set_preview` function that suffixes preview version""" + try: + for i in preview_versions: + if s == i: + return s + "(preview)" + return s + except(TypeError, ValueError): + return s + return CustomFunctions() diff --git a/src/aks-preview/azext_aks_preview/_help.py b/src/aks-preview/azext_aks_preview/_help.py index f1fb771d1a9..10b435d5d8f 100644 --- a/src/aks-preview/azext_aks_preview/_help.py +++ b/src/aks-preview/azext_aks_preview/_help.py @@ -327,3 +327,12 @@ text: az aks enable-addons --addons virtual-node --name MyManagedCluster --resource-group MyResourceGroup --subnet-name VirtualNodeSubnet crafted: true """ + +helps['aks get-versions'] = """ +type: command +short-summary: Get the versions available for creating a managed Kubernetes cluster. +examples: + - name: Get the versions available for creating a managed Kubernetes cluster + text: az aks get-versions --location westus2 + crafted: true +""" diff --git a/src/aks-preview/azext_aks_preview/commands.py b/src/aks-preview/azext_aks_preview/commands.py index 4dc2a6f6ad4..1403ac4d5f9 100644 --- a/src/aks-preview/azext_aks_preview/commands.py +++ b/src/aks-preview/azext_aks_preview/commands.py @@ -6,9 +6,12 @@ from azure.cli.core.commands import CliCommandType from ._client_factory import cf_managed_clusters +from ._client_factory import cf_container_services from ._client_factory import cf_agent_pools from ._format import aks_show_table_format from ._format import aks_agentpool_show_table_format +from ._format import aks_versions_table_format +from ._format import aks_upgrades_table_format def load_command_table(self, _): @@ -19,13 +22,19 @@ def load_command_table(self, _): client_factory=cf_managed_clusters ) + container_services_sdk = CliCommandType( + operations_tmpl='azext_aks_preview.vendored_sdks.azure_mgmt_preview_aks.' + 'operations.container_service_operations#ContainerServicesOperations.{}', + client_factory=cf_container_services + ) + agent_pools_sdk = CliCommandType( operations_tmpl='azext_aks_preview.vendored_sdks.azure_mgmt_preview_aks.' 'operations.agent_pools_operations#AgentPoolsOperations.{}', client_factory=cf_managed_clusters ) - # AKS commands + # AKS managed cluster commands with self.command_group('aks', managed_clusters_sdk, client_factory=cf_managed_clusters) as g: g.custom_command('create', 'aks_create', supports_no_wait=True) g.custom_command('update', 'aks_update', supports_no_wait=True) @@ -36,8 +45,13 @@ def load_command_table(self, _): g.custom_command('upgrade', 'aks_upgrade', supports_no_wait=True, confirmation='Kubernetes may be unavailable during cluster upgrades.\n' + 'Are you sure you want to perform this operation?') + g.command('get-upgrades', 'get_upgrade_profile', table_transformer=aks_upgrades_table_format) g.wait_command('wait') + # AKS container service commands + with self.command_group('aks', container_services_sdk, client_factory=cf_container_services) as g: + g.custom_command('get-versions', 'aks_get_versions', table_transformer=aks_versions_table_format) + # AKS agent pool commands with self.command_group('aks nodepool', agent_pools_sdk, client_factory=cf_agent_pools) as g: g.custom_command('list', 'aks_agentpool_list') diff --git a/src/aks-preview/azext_aks_preview/custom.py b/src/aks-preview/azext_aks_preview/custom.py index 3ba4ae0b927..6bcfd03e9a3 100644 --- a/src/aks-preview/azext_aks_preview/custom.py +++ b/src/aks-preview/azext_aks_preview/custom.py @@ -1198,3 +1198,7 @@ def _update_addons(cmd, instance, subscription_id, resource_group_name, addons, instance.aad_profile = None return instance + + +def aks_get_versions(cmd, client, location): + return client.list_orchestrators(location, resource_type='managedClusters') diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_aks_command_preview.py b/src/aks-preview/azext_aks_preview/tests/latest/test_aks_command_preview.py index 31de9f01491..d7dd82901bd 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/test_aks_command_preview.py +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_aks_command_preview.py @@ -103,7 +103,13 @@ def test_aks_create_default_service_enable_autoscaler(self, resource_group, reso # delete self.cmd('aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()]) - + + def test_aks_get_versions(self): + # show k8s versions + self.cmd('aks get-versions -l {location}', checks=[ + self.exists('orchestrators[*].orchestratorVersion') + ]) + @classmethod def generate_ssh_keys(cls): TEST_SSH_KEY_PUB = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCbIg1guRHbI0lV11wWDt1r2cUdcNd27CJsg+SfgC7miZeubtwUhbsPdhMQsfDyhOWHq1+ZL0M+nJZV63d/1dhmhtgyOqejUwrPlzKhydsbrsdUor+JmNJDdW01v7BXHyuymT8G4s09jCasNOwiufbP/qp72ruu0bIA1nySsvlf9pCQAuFkAnVnf/rFhUlOkhtRpwcq8SUNY2zRHR/EKb/4NWY1JzR4sa3q2fWIJdrrX0DvLoa5g9bIEd4Df79ba7v+yiUBOS0zT2ll+z4g9izHK3EO5d8hL4jYxcjKs+wcslSYRWrascfscLgMlMGh0CdKeNTDjHpGPncaf3Z+FwwwjWeuiNBxv7bJo13/8B/098KlVDl4GZqsoBCEjPyJfV6hO0y/LkRGkk7oHWKgeWAfKtfLItRp00eZ4fcJNK9kCaSMmEugoZWcI7NGbZXzqFWqbpRI7NcDP9+WIQ+i9U5vqWsqd/zng4kbuAJ6UuKqIzB0upYrLShfQE3SAck8oaLhJqqq56VfDuASNpJKidV+zq27HfSBmbXnkR/5AK337dc3MXKJypoK/QPMLKUAP5XLPbs+NddJQV7EZXd29DLgp+fRIg3edpKdO7ZErWhv7d+3Kws+e1Y+ypmR2WIVSwVyBEUfgv2C8Ts9gnTF4pNcEY/S2aBicz5Ew2+jdyGNQQ== test@example.com\n" # pylint: disable=line-too-long diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/container_service_client.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/container_service_client.py index fdaec525528..b5c8973f16c 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/container_service_client.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/container_service_client.py @@ -156,6 +156,8 @@ def container_services(self): api_version = self._get_api_version('container_services') if api_version == '2017-07-01': from .v2017_07_01.operations import ContainerServicesOperations as OperationClass + elif api_version == "2019-04-01": + from .v2019_04_01.operations import ContainerServicesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/container_service_client.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/container_service_client.py index 1560293fc87..7f6a9856261 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/container_service_client.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/container_service_client.py @@ -16,6 +16,7 @@ from .operations.operations import Operations from .operations.managed_clusters_operations import ManagedClustersOperations from .operations.agent_pools_operations import AgentPoolsOperations +from .operations.container_services_operations import ContainerServicesOperations from . import models @@ -65,6 +66,8 @@ class ContainerServiceClient(SDKClient): :vartype managed_clusters: azure.mgmt.containerservice.v2019_04_01.operations.ManagedClustersOperations :ivar agent_pools: AgentPools operations :vartype agent_pools: azure.mgmt.containerservice.v2019_04_01.operations.AgentPoolsOperations + :ivar container_services: ContainerServices operations + :vartype container_services: azure.mgmt.containerservice.v2019_04_01.operations.ContainerServicesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -93,3 +96,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( self._client, self.config, self._serialize, self._deserialize) + self.container_services = ContainerServicesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/__init__.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/__init__.py index e87407ae0e9..741ab9ea8b7 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/__init__.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/__init__.py @@ -28,13 +28,17 @@ from .container_service_diagnostics_profile_py3 import ContainerServiceDiagnosticsProfile from .managed_cluster_addon_profile_py3 import ManagedClusterAddonProfile from .managed_cluster_aad_profile_py3 import ManagedClusterAADProfile + from .managed_cluster_identity_py3 import ManagedClusterIdentity from .managed_cluster_py3 import ManagedCluster - from .orchestrator_profile_py3 import OrchestratorProfile from .managed_cluster_access_profile_py3 import ManagedClusterAccessProfile + from .managed_cluster_pool_upgrade_profile_upgrades_item_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem from .managed_cluster_pool_upgrade_profile_py3 import ManagedClusterPoolUpgradeProfile from .managed_cluster_upgrade_profile_py3 import ManagedClusterUpgradeProfile from .credential_result_py3 import CredentialResult from .credential_results_py3 import CredentialResults + from .orchestrator_profile_py3 import OrchestratorProfile + from .orchestrator_version_profile_py3 import OrchestratorVersionProfile + from .orchestrator_version_profile_list_result_py3 import OrchestratorVersionProfileListResult except (SyntaxError, ImportError): from .operation_value import OperationValue from .resource import Resource @@ -54,13 +58,17 @@ from .container_service_diagnostics_profile import ContainerServiceDiagnosticsProfile from .managed_cluster_addon_profile import ManagedClusterAddonProfile from .managed_cluster_aad_profile import ManagedClusterAADProfile + from .managed_cluster_identity import ManagedClusterIdentity from .managed_cluster import ManagedCluster - from .orchestrator_profile import OrchestratorProfile from .managed_cluster_access_profile import ManagedClusterAccessProfile + from .managed_cluster_pool_upgrade_profile_upgrades_item import ManagedClusterPoolUpgradeProfileUpgradesItem from .managed_cluster_pool_upgrade_profile import ManagedClusterPoolUpgradeProfile from .managed_cluster_upgrade_profile import ManagedClusterUpgradeProfile from .credential_result import CredentialResult from .credential_results import CredentialResults + from .orchestrator_profile import OrchestratorProfile + from .orchestrator_version_profile import OrchestratorVersionProfile + from .orchestrator_version_profile_list_result import OrchestratorVersionProfileListResult from .operation_value_paged import OperationValuePaged from .managed_cluster_paged import ManagedClusterPaged from .agent_pool_paged import AgentPoolPaged @@ -71,6 +79,8 @@ AgentPoolType, NetworkPlugin, NetworkPolicy, + LoadBalancerSku, + ResourceIdentityType, ) __all__ = [ @@ -92,13 +102,17 @@ 'ContainerServiceDiagnosticsProfile', 'ManagedClusterAddonProfile', 'ManagedClusterAADProfile', + 'ManagedClusterIdentity', 'ManagedCluster', - 'OrchestratorProfile', 'ManagedClusterAccessProfile', + 'ManagedClusterPoolUpgradeProfileUpgradesItem', 'ManagedClusterPoolUpgradeProfile', 'ManagedClusterUpgradeProfile', 'CredentialResult', 'CredentialResults', + 'OrchestratorProfile', + 'OrchestratorVersionProfile', + 'OrchestratorVersionProfileListResult', 'OperationValuePaged', 'ManagedClusterPaged', 'AgentPoolPaged', @@ -108,4 +122,6 @@ 'AgentPoolType', 'NetworkPlugin', 'NetworkPolicy', + 'LoadBalancerSku', + 'ResourceIdentityType', ] diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_client_enums.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_client_enums.py index f317ac627e8..08f49fc4a07 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_client_enums.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_client_enums.py @@ -218,3 +218,15 @@ class NetworkPolicy(str, Enum): calico = "calico" azure = "azure" + + +class LoadBalancerSku(str, Enum): + + standard = "standard" + basic = "basic" + + +class ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + none = "None" diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_network_profile.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_network_profile.py index bc02c1be43b..39f46d59a3b 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_network_profile.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_network_profile.py @@ -39,6 +39,10 @@ class ContainerServiceNetworkProfile(Model): bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. Default value: "172.17.0.1/16" . :type docker_bridge_cidr: str + :param load_balancer_sku: The load balancer sku for the managed cluster. + Possible values include: 'standard', 'basic' + :type load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_04_01.models.LoadBalancerSku """ _validation = { @@ -55,6 +59,7 @@ class ContainerServiceNetworkProfile(Model): 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, } def __init__(self, **kwargs): @@ -65,3 +70,4 @@ def __init__(self, **kwargs): self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") + self.load_balancer_sku = kwargs.get('load_balancer_sku', None) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_network_profile_py3.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_network_profile_py3.py index 67208510389..2876203d783 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_network_profile_py3.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/container_service_network_profile_py3.py @@ -39,6 +39,10 @@ class ContainerServiceNetworkProfile(Model): bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. Default value: "172.17.0.1/16" . :type docker_bridge_cidr: str + :param load_balancer_sku: The load balancer sku for the managed cluster. + Possible values include: 'standard', 'basic' + :type load_balancer_sku: str or + ~azure.mgmt.containerservice.v2019_04_01.models.LoadBalancerSku """ _validation = { @@ -55,9 +59,10 @@ class ContainerServiceNetworkProfile(Model): 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, } - def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", **kwargs) -> None: + def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: str="10.244.0.0/16", service_cidr: str="10.0.0.0/16", dns_service_ip: str="10.0.0.10", docker_bridge_cidr: str="172.17.0.1/16", load_balancer_sku=None, **kwargs) -> None: super(ContainerServiceNetworkProfile, self).__init__(**kwargs) self.network_plugin = network_plugin self.network_policy = network_policy @@ -65,3 +70,4 @@ def __init__(self, *, network_plugin="kubenet", network_policy=None, pod_cidr: s self.service_cidr = service_cidr self.dns_service_ip = dns_service_ip self.docker_bridge_cidr = docker_bridge_cidr + self.load_balancer_sku = load_balancer_sku diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster.py index 3a61ead3dde..04fed66d87e 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster.py @@ -61,9 +61,9 @@ class ManagedCluster(Resource): :param addon_profiles: Profile of managed cluster add-on. :type addon_profiles: dict[str, ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAddonProfile] - :ivar node_resource_group: Name of the resource group containing agent + :param node_resource_group: Name of the resource group containing agent pool nodes. - :vartype node_resource_group: str + :type node_resource_group: str :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool @@ -79,6 +79,9 @@ class ManagedCluster(Resource): :param api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API server. :type api_server_authorized_ip_ranges: list[str] + :param identity: The identity of the managed cluster, if configured. + :type identity: + ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterIdentity """ _validation = { @@ -113,6 +116,7 @@ class ManagedCluster(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, } def __init__(self, **kwargs): @@ -133,3 +137,4 @@ def __init__(self, **kwargs): self.network_profile = kwargs.get('network_profile', None) self.aad_profile = kwargs.get('aad_profile', None) self.api_server_authorized_ip_ranges = kwargs.get('api_server_authorized_ip_ranges', None) + self.identity = kwargs.get('identity', None) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_identity.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_identity.py new file mode 100644 index 00000000000..ab0ac7ab5b0 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_identity.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagedClusterIdentity(Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of the system assigned identity which + is used by master components. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is + used by master components. + :vartype tenant_id: str + :param type: The type of identity used for the managed cluster. Type + 'SystemAssigned' will use an implicitly created identity in master + components and an auto-created user assigned identity in MC_ resource + group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: + 'SystemAssigned', 'None' + :type type: str or + ~azure.mgmt.containerservice.v2019_04_01.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, **kwargs): + super(ManagedClusterIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_identity_py3.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_identity_py3.py new file mode 100644 index 00000000000..60c1046ad87 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_identity_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagedClusterIdentity(Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal id of the system assigned identity which + is used by master components. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is + used by master components. + :vartype tenant_id: str + :param type: The type of identity used for the managed cluster. Type + 'SystemAssigned' will use an implicitly created identity in master + components and an auto-created user assigned identity in MC_ resource + group in agent nodes. Type 'None' will not use MSI for the managed + cluster, service principal will be used instead. Possible values include: + 'SystemAssigned', 'None' + :type type: str or + ~azure.mgmt.containerservice.v2019_04_01.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(ManagedClusterIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile.py index d9ff427fd96..c646d144b41 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile.py @@ -29,7 +29,8 @@ class ManagedClusterPoolUpgradeProfile(Model): ~azure.mgmt.containerservice.v2019_04_01.models.OSType :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: list[str] + :type upgrades: + list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ _validation = { @@ -41,7 +42,7 @@ class ManagedClusterPoolUpgradeProfile(Model): 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[str]'}, + 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } def __init__(self, **kwargs): diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_py3.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_py3.py index 79fdcac9446..b6644b2036a 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_py3.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_py3.py @@ -29,7 +29,8 @@ class ManagedClusterPoolUpgradeProfile(Model): ~azure.mgmt.containerservice.v2019_04_01.models.OSType :param upgrades: List of orchestrator types and versions available for upgrade. - :type upgrades: list[str] + :type upgrades: + list[~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] """ _validation = { @@ -41,7 +42,7 @@ class ManagedClusterPoolUpgradeProfile(Model): 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'os_type': {'key': 'osType', 'type': 'str'}, - 'upgrades': {'key': 'upgrades', 'type': '[str]'}, + 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, } def __init__(self, *, kubernetes_version: str, name: str=None, os_type="Linux", upgrades=None, **kwargs) -> None: diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_upgrades_item.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_upgrades_item.py new file mode 100644 index 00000000000..1d56a858065 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_upgrades_item.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): + """ManagedClusterPoolUpgradeProfileUpgradesItem. + + :param kubernetes_version: Kubernetes version (major, minor, patch). + :type kubernetes_version: str + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) + self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.is_preview = kwargs.get('is_preview', None) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_upgrades_item_py3.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_upgrades_item_py3.py new file mode 100644 index 00000000000..b3f79806494 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_pool_upgrade_profile_upgrades_item_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagedClusterPoolUpgradeProfileUpgradesItem(Model): + """ManagedClusterPoolUpgradeProfileUpgradesItem. + + :param kubernetes_version: Kubernetes version (major, minor, patch). + :type kubernetes_version: str + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__(self, *, kubernetes_version: str=None, is_preview: bool=None, **kwargs) -> None: + super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_py3.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_py3.py index 829d3b1c9ad..10071d84902 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_py3.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/managed_cluster_py3.py @@ -61,9 +61,9 @@ class ManagedCluster(Resource): :param addon_profiles: Profile of managed cluster add-on. :type addon_profiles: dict[str, ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAddonProfile] - :ivar node_resource_group: Name of the resource group containing agent + :param node_resource_group: Name of the resource group containing agent pool nodes. - :vartype node_resource_group: str + :type node_resource_group: str :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. :type enable_rbac: bool @@ -79,6 +79,9 @@ class ManagedCluster(Resource): :param api_server_authorized_ip_ranges: (PREVIEW) Authorized IP Ranges to kubernetes API server. :type api_server_authorized_ip_ranges: list[str] + :param identity: The identity of the managed cluster, if configured. + :type identity: + ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterIdentity """ _validation = { @@ -113,9 +116,10 @@ class ManagedCluster(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, 'api_server_authorized_ip_ranges': {'key': 'properties.apiServerAuthorizedIPRanges', 'type': '[str]'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, } - def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, node_resource_group: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_authorized_ip_ranges=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dns_prefix: str=None, agent_pool_profiles=None, linux_profile=None, windows_profile=None, service_principal_profile=None, addon_profiles=None, node_resource_group: str=None, enable_rbac: bool=None, enable_pod_security_policy: bool=None, network_profile=None, aad_profile=None, api_server_authorized_ip_ranges=None, identity=None, **kwargs) -> None: super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.max_agent_pools = None @@ -133,3 +137,4 @@ def __init__(self, *, location: str, tags=None, kubernetes_version: str=None, dn self.network_profile = network_profile self.aad_profile = aad_profile self.api_server_authorized_ip_ranges = api_server_authorized_ip_ranges + self.identity = identity diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_profile.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_profile.py index d5560a1f879..ed7eda48c46 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_profile.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_profile.py @@ -17,24 +17,27 @@ class OrchestratorProfile(Model): All required parameters must be populated in order to send to Azure. - :param orchestrator_type: Required. Orchestrator type. + :param orchestrator_type: Orchestrator type. :type orchestrator_type: str :param orchestrator_version: Required. Orchestrator version (major, minor, patch). :type orchestrator_version: str + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool """ _validation = { - 'orchestrator_type': {'required': True}, 'orchestrator_version': {'required': True}, } _attribute_map = { 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } def __init__(self, **kwargs): super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = kwargs.get('orchestrator_type', None) self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.is_preview = kwargs.get('is_preview', None) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_profile_py3.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_profile_py3.py index f16e84a1fe3..3dd9fb586ae 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_profile_py3.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_profile_py3.py @@ -17,24 +17,27 @@ class OrchestratorProfile(Model): All required parameters must be populated in order to send to Azure. - :param orchestrator_type: Required. Orchestrator type. + :param orchestrator_type: Orchestrator type. :type orchestrator_type: str :param orchestrator_version: Required. Orchestrator version (major, minor, patch). :type orchestrator_version: str + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool """ _validation = { - 'orchestrator_type': {'required': True}, 'orchestrator_version': {'required': True}, } _attribute_map = { 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, } - def __init__(self, *, orchestrator_type: str, orchestrator_version: str, **kwargs) -> None: + def __init__(self, *, orchestrator_version: str, orchestrator_type: str=None, is_preview: bool=None, **kwargs) -> None: super(OrchestratorProfile, self).__init__(**kwargs) self.orchestrator_type = orchestrator_type self.orchestrator_version = orchestrator_version + self.is_preview = is_preview diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile.py new file mode 100644 index 00000000000..eec16d09f99 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OrchestratorVersionProfile(Model): + """The profile of an orchestrator and its available versions. + + All required parameters must be populated in order to send to Azure. + + :param orchestrator_type: Required. Orchestrator type. + :type orchestrator_type: str + :param orchestrator_version: Required. Orchestrator version (major, minor, + patch). + :type orchestrator_version: str + :param default: Installed by default if version is not specified. + :type default: bool + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + :param upgrades: The list of available upgrade versions. + :type upgrades: + list[~azure.mgmt.containerservice.v2019_04_01.models.OrchestratorProfile] + """ + + _validation = { + 'orchestrator_type': {'required': True}, + 'orchestrator_version': {'required': True}, + } + + _attribute_map = { + 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'default': {'key': 'default', 'type': 'bool'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'upgrades': {'key': 'upgrades', 'type': '[OrchestratorProfile]'}, + } + + def __init__(self, **kwargs): + super(OrchestratorVersionProfile, self).__init__(**kwargs) + self.orchestrator_type = kwargs.get('orchestrator_type', None) + self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.default = kwargs.get('default', None) + self.is_preview = kwargs.get('is_preview', None) + self.upgrades = kwargs.get('upgrades', None) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_list_result.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_list_result.py new file mode 100644 index 00000000000..22055e165f7 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_list_result.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OrchestratorVersionProfileListResult(Model): + """The list of versions for supported orchestrators. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Id of the orchestrator version profile list result. + :vartype id: str + :ivar name: Name of the orchestrator version profile list result. + :vartype name: str + :ivar type: Type of the orchestrator version profile list result. + :vartype type: str + :param orchestrators: Required. List of orchestrator version profiles. + :type orchestrators: + list[~azure.mgmt.containerservice.v2019_04_01.models.OrchestratorVersionProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'orchestrators': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'orchestrators': {'key': 'properties.orchestrators', 'type': '[OrchestratorVersionProfile]'}, + } + + def __init__(self, **kwargs): + super(OrchestratorVersionProfileListResult, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.orchestrators = kwargs.get('orchestrators', None) diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_list_result_py3.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_list_result_py3.py new file mode 100644 index 00000000000..1245185edec --- /dev/null +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_list_result_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OrchestratorVersionProfileListResult(Model): + """The list of versions for supported orchestrators. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Id of the orchestrator version profile list result. + :vartype id: str + :ivar name: Name of the orchestrator version profile list result. + :vartype name: str + :ivar type: Type of the orchestrator version profile list result. + :vartype type: str + :param orchestrators: Required. List of orchestrator version profiles. + :type orchestrators: + list[~azure.mgmt.containerservice.v2019_04_01.models.OrchestratorVersionProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'orchestrators': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'orchestrators': {'key': 'properties.orchestrators', 'type': '[OrchestratorVersionProfile]'}, + } + + def __init__(self, *, orchestrators, **kwargs) -> None: + super(OrchestratorVersionProfileListResult, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.orchestrators = orchestrators diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_py3.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_py3.py new file mode 100644 index 00000000000..0ea9efab416 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/models/orchestrator_version_profile_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OrchestratorVersionProfile(Model): + """The profile of an orchestrator and its available versions. + + All required parameters must be populated in order to send to Azure. + + :param orchestrator_type: Required. Orchestrator type. + :type orchestrator_type: str + :param orchestrator_version: Required. Orchestrator version (major, minor, + patch). + :type orchestrator_version: str + :param default: Installed by default if version is not specified. + :type default: bool + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + :param upgrades: The list of available upgrade versions. + :type upgrades: + list[~azure.mgmt.containerservice.v2019_04_01.models.OrchestratorProfile] + """ + + _validation = { + 'orchestrator_type': {'required': True}, + 'orchestrator_version': {'required': True}, + } + + _attribute_map = { + 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'default': {'key': 'default', 'type': 'bool'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'upgrades': {'key': 'upgrades', 'type': '[OrchestratorProfile]'}, + } + + def __init__(self, *, orchestrator_type: str, orchestrator_version: str, default: bool=None, is_preview: bool=None, upgrades=None, **kwargs) -> None: + super(OrchestratorVersionProfile, self).__init__(**kwargs) + self.orchestrator_type = orchestrator_type + self.orchestrator_version = orchestrator_version + self.default = default + self.is_preview = is_preview + self.upgrades = upgrades diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/operations/__init__.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/operations/__init__.py index b816a99cda0..6feafb436e6 100644 --- a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/operations/__init__.py +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/operations/__init__.py @@ -12,9 +12,11 @@ from .operations import Operations from .managed_clusters_operations import ManagedClustersOperations from .agent_pools_operations import AgentPoolsOperations +from .container_services_operations import ContainerServicesOperations __all__ = [ 'Operations', 'ManagedClustersOperations', 'AgentPoolsOperations', + 'ContainerServicesOperations', ] diff --git a/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/operations/container_services_operations.py b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/operations/container_services_operations.py new file mode 100644 index 00000000000..ccd56822682 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2019_04_01/operations/container_services_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ContainerServicesOperations(object): + """ContainerServicesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list_orchestrators( + self, location, resource_type=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of supported orchestrators in the specified subscription. + + Gets a list of supported orchestrators in the specified subscription. + The operation returns properties of each orchestrator including + version, available upgrades and whether that version or upgrades are in + preview. + + :param location: The name of a supported Azure region. + :type location: str + :param resource_type: resource type for which the list of + orchestrators needs to be returned + :type resource_type: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OrchestratorVersionProfileListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.containerservice.v2019_04_01.models.OrchestratorVersionProfileListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_orchestrators.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OrchestratorVersionProfileListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_orchestrators.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators'} diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index dabcaf7a956..8dd3b223aaf 100644 --- a/src/aks-preview/setup.py +++ b/src/aks-preview/setup.py @@ -8,7 +8,7 @@ from codecs import open as open1 from setuptools import setup, find_packages -VERSION = "0.4.0" +VERSION = "0.4.1" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', diff --git a/src/index.json b/src/index.json index 65d2cc90c63..18c5792e4d7 100644 --- a/src/index.json +++ b/src/index.json @@ -47,6 +47,51 @@ } ], "aks-preview": [ + { + "downloadUrl": "https://azurecliaks.blob.core.windows.net/azure-cli-extension/aks_preview-0.4.1-py2.py3-none-any.whl", + "filename": "aks_preview-0.4.1-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.49", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/aks-preview" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "aks-preview", + "summary": "Provides a preview for upcoming AKS features", + "version": "0.4.1" + }, + "sha256Digest": "c64d66faa94ffe194b9a67423072a912cf7632183b6b49c28e72c58e44ffaccf" + }, { "downloadUrl": "https://azurecliaks.blob.core.windows.net/azure-cli-extension/aks_preview-0.4.0-py2.py3-none-any.whl", "filename": "aks_preview-0.4.0-py2.py3-none-any.whl",