From 8c5c9228862c7800d3dc771173680ae6641da2d9 Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Mon, 28 Nov 2022 15:27:57 +0800 Subject: [PATCH 1/3] update param declare --- src/aks-preview/azext_aks_preview/_params.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/aks-preview/azext_aks_preview/_params.py b/src/aks-preview/azext_aks_preview/_params.py index ba35ca6542b..64486188953 100644 --- a/src/aks-preview/azext_aks_preview/_params.py +++ b/src/aks-preview/azext_aks_preview/_params.py @@ -471,9 +471,14 @@ def load_arguments(self, _): # the following argument is declared for the wait command c.argument('agent_pool_name', options_list=['--nodepool-name', '--agent-pool-name'], validator=validate_agent_pool_name, help='The node pool name.') - for sub_command in ['add', 'update', 'upgrade', 'scale', 'show', 'list', 'delete']: - with self.argument_context('aks nodepool ' + sub_command) as c: - c.argument('nodepool_name', options_list=['--nodepool-name', '--name', '-n'], validator=validate_nodepool_name, help='The node pool name.') + with self.argument_context('aks nodepool') as c: + c.argument('cluster_name', help='The cluster name.') + c.argument('nodepool_name', options_list=['--nodepool-name', '--name', '-n'], validator=validate_nodepool_name, help='The node pool name.') + + with self.argument_context('aks nodepool wait') as c: + c.argument('resource_name', options_list=['--cluster-name'], help='The cluster name.') + # the option name '--agent-pool-name' is depracated, left for compatibility only + 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) From 7c00a77f46a67b7d3fa9721a98de03adcdf0e687 Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Mon, 28 Nov 2022 15:40:36 +0800 Subject: [PATCH 2/3] fix help lint --- src/aks-preview/azext_aks_preview/_help.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/aks-preview/azext_aks_preview/_help.py b/src/aks-preview/azext_aks_preview/_help.py index 95576e2a150..f8fc9ab97ca 100644 --- a/src/aks-preview/azext_aks_preview/_help.py +++ b/src/aks-preview/azext_aks_preview/_help.py @@ -1424,19 +1424,12 @@ - name: Get the available upgrade versions for an agent pool of the managed Kubernetes cluster. text: az aks nodepool get-upgrades --resource-group MyResourceGroup --cluster-name MyManagedCluster --nodepool-name MyNodePool crafted: true -parameters: - - name: --nodepool-name - type: string - short-summary: name of the node pool. """ helps['aks nodepool stop'] = """ type: command short-summary: Stop running agent pool in the managed Kubernetes cluster. parameters: - - name: --nodepool-name - type: string - short-summary: Agent pool name - name: --aks-custom-headers type: string short-summary: Send custom headers. When specified, format should be Key1=Value1,Key2=Value2 @@ -1449,9 +1442,6 @@ type: command short-summary: Start stopped agent pool in the managed Kubernetes cluster. parameters: - - name: --nodepool-name - type: string - short-summary: Agent pool name - name: --aks-custom-headers type: string short-summary: Send custom headers. When specified, format should be Key1=Value1,Key2=Value2 @@ -1476,9 +1466,6 @@ type: command short-summary: Abort last running operation on nodepool. parameters: - - name: --nodepool-name - type: string - short-summary: Agent pool name - name: --aks-custom-headers type: string short-summary: Send custom headers. When specified, format should be Key1=Value1,Key2=Value2 From 4d834dbcd34ac931815d109f555cf36bae724324 Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Mon, 28 Nov 2022 16:10:52 +0800 Subject: [PATCH 3/3] remove useless declaration --- src/aks-preview/azext_aks_preview/_params.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/aks-preview/azext_aks_preview/_params.py b/src/aks-preview/azext_aks_preview/_params.py index 64486188953..38c98c5a015 100644 --- a/src/aks-preview/azext_aks_preview/_params.py +++ b/src/aks-preview/azext_aks_preview/_params.py @@ -466,11 +466,6 @@ def load_arguments(self, _): with self.argument_context('aks scale') as c: c.argument('nodepool_name', help='Node pool name, upto 12 alphanumeric characters', validator=validate_nodepool_name) - with self.argument_context('aks nodepool') as c: - c.argument('cluster_name', help='The cluster name.') - # the following argument is declared for the wait command - c.argument('agent_pool_name', options_list=['--nodepool-name', '--agent-pool-name'], validator=validate_agent_pool_name, help='The node pool name.') - with self.argument_context('aks nodepool') as c: c.argument('cluster_name', help='The cluster name.') c.argument('nodepool_name', options_list=['--nodepool-name', '--name', '-n'], validator=validate_nodepool_name, help='The node pool name.')