Skip to content

Commit 09ce26b

Browse files
committed
planned failover GA
1 parent a469a8c commit 09ce26b

File tree

6 files changed

+1878
-43
lines changed

6 files changed

+1878
-43
lines changed

src/azure-cli/azure/cli/command_modules/storage/_help.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,12 @@
227227
cluster will become primary after failover. For more information, please refer to
228228
https://learn.microsoft.com/azure/storage/common/storage-disaster-recovery-guidance.
229229
examples:
230-
- name: Failover a storage account.
230+
- name: Unplanned Failover a storage account.
231231
text: |
232232
az storage account failover -n mystorageaccount -g MyResourceGroup
233+
- name: Planned Failover a storage account.
234+
text: |
235+
az storage account failover -n mystorageaccount -g MyResourceGroup --failover-type Planned
233236
- name: Failover a storage account without waiting for complete.
234237
text: |
235238
az storage account failover -n mystorageaccount -g MyResourceGroup --no-wait

src/azure-cli/azure/cli/command_modules/storage/_params.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,10 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
314314
help='The name of the storage account within the specified resource group')
315315

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

321323
with self.argument_context('storage account delete') as c:

src/azure-cli/azure/cli/command_modules/storage/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.MGM
107107
'show_storage_account_connection_string')
108108
g.generic_update_command('update', getter_name='get_properties', setter_name='update',
109109
custom_func_name='update_storage_account')
110-
g.custom_command('failover', 'begin_failover', supports_no_wait=True, is_preview=True)
110+
g.custom_command('failover', 'begin_failover', supports_no_wait=True)
111111
g.command('hns-migration start', 'begin_hierarchical_namespace_migration',
112112
supports_no_wait=True)
113113
g.command('hns-migration stop', 'begin_abort_hierarchical_namespace_migration',

src/azure-cli/azure/cli/command_modules/storage/operations/account.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,8 @@ def begin_failover(client, resource_group_name, account_name, failover_type=None
12521252
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/
12531253
"""
12541254
user_confirmation(message, yes)
1255-
return client.begin_failover(resource_group_name=resource_group_name, account_name=account_name, failover_type=failover_type, **kwargs)
1255+
return client.begin_failover(resource_group_name=resource_group_name, account_name=account_name,
1256+
failover_type=failover_type, **kwargs)
12561257

12571258

12581259
def list_blob_cors_rules(client, resource_group_name, account_name):

0 commit comments

Comments
 (0)