-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[SQL] Sql midb Add: update/show long term retention policy, show/delete long term retention backups, restore long term retention backup #12712
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 42 commits
de11560
3d2172d
197c900
7fca0f7
233c779
8932742
0887b12
32bdfd3
756738c
59e19c4
9f9aee5
e3a393d
0ec14bb
3f45a78
bd9f71c
2382a1f
4ebae7b
60a1cfa
01d1bb1
d0d2f6a
dcf401f
b5b74a0
72989c1
ccf3da9
561da9f
eb981f1
7534e97
57277e5
5ad302f
c935c15
687e9bb
9661b27
920401f
4d39351
dd0eb2d
223b945
94b0530
97c0ade
4b32d6a
41aa6dd
0ac9bfb
8490995
9493d8e
204b6fb
7452420
f9d22b3
bc782bd
0be376f
96c6b3a
35badd4
fb05415
7898a1d
98ea63f
81450d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1483,22 +1483,103 @@ def _configure_security_policy_storage_params(arg_ctx): | |
| 'retention_days' | ||
| ]) | ||
|
|
||
| c.argument('deleted_time', | ||
| options_list=['--deleted-time'], | ||
| help='If specified, updates retention days for a deleted database, instead of an existing database.' | ||
| 'Must match the deleted time of a deleted database on the source Managed Instance.') | ||
| c.argument( | ||
| 'deleted_time', | ||
| options_list=['--deleted-time'], | ||
| help='If specified, updates retention days for a deleted database, instead of an existing database.' | ||
| 'Must match the deleted time of a deleted database on the source Managed Instance.') | ||
|
|
||
| c.argument( | ||
| 'retention_days', | ||
| options_list=['--retention-days'], | ||
| required=True, | ||
| help='New backup short term retention policy in days.' | ||
| 'Valid policy for live database is 7-35 days, valid policy for dropped databases is 0-35 days.') | ||
|
|
||
| c.argument('retention_days', | ||
| options_list=['--retention-days'], | ||
| with self.argument_context('sql midb short-term-retention-policy show') as c: | ||
| c.argument( | ||
| 'deleted_time', | ||
| options_list=['--deleted-time'], | ||
| help='If specified, shows retention days for a deleted database, instead of an existing database.' | ||
| 'Must match the deleted time of a deleted database on the source Managed Instance.') | ||
|
|
||
| with self.argument_context('sql midb ltr-policy set') as c: | ||
| create_args_for_complex_type( | ||
| c, 'parameters', ManagedDatabase, [ | ||
| 'weekly_retention', | ||
| 'monthly_retention', | ||
| 'yearly_retention', | ||
| 'week_of_year' | ||
xaliciayang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ]) | ||
|
|
||
| c.argument('weekly_retention', | ||
| help='Retention for the weekly backup. ' | ||
| 'If just a number is passed instead of an ISO 8601 string, days will be assumed as the units.' | ||
| 'There is a minimum of 7 days and a maximum of 10 years.') | ||
|
|
||
| c.argument('monthly_retention', | ||
| help='Retention for the monthly backup. ' | ||
| 'If just a number is passed instead of an ISO 8601 string, days will be assumed as the units.' | ||
| 'There is a minimum of 7 days and a maximum of 10 years.') | ||
|
|
||
| c.argument('yearly_retention', | ||
| help='Retention for the yearly backup. ' | ||
| 'If just a number is passed instead of an ISO 8601 string, days will be assumed as the units.' | ||
| 'There is a minimum of 7 days and a maximum of 10 years.') | ||
|
|
||
| c.argument('week_of_year', | ||
| help='The Week of Year, 1 to 52, in which to take the yearly backup.') | ||
|
|
||
| with self.argument_context('sql midb ltr-backup') as c: | ||
| c.argument('location_name', | ||
xaliciayang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| required=True, | ||
| help='New backup short term retention policy in days.' | ||
| 'Valid policy for live database is 7-35 days, valid policy for dropped databases is 0-35 days.') | ||
| arg_type=get_location_type(self.cli_ctx), | ||
| help='The location of the desired backups.') | ||
|
|
||
| with self.argument_context('sql midb short-term-retention-policy show') as c: | ||
| c.argument('deleted_time', | ||
| options_list=['--deleted-time'], | ||
| help='If specified, shows retention days for a deleted database, instead of an existing database.' | ||
| 'Must match the deleted time of a deleted database on the source Managed Instance.') | ||
| with self.argument_context('sql midb ltr-backup list') as c: | ||
| c.argument('managed_instance_name', | ||
| options_list=['--managed-instance', '--mi'], | ||
| help='Name of the Azure SQL managed instance. ' | ||
| 'If specified, retrieves all requested backups under this managed instance.') | ||
|
|
||
| c.argument('database_name', | ||
| options_list=['--name', '-n'], | ||
| help='The name of the Azure SQL Managed Database. ' | ||
| 'If specified (along with instance name), retrieves all requested backups under this database.') | ||
|
|
||
| c.argument('database_state', | ||
| required=False, | ||
| options_list=['--database-state', '--state'], | ||
| help='\'All\', \'Live\', or \'Deleted\'. ' | ||
| 'Will fetch backups only from databases of specified state. ' | ||
| 'If no state provied, defaults to \'All\'.') | ||
|
|
||
| c.argument('only_latest_per_database', | ||
|
||
| options_list=['--only-latest-per-database', '--latest'], | ||
| required=False, | ||
| help='If true, will only return the latest backup for each database') | ||
|
|
||
| with self.argument_context('sql midb ltr-backup restore') as c: | ||
| c.argument('target_managed_database_name', | ||
| options_list=['--dest-name'], | ||
| required=True, | ||
| help='Name of the managed database that will be created as the restore destination.') | ||
|
|
||
| c.argument('target_managed_instance_name', | ||
| options_list=['--dest-mi'], | ||
| required=True, | ||
| help='Name of the managed instance to restore managed database to.') | ||
|
|
||
| c.argument('target_resource_group_name', | ||
| options_list=['--dest-resource-group'], | ||
| required=True, | ||
| help='Name of the resource group of the managed instance to restore managed database to.') | ||
|
|
||
| c.argument('long_term_retention_backup_resource_id', | ||
| options_list=['--backup-id'], | ||
| required=True, | ||
| help='The resource id of the long term retention backup to be restored. ' | ||
| 'Use \'az sql midb ltr-backup show\' or \'az sql midb ltr-backup list\' for backup id.') | ||
xaliciayang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ############################################### | ||
| # sql virtual cluster # | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.