Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ARM] az deployment group/sub/mg/tenant create: Add --what-if and --proceed-if-no-change parameters #18924

Merged
merged 2 commits into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/azure-cli/azure/cli/command_modules/resource/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def load_arguments(self, _):
no_prompt = CLIArgumentType(arg_type=get_three_state_flag(), help='The option to disable the prompt of missing parameters for ARM template. '
'When the value is true, the prompt requiring users to provide missing parameter will be ignored. The default value is false.')

deployment_what_if_type = CLIArgumentType(options_list=['--what-if', '-w'], action='store_true',
help='Instruct the command to run deployment What-If.',
min_api='2019-07-01')
deployment_what_if_proceed_if_no_change_type = CLIArgumentType(options_list=['--proceed-if-no-change'], action='store_true',
help='Instruct the command to execute the deployment if the What-If result contains no resource changes. Applicable when --confirm-with-what-if is set.',
min_api='2019-07-01')
deployment_what_if_result_format_type = CLIArgumentType(options_list=['--result-format', '-r'],
arg_type=get_enum_type(WhatIfResultFormat, "FullResourcePayloads"),
min_api='2019-07-01')
Expand Down Expand Up @@ -304,6 +310,8 @@ def load_arguments(self, _):
c.argument('what_if_exclude_change_types', options_list=['--what-if-exclude-change-types', '-x'],
arg_type=deployment_what_if_exclude_change_types_type,
help="Space-separated list of resource change types to be excluded from What-If results. Applicable when --confirm-with-what-if is set.")
c.argument('what_if', arg_type=deployment_what_if_type)
c.argument('proceed_if_no_change', arg_type=deployment_what_if_proceed_if_no_change_type)

with self.argument_context('deployment validate') as c:
c.argument('deployment_name', arg_type=deployment_create_name_type)
Expand Down Expand Up @@ -331,6 +339,8 @@ def load_arguments(self, _):
c.argument('what_if_exclude_change_types', options_list=['--what-if-exclude-change-types', '-x'],
arg_type=deployment_what_if_exclude_change_types_type,
help="Space-separated list of resource change types to be excluded from What-If results. Applicable when --confirm-with-what-if is set.")
c.argument('what_if', arg_type=deployment_what_if_type)
c.argument('proceed_if_no_change', arg_type=deployment_what_if_proceed_if_no_change_type)

with self.argument_context('deployment sub what-if') as c:
c.argument('deployment_name', arg_type=deployment_create_name_type)
Expand Down Expand Up @@ -370,6 +380,8 @@ def load_arguments(self, _):
c.argument('what_if_exclude_change_types', options_list=['--what-if-exclude-change-types', '-x'],
arg_type=deployment_what_if_exclude_change_types_type,
help="Space-separated list of resource change types to be excluded from What-If results. Applicable when --confirm-with-what-if is set.")
c.argument('what_if', arg_type=deployment_what_if_type)
c.argument('proceed_if_no_change', arg_type=deployment_what_if_proceed_if_no_change_type)

with self.argument_context('deployment group what-if') as c:
c.argument('deployment_name', arg_type=deployment_create_name_type)
Expand Down Expand Up @@ -406,6 +418,8 @@ def load_arguments(self, _):
arg_type=deployment_what_if_exclude_change_types_type,
help="Space-separated list of resource change types to be excluded from What-If results. Applicable when --confirm-with-what-if is set.",
min_api="2019-10-01")
c.argument('what_if', arg_type=deployment_what_if_type)
c.argument('proceed_if_no_change', arg_type=deployment_what_if_proceed_if_no_change_type)

with self.argument_context('deployment mg what-if') as c:
c.argument('deployment_name', arg_type=deployment_create_name_type)
Expand Down Expand Up @@ -441,6 +455,8 @@ def load_arguments(self, _):
arg_type=deployment_what_if_exclude_change_types_type,
help="Space-separated list of resource change types to be excluded from What-If results. Applicable when --confirm-with-what-if is set.",
min_api="2019-10-01")
c.argument('what_if', arg_type=deployment_what_if_type)
c.argument('proceed_if_no_change', arg_type=deployment_what_if_proceed_if_no_change_type)

with self.argument_context('deployment tenant what-if') as c:
c.argument('deployment_name', arg_type=deployment_create_name_type)
Expand Down
Loading