Skip to content
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
5 changes: 4 additions & 1 deletion src/azure-cli/azure/cli/command_modules/storage/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,12 @@
cluster will become primary after failover. For more information, please refer to
https://learn.microsoft.com/azure/storage/common/storage-disaster-recovery-guidance.
examples:
- name: Failover a storage account.
- name: Unplanned Failover a storage account.
text: |
az storage account failover -n mystorageaccount -g MyResourceGroup
- name: Planned Failover a storage account.
text: |
az storage account failover -n mystorageaccount -g MyResourceGroup --failover-type Planned
- name: Failover a storage account without waiting for complete.
text: |
az storage account failover -n mystorageaccount -g MyResourceGroup --no-wait
Expand Down
6 changes: 4 additions & 2 deletions src/azure-cli/azure/cli/command_modules/storage/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,10 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
help='The name of the storage account within the specified resource group')

with self.argument_context('storage account failover') as c:
c.argument('failover_type', options_list=['--failover-type', '--type'], is_preview=True, default=None,
help="The parameter is set to 'Planned' to indicate whether a Planned failover is requested")
c.argument('failover_type', options_list=['--failover-type', '--type'],
arg_type=get_enum_type(['Unplanned', 'Planned']),
help="Specify the failover type. Possible values are: Unplanned, Planned. "
"If not specified, the default failover type is Unplanned.")
c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation.', action='store_true')

with self.argument_context('storage account delete') as c:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.MGM
'show_storage_account_connection_string')
g.generic_update_command('update', getter_name='get_properties', setter_name='update',
custom_func_name='update_storage_account')
g.custom_command('failover', 'begin_failover', supports_no_wait=True, is_preview=True)
g.custom_command('failover', 'begin_failover', supports_no_wait=True)
g.command('hns-migration start', 'begin_hierarchical_namespace_migration',
supports_no_wait=True)
g.command('hns-migration stop', 'begin_abort_hierarchical_namespace_migration',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,8 @@ def begin_failover(client, resource_group_name, account_name, failover_type=None
3. Once you re-enable GRS/GZRS for your storage account, Microsoft will replicate data to your new secondary region. Replication time is dependent on the amount of data to replicate. Please note that there are bandwidth charges for the bootstrap. Please refer to doc: https://azure.microsoft.com/pricing/details/bandwidth/
"""
user_confirmation(message, yes)
return client.begin_failover(resource_group_name=resource_group_name, account_name=account_name, failover_type=failover_type, **kwargs)
return client.begin_failover(resource_group_name=resource_group_name, account_name=account_name,
failover_type=failover_type, **kwargs)


def list_blob_cors_rules(client, resource_group_name, account_name):
Expand Down
Loading
Loading