Skip to content

Commit

Permalink
{AKS} az aks nodepool: Update nodepool command option names (#5582)
Browse files Browse the repository at this point in the history
* update param declare

* fix help lint

* remove useless declaration
  • Loading branch information
FumingZhang authored Nov 29, 2022
1 parent 3df3b5e commit 0127284
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
13 changes: 0 additions & 13 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,12 @@ def load_arguments(self, _):

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.')
c.argument('nodepool_name', options_list=['--nodepool-name', '--name', '-n'], validator=validate_nodepool_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 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)
Expand Down

0 comments on commit 0127284

Please sign in to comment.