-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[BACKUP] Add CRR functionality for IaaSVM and other CRR commands #16557
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 7 commits
12ea321
5115ad7
a452d4e
447533d
ba8b9f2
325bc7a
25fa083
4c70a98
f5bfdc8
c96dc65
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 |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ def load_arguments(self, _): | |
| with self.argument_context('backup vault backup-properties set') as c: | ||
| c.argument('backup_storage_redundancy', arg_type=get_enum_type(['GeoRedundant', 'LocallyRedundant']), help='Sets backup storage properties for a Recovery Services vault.') | ||
| c.argument('soft_delete_feature_state', arg_type=get_enum_type(['Enable', 'Disable']), help='Set soft-delete feature state for a Recovery Services Vault.') | ||
| c.argument('cross_region_restore_flag', arg_type=get_enum_type(["True", "False"]), help='Set cross-region-restore feature state for a Recovery Services Vault. Default: False.') | ||
|
|
||
| # Container | ||
| with self.argument_context('backup container') as c: | ||
|
|
@@ -87,9 +88,12 @@ def load_arguments(self, _): | |
| with self.argument_context('backup container show') as c: | ||
| c.argument('name', container_name_type, options_list=['--name', '-n'], help='Name of the container. You can use the backup container list command to get the name of a container.') | ||
| c.argument('backup_management_type', backup_management_type) | ||
| c.argument('use_secondary_region', arg_type=get_three_state_flag(), help='Use this flag to show container in secondary region. Default: false.') | ||
|
Member
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. This seems to be a command behavior switch, not a resource property. It's recommended to use
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. Did the changes. Please review once. |
||
|
|
||
| with self.argument_context('backup container list') as c: | ||
| c.argument('vault_name', vault_name_type, id_part=None) | ||
| c.argument('backup_management_type', backup_management_type) | ||
| c.argument('use_secondary_region', arg_type=get_three_state_flag(), help='Use this flag to list containers in secondary region. Default: false.') | ||
|
|
||
| with self.argument_context('backup container unregister') as c: | ||
| c.argument('backup_management_type', backup_management_type) | ||
|
|
@@ -114,6 +118,7 @@ def load_arguments(self, _): | |
| c.argument('name', item_name_type, options_list=['--name', '-n'], help='Name of the backed up item. You can use the backup item list command to get the name of a backed up item.') | ||
| c.argument('backup_management_type', backup_management_type) | ||
| c.argument('workload_type', workload_type) | ||
| c.argument('use_secondary_region', arg_type=get_three_state_flag(), help='Use this flag to show item in secondary region. Default: false.') | ||
|
|
||
| # TODO: Need to use item.id once https://github.com/Azure/msrestazure-for-python/issues/80 is fixed. | ||
| with self.argument_context('backup item set-policy') as c: | ||
|
|
@@ -126,6 +131,7 @@ def load_arguments(self, _): | |
| c.argument('vault_name', vault_name_type, id_part=None) | ||
| c.argument('backup_management_type', arg_type=get_enum_type(allowed_backup_management_types + ["MAB"]), help=backup_management_type_help) | ||
| c.argument('workload_type', workload_type) | ||
| c.argument('use_secondary_region', arg_type=get_three_state_flag(), help='Use this flag to list items in secondary region. Default: false.') | ||
|
|
||
| # Policy | ||
| with self.argument_context('backup policy') as c: | ||
|
|
@@ -170,12 +176,14 @@ def load_arguments(self, _): | |
| c.argument('backup_management_type', backup_management_type) | ||
| c.argument('container_name', container_name_type) | ||
| c.argument('workload_type', workload_type) | ||
| c.argument('use_secondary_region', arg_type=get_three_state_flag(), help='Use this flag to list recoverypoints in secondary region. Default: false.') | ||
|
|
||
| with self.argument_context('backup recoverypoint show') as c: | ||
| c.argument('name', rp_name_type, options_list=['--name', '-n'], help='Name of the recovery point. You can use the backup recovery point list command to get the name of a backed up item.') | ||
| c.argument('backup_management_type', backup_management_type) | ||
| c.argument('container_name', container_name_type) | ||
| c.argument('workload_type', workload_type) | ||
| c.argument('use_secondary_region', arg_type=get_three_state_flag(), help='Use this flag to show recoverypoints in secondary region. Default: false.') | ||
|
|
||
| # Protection | ||
| with self.argument_context('backup protection') as c: | ||
|
|
@@ -251,6 +259,7 @@ def load_arguments(self, _): | |
| c.argument('diskslist', diskslist_type) | ||
| c.argument('restore_only_osdisk', arg_type=get_three_state_flag(), help='Use this flag to restore only OS disks of a backed up VM.') | ||
| c.argument('restore_as_unmanaged_disks', arg_type=get_three_state_flag(), help='Use this flag to specify to restore as unmanaged disks') | ||
| c.argument('use_secondary_region', arg_type=get_three_state_flag(), help='Use this flag to show recoverypoints in secondary region. Default: false.') | ||
|
|
||
| with self.argument_context('backup restore restore-azurefileshare') as c: | ||
| c.argument('resolve_conflict', resolve_conflict_type) | ||
|
|
@@ -296,14 +305,15 @@ def load_arguments(self, _): | |
| for command in ['show', 'stop', 'wait']: | ||
| with self.argument_context('backup job ' + command) as c: | ||
| c.argument('name', job_name_type, help='Name of the job. You can use the backup job list command to get the name of a job.') | ||
| c.argument('use_secondary_region', arg_type=get_three_state_flag(), help='Use this flag to show recoverypoints in secondary region. Default: false.') | ||
|
|
||
| with self.argument_context('backup job list') as c: | ||
| c.argument('vault_name', vault_name_type, id_part=None) | ||
| c.argument('status', arg_type=get_enum_type(['Cancelled', 'Completed', 'CompletedWithWarnings', 'Failed', 'InProgress']), help='Status of the Job.') | ||
| c.argument('operation', arg_type=get_enum_type(['Backup', 'ConfigureBackup', 'DeleteBackupData', 'DisableBackup', 'Restore']), help='User initiated operation.') | ||
| c.argument('start_date', type=datetime_type, help='The start date of the range in UTC (d-m-Y).') | ||
| c.argument('end_date', type=datetime_type, help='The end date of the range in UTC (d-m-Y).') | ||
| c.argument('backup_management_type', backup_management_type) | ||
| c.argument('use_secondary_region', arg_type=get_three_state_flag(), help='Use this flag to show recoverypoints in secondary region. Default: false.') | ||
|
|
||
| with self.argument_context('backup job wait') as c: | ||
| c.argument('timeout', type=int, help='Maximum time, in seconds, to wait before aborting.') | ||
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.
cross_region_restore_flagwill be treated as astr, you may need to convert it to bool before you pass it to SDK.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.
Did the changes. Please review once.