diff --git a/src/azure-cli-core/azure/cli/core/profiles/_shared.py b/src/azure-cli-core/azure/cli/core/profiles/_shared.py index c2484e0185c..d79b6c7df39 100644 --- a/src/azure-cli-core/azure/cli/core/profiles/_shared.py +++ b/src/azure-cli-core/azure/cli/core/profiles/_shared.py @@ -227,7 +227,7 @@ def default_api_version(self): ResourceType.MGMT_ARO: '2023-11-22', ResourceType.MGMT_DATABOXEDGE: '2021-02-01-preview', ResourceType.MGMT_CUSTOMLOCATION: '2021-03-15-preview', - ResourceType.MGMT_CONTAINERSERVICE: SDKProfile('2025-05-01'), + ResourceType.MGMT_CONTAINERSERVICE: None, ResourceType.MGMT_APPCONTAINERS: '2022-10-01', } } diff --git a/src/azure-cli/azure/cli/command_modules/acs/_completers.py b/src/azure-cli/azure/cli/command_modules/acs/_completers.py index ad292520d3e..27128a20dcb 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_completers.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_completers.py @@ -39,16 +39,6 @@ def get_k8s_versions(cli_ctx, location): return search("values[*].patchVersions.keys(@)[]", results) -@Completer -def get_vm_size_completion_list(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument - """Return the intersection of the VM sizes allowed by the ACS SDK with those returned by the Compute Service.""" - from azure.mgmt.containerservice.models import ContainerServiceVMSizeTypes - - location = _get_location(cmd.cli_ctx, namespace) - result = get_vm_sizes(cmd.cli_ctx, location) - return set(r.name for r in result) & set(c.value for c in ContainerServiceVMSizeTypes) - - def get_vm_sizes(cli_ctx, location): from azure.cli.command_modules.acs._client_factory import get_compute_client diff --git a/src/azure-cli/azure/cli/command_modules/acs/_params.py b/src/azure-cli/azure/cli/command_modules/acs/_params.py index 5a03578315a..2ee5737d827 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -8,8 +8,7 @@ from argcomplete.completers import FilesCompleter from azure.cli.command_modules.acs._completers import ( - get_k8s_upgrades_completion_list, get_k8s_versions_completion_list, - get_vm_size_completion_list) + get_k8s_upgrades_completion_list, get_k8s_versions_completion_list) from azure.cli.command_modules.acs._consts import ( CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PRIVATE, CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PUBLIC, @@ -460,7 +459,7 @@ def load_arguments(self, _): # nodepool paramerters c.argument('nodepool_name', default='nodepool1', help='Node pool name, up to 12 alphanumeric characters', validator=validate_nodepool_name) - c.argument('node_vm_size', options_list=['--node-vm-size', '-s'], completer=get_vm_size_completion_list) + c.argument('node_vm_size', options_list=['--node-vm-size', '-s']) c.argument('vm_sizes') c.argument('os_sku', arg_type=get_enum_type(node_os_skus_create), validator=validate_os_sku) c.argument('snapshot_id', validator=validate_snapshot_id) @@ -891,7 +890,7 @@ def load_arguments(self, _): c.argument('agent_pool_name', options_list=['--nodepool-name', '--name', '-n', c.deprecate(target='--agent-pool-name', redirect='--nodepool-name', hide=True)], validator=validate_agent_pool_name, help='The node pool name.') with self.argument_context('aks nodepool add') as c: - c.argument('node_vm_size', options_list=['--node-vm-size', '-s'], completer=get_vm_size_completion_list) + c.argument('node_vm_size', options_list=['--node-vm-size', '-s']) c.argument('vm_sizes') c.argument('vm_set_type', validator=validate_vm_set_type) c.argument('os_type') diff --git a/src/azure-cli/azure/cli/command_modules/acs/commands.py b/src/azure-cli/azure/cli/command_modules/acs/commands.py index 08fab80814d..8971e0a8200 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/commands.py @@ -118,9 +118,9 @@ def load_command_table(self, _): confirmation='Kubernetes will be unavailable during certificate rotation process.\n' + 'Are you sure you want to perform this operation?') g.custom_command('stop', 'aks_stop', - supports_no_wait=True, min_api='2020-09-01') + supports_no_wait=True) g.command('start', 'begin_start', - supports_no_wait=True, min_api='2020-09-01') + supports_no_wait=True) g.wait_command('wait') g.custom_command('use-dev-spaces', 'aks_use_dev_spaces', deprecate_info=g.deprecate()) @@ -188,7 +188,7 @@ def load_command_table(self, _): client_factory=cf_snapshots, deprecate_info=self.deprecate( redirect='aks nodepool snapshot', hide=True), - min_api='2021-08-01') as g: + ) as g: g.custom_command('list', 'aks_nodepool_snapshot_list', deprecate_info=g.deprecate( redirect='aks nodepool snapshot list'), @@ -207,7 +207,7 @@ def load_command_table(self, _): with self.command_group('aks nodepool snapshot', snapshot_sdk, client_factory=cf_snapshots, - min_api='2021-08-01') as g: + ) as g: g.custom_command('list', 'aks_nodepool_snapshot_list', table_transformer=aks_list_nodepool_snapshot_table_format) g.custom_show_command('show', 'aks_nodepool_snapshot_show', diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_agentpool_decorator.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_agentpool_decorator.py index 112dfdb9f56..ee067c1bfbf 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_agentpool_decorator.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_agentpool_decorator.py @@ -58,11 +58,7 @@ def setUp(self): def test__init__(self): # load models directly (instead of through the `get_sdk` method provided by the cli component) - from azure.cli.core.profiles._shared import AZURE_API_PROFILES - - sdk_profile = AZURE_API_PROFILES["latest"][self.resource_type] - api_version = sdk_profile.default_api_version - module_name = "azure.mgmt.containerservice.v{}.models".format(api_version.replace("-", "_")) + module_name = "azure.mgmt.containerservice.models" module = importlib.import_module(module_name) standalone_models = AKSAgentPoolModels(self.cmd, self.resource_type, AgentPoolDecoratorMode.STANDALONE) diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_base_decorator.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_base_decorator.py index 34e2b8788a0..62624ea8753 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_base_decorator.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_base_decorator.py @@ -37,11 +37,7 @@ def setUp(self): def test_models(self): # load models directly (instead of through the `get_sdk` method provided by the cli component) - from azure.cli.core.profiles._shared import AZURE_API_PROFILES - - sdk_profile = AZURE_API_PROFILES["latest"][ResourceType.MGMT_CONTAINERSERVICE] - api_version = sdk_profile.default_api_version - module_name = "azure.mgmt.containerservice.v{}.models".format(api_version.replace("-", "_")) + module_name = "azure.mgmt.containerservice.models" module = importlib.import_module(module_name) models = BaseAKSModels(self.cmd, ResourceType.MGMT_CONTAINERSERVICE) diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py index 00b0fee14dc..23aaf5cf8fc 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_managed_cluster_decorator.py @@ -94,11 +94,7 @@ def test_models(self): models = AKSManagedClusterModels(self.cmd, ResourceType.MGMT_CONTAINERSERVICE) # load models directly (instead of through the `get_sdk` method provided by the cli component) - from azure.cli.core.profiles._shared import AZURE_API_PROFILES - - sdk_profile = AZURE_API_PROFILES["latest"][ResourceType.MGMT_CONTAINERSERVICE] - api_version = sdk_profile.default_api_version - module_name = "azure.mgmt.containerservice.v{}.models".format(api_version.replace("-", "_")) + module_name = "azure.mgmt.containerservice.models" module = importlib.import_module(module_name) # load balancer models diff --git a/src/azure-cli/requirements.py3.Darwin.txt b/src/azure-cli/requirements.py3.Darwin.txt index 6e5ade12eb4..e221d1e821f 100644 --- a/src/azure-cli/requirements.py3.Darwin.txt +++ b/src/azure-cli/requirements.py3.Darwin.txt @@ -32,7 +32,7 @@ azure-mgmt-cognitiveservices==13.5.0 azure-mgmt-compute==34.1.0 azure-mgmt-containerinstance==10.2.0b1 azure-mgmt-containerregistry==14.1.0b1 -azure-mgmt-containerservice==38.0.0 +azure-mgmt-containerservice==39.0.0 azure-mgmt-core==1.6.0 azure-mgmt-cosmosdb==9.8.0 azure-mgmt-databoxedge==1.0.0 diff --git a/src/azure-cli/requirements.py3.Linux.txt b/src/azure-cli/requirements.py3.Linux.txt index a92217e02ca..2778c8fe47f 100644 --- a/src/azure-cli/requirements.py3.Linux.txt +++ b/src/azure-cli/requirements.py3.Linux.txt @@ -32,7 +32,7 @@ azure-mgmt-cognitiveservices==13.5.0 azure-mgmt-compute==34.1.0 azure-mgmt-containerinstance==10.2.0b1 azure-mgmt-containerregistry==14.1.0b1 -azure-mgmt-containerservice==38.0.0 +azure-mgmt-containerservice==39.0.0 azure-mgmt-core==1.6.0 azure-mgmt-cosmosdb==9.8.0 azure-mgmt-databoxedge==1.0.0 diff --git a/src/azure-cli/requirements.py3.windows.txt b/src/azure-cli/requirements.py3.windows.txt index 747d7c77211..d9d40bab87f 100644 --- a/src/azure-cli/requirements.py3.windows.txt +++ b/src/azure-cli/requirements.py3.windows.txt @@ -32,7 +32,7 @@ azure-mgmt-cognitiveservices==13.5.0 azure-mgmt-compute==34.1.0 azure-mgmt-containerinstance==10.2.0b1 azure-mgmt-containerregistry==14.1.0b1 -azure-mgmt-containerservice==38.0.0 +azure-mgmt-containerservice==39.0.0 azure-mgmt-core==1.6.0 azure-mgmt-cosmosdb==9.8.0 azure-mgmt-databoxedge==1.0.0 diff --git a/src/azure-cli/setup.py b/src/azure-cli/setup.py index 9d5ee300acc..17553721a53 100644 --- a/src/azure-cli/setup.py +++ b/src/azure-cli/setup.py @@ -77,7 +77,7 @@ 'azure-mgmt-compute~=34.1.0', 'azure-mgmt-containerinstance==10.2.0b1', 'azure-mgmt-containerregistry==14.1.0b1', - 'azure-mgmt-containerservice~=38.0.0', + 'azure-mgmt-containerservice~=39.0.0', 'azure-mgmt-cosmosdb==9.8.0', 'azure-mgmt-databoxedge~=1.0.0', 'azure-mgmt-datalake-store~=1.1.0b1',