Skip to content

Commit 95351e1

Browse files
authored
[App Service] BREAKING CHANGE: az webapp list-runtimes: Revamp the command with structured table output (#32903)
1 parent 551a544 commit 95351e1

5 files changed

Lines changed: 3241 additions & 579 deletions

File tree

src/azure-cli/azure/cli/command_modules/appservice/_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ def load_arguments(self, _):
401401
c.argument('slot', options_list=['--slot', '-s'], help='Name of the web app slot. Default to the productions slot if not specified.')
402402

403403
with self.argument_context('webapp list-runtimes') as c:
404-
c.argument('linux', action='store_true', help='list runtime stacks for linux based web apps', deprecate_info=c.deprecate(redirect="--os-type"))
405404
c.argument('os_type', options_list=["--os", "--os-type"], help="limit the output to just windows or linux runtimes", arg_type=get_enum_type([LINUX_OS_NAME, WINDOWS_OS_NAME]))
406-
c.argument('show_runtime_details', action='store_true', help="show detailed versions of runtime stacks")
405+
c.argument('runtime', options_list=["--runtime"], help="limit the output to a specific runtime family", arg_type=get_enum_type(['dotnet', 'node', 'php', 'python', 'java']))
406+
c.argument('support', options_list=["--support"], help="filter by support lifecycle status. Default: supported", arg_type=get_enum_type(['supported', 'active', 'near', 'eol', 'all']))
407407

408408
with self.argument_context('functionapp list-runtimes') as c:
409409
c.argument('os_type', options_list=["--os", "--os-type"], help="limit the output to just windows or linux runtimes", arg_type=get_enum_type([LINUX_OS_NAME, WINDOWS_OS_NAME]))

src/azure-cli/azure/cli/command_modules/appservice/commands.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ def transform_web_list_output(webs):
4040
return [transform_web_output(w) for w in webs]
4141

4242

43+
def transform_runtime_list_output(result):
44+
from collections import OrderedDict
45+
return [OrderedDict([
46+
('OS', r['os']), ('Runtime', r['runtime']), ('Version', r['version']),
47+
('Config', r['config']), ('Support', r['support']), ('End of Life', r['end_of_life'])
48+
]) for r in result]
49+
50+
4351
def ex_handler_factory(creating_plan=False):
4452
def _ex_handler(ex):
4553
ex = _polish_bad_errors(ex, creating_plan)
@@ -133,7 +141,7 @@ def load_command_table(self, _):
133141
g.custom_command('restart', 'restart_webapp')
134142
g.custom_command('browse', 'view_in_browser')
135143
g.custom_command('list-instances', 'list_instances')
136-
g.custom_command('list-runtimes', 'list_runtimes')
144+
g.custom_command('list-runtimes', 'list_runtimes', table_transformer=transform_runtime_list_output)
137145
g.custom_command('identity assign', 'assign_identity')
138146
g.custom_show_command('identity show', 'show_identity')
139147
g.custom_command('identity remove', 'remove_identity')

0 commit comments

Comments
 (0)