-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Compute} Update function of auto_shutdown_vm #17352
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1003,13 +1003,15 @@ def auto_shutdown_vm(cmd, resource_group_name, vm_name, off=None, email=None, we | |||||
| raise CLIError('usage error: --time is a required parameter') | ||||||
| daily_recurrence = {'time': time} | ||||||
| notification_settings = None | ||||||
| if webhook: | ||||||
| if email: | ||||||
| if not webhook: | ||||||
| raise CLIError('usage error: --webhook is a required parameter') | ||||||
|
||||||
| notification_settings = { | ||||||
| 'emailRecipient': email, | ||||||
| 'webhookUrl': webhook, | ||||||
| 'timeInMinutes': 30, | ||||||
| 'status': 'Enabled' | ||||||
| } | ||||||
| 'emailRecipient': email, | ||||||
| 'webhookUrl': webhook, | ||||||
| 'timeInMinutes': 30, | ||||||
| 'status': 'Enabled' | ||||||
| } | ||||||
|
||||||
| } | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this service behavior? If no, this will be breaking change to end users: adding a required param for email.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the webhook parameter is also required if the user needs to set --email. This issue is that the user doesn't know the settings -- email needs to be set -- webhook. I make this change to prompt the user that both parameters must exist at the same time for them to take effect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we allow webhook and no email?