-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update maintenanceconfiguration commands #5739
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 5 commits
b02011d
2f47d6a
2702d72
efe88a0
e812c9a
017c732
104b999
ad39561
a31193e
48c3b70
114283f
12e601e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -71,6 +71,15 @@ | |||||||
| CONST_DISK_DRIVER_V2, | ||||||||
| CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PUBLIC, | ||||||||
| CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PRIVATE, | ||||||||
| CONST_DAILY_MAINTENANCE_SCHEDULE, | ||||||||
| CONST_WEEKLY_MAINTENANCE_SCHEDULE, | ||||||||
| CONST_ABSOLUTEMONTHLY_MAINTENANCE_SCHEDULE, | ||||||||
| CONST_RELATIVEMONTHLY_MAINTENANCE_SCHEDULE, | ||||||||
| CONST_WEEKINDEX_FIRST, | ||||||||
| CONST_WEEKINDEX_SECOND, | ||||||||
| CONST_WEEKINDEX_THIRD, | ||||||||
| CONST_WEEKINDEX_FOURTH, | ||||||||
| CONST_WEEKINDEX_LAST, | ||||||||
| ) | ||||||||
| from azext_aks_preview._validators import ( | ||||||||
| validate_acr, | ||||||||
|
|
@@ -133,6 +142,9 @@ | |||||||
| validate_disable_windows_outbound_nat, | ||||||||
| validate_allowed_host_ports, | ||||||||
| validate_application_security_groups, | ||||||||
| validate_utc_offset, | ||||||||
| validate_start_date, | ||||||||
| validate_start_time, | ||||||||
| ) | ||||||||
|
|
||||||||
| # candidates for enumeration | ||||||||
|
|
@@ -177,6 +189,22 @@ | |||||||
| CONST_NONE_UPGRADE_CHANNEL, | ||||||||
| ] | ||||||||
|
|
||||||||
| # consts for maintenance configuration | ||||||||
| schedule_types = [ | ||||||||
| CONST_DAILY_MAINTENANCE_SCHEDULE, | ||||||||
| CONST_WEEKLY_MAINTENANCE_SCHEDULE, | ||||||||
| CONST_ABSOLUTEMONTHLY_MAINTENANCE_SCHEDULE, | ||||||||
| CONST_RELATIVEMONTHLY_MAINTENANCE_SCHEDULE, | ||||||||
| ] | ||||||||
|
|
||||||||
| week_indexes = [ | ||||||||
| CONST_WEEKINDEX_FIRST, | ||||||||
| CONST_WEEKINDEX_SECOND, | ||||||||
| CONST_WEEKINDEX_THIRD, | ||||||||
| CONST_WEEKINDEX_FOURTH, | ||||||||
| CONST_WEEKINDEX_LAST, | ||||||||
| ] | ||||||||
|
|
||||||||
| # consts for credential | ||||||||
| credential_formats = [CONST_CREDENTIAL_FORMAT_AZURE, CONST_CREDENTIAL_FORMAT_EXEC] | ||||||||
|
|
||||||||
|
|
@@ -568,8 +596,25 @@ def load_arguments(self, _): | |||||||
| '--config-file'], help='The config json file.', required=False) | ||||||||
| c.argument('weekday', options_list=[ | ||||||||
| '--weekday'], help='weekday on which maintenance can happen. e.g. Monday', required=False) | ||||||||
| c.argument('start_hour', type=int, options_list=[ | ||||||||
| '--start-hour'], help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am', required=False) | ||||||||
| c.argument('start_hour', type=int, required=False, options_list=[ | ||||||||
| '--start-hour'], help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am') | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Because
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All |
||||||||
| c.argument('schedule_type', arg_type=get_enum_type(schedule_types), | ||||||||
| help='Schedule type for non-default maintenance configuration.', required=False) | ||||||||
| c.argument('interval_days', type=int, help='The number of days between each set of occurrences for Daily schedule.', required=False) | ||||||||
| c.argument('interval_weeks', type=int, help='The number of weeks between each set of occurrences for Weekly schedule.', required=False) | ||||||||
| c.argument('interval_months', type=int, help='The number of months between each set of occurrences for AbsoluteMonthly or RelativeMonthly schedule.', required=False) | ||||||||
| c.argument('day_of_week', help='Specifies on which day of the week the maintenance occurs for Weekly or RelativeMonthly schedule.', required=False) | ||||||||
| c.argument('day_of_month', help='Specifies on which date of the month the maintenance occurs for AbsoluteMonthly schedule.', required=False) | ||||||||
| c.argument('week_index', arg_type=get_enum_type(week_indexes), required=False, | ||||||||
| help='Specifies on which instance of the weekday specified in --day-of-week the maintenance occurs for RelativeMonthly schedule.') | ||||||||
| c.argument('duration_hours', options_list=['--duration'], type=int, required=False, | ||||||||
| help='The length of maintenance window. The value ranges from 4 to 24 hours.') | ||||||||
| c.argument('utc_offset', validator=validate_utc_offset, required=False, | ||||||||
| help='The UTC offset in format +/-HH:mm. e.g. -08:00 or +05:30.') | ||||||||
| c.argument('start_date', validator=validate_start_date, required=False, | ||||||||
| help='The date the maintenance window activates. e.g. 2023-01-01.') | ||||||||
| c.argument('start_time', validator=validate_start_time, required=False, | ||||||||
| help='The start time of the maintenance window. e.g. 09:30.') | ||||||||
|
Comment on lines
+601
to
+616
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Same as above
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed~
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update: I have to add
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update again: |
||||||||
|
|
||||||||
| for scope in ['aks maintenanceconfiguration show', 'aks maintenanceconfiguration delete']: | ||||||||
| with self.argument_context(scope) as c: | ||||||||
|
|
||||||||
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.
Could we describe these two features in detail in the history notes, otherwise their meaning is easily confusing?
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.
Thanks for your feedback, I have updated the details!