Skip to content

Commit

Permalink
Add List Operation for aks
Browse files Browse the repository at this point in the history
  • Loading branch information
Wen Huang committed Jul 2, 2024
1 parent f22f36d commit 284b269
Show file tree
Hide file tree
Showing 5 changed files with 248 additions and 275 deletions.
12 changes: 12 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -2213,6 +2213,18 @@
short-summary: Name of the resource group.
"""

helps['aks operation list'] = """
type: command
short-summary: List all operations on managed Kubernetes cluster.
parameters:
- name: --name -n
type: string
short-summary: The name of the managed cluster
- name: --resource-group -g
type: string
short-summary: Name of the resource group.
"""

helps['aks operation-abort'] = """
type: command
short-summary: Abort last running operation on managed cluster.
Expand Down
3 changes: 3 additions & 0 deletions src/aks-preview/azext_aks_preview/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ def load_command_table(self, _):
g.custom_command(
"show-latest", "aks_operation_show_latest", table_transformer=aks_operation_show_table_format
)
g.custom_command(
"list", "aks_operation_list", table_transformer=aks_operation_show_table_format
)

# AKS draft commands
with self.command_group(
Expand Down
5 changes: 5 additions & 0 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,11 @@ def aks_operation_show_latest(cmd,
return client.get_by_agent_pool(resource_group_name, name, nodepool_name, "latest")
return client.get(resource_group_name, name, "latest")

def aks_operation_list(cmd,
client,
resource_group_name,
name,):
return client.list(resource_group_name, name)

def aks_operation_abort(cmd, # pylint: disable=unused-argument
client,
Expand Down
Loading

0 comments on commit 284b269

Please sign in to comment.