From 973c7bf4cb395a85ac2ce77d19edad29b3508c17 Mon Sep 17 00:00:00 2001 From: Jared Moore Date: Mon, 13 Jan 2020 13:57:13 -0800 Subject: [PATCH 1/2] Documented sql db restore time format Fixes #9273 --- src/azure-cli/azure/cli/command_modules/sql/_params.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/sql/_params.py b/src/azure-cli/azure/cli/command_modules/sql/_params.py index 5d8778d1183..5b21cdba7b6 100644 --- a/src/azure-cli/azure/cli/command_modules/sql/_params.py +++ b/src/azure-cli/azure/cli/command_modules/sql/_params.py @@ -113,6 +113,7 @@ def __repr__(self): server_configure_help = 'You can configure the default using `az configure --defaults sql-server=`' +time_format_help = 'Time should be in following format: "YYYY-MM-DDTHH:MM:SS".' def get_location_type_with_default_from_resource_group(cli_ctx): return CLIArgumentType( @@ -484,14 +485,16 @@ def load_arguments(self, _): arg_group=restore_point_arg_group, help='The point in time of the source database that will be restored to create the' ' new database. Must be greater than or equal to the source database\'s' - ' earliestRestoreDate value. Either --time or --deleted-time (or both) must be specified.') + ' earliestRestoreDate value. Either --time or --deleted-time (or both) must be specified. ' + + time_format_help) c.argument('source_database_deletion_date', options_list=['--deleted-time'], arg_group=restore_point_arg_group, help='If specified, restore from a deleted database instead of from an existing database.' ' Must match the deleted time of a deleted database in the same server.' - ' Either --time or --deleted-time (or both) must be specified.') + ' Either --time or --deleted-time (or both) must be specified. ' + + time_format_help) with self.argument_context('sql db show') as c: # Service tier advisors and transparent data encryption are not included in the first batch @@ -1376,7 +1379,7 @@ def _configure_security_policy_storage_params(arg_ctx): required=True, help='The point in time of the source database that will be restored to create the' ' new database. Must be greater than or equal to the source database\'s' - ' earliestRestoreDate value. Time should be in following format: "YYYY-MM-DDTHH:MM:SS"') + ' earliestRestoreDate value. ' + time_format_help) with self.argument_context('sql midb list') as c: c.argument('managed_instance_name', id_part=None) From a778e8977d8b0f68386694c4f54b1ceed49a71a7 Mon Sep 17 00:00:00 2001 From: Jared Moore Date: Thu, 16 Jan 2020 13:33:23 -0800 Subject: [PATCH 2/2] Style --- src/azure-cli/azure/cli/command_modules/sql/_params.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/azure-cli/azure/cli/command_modules/sql/_params.py b/src/azure-cli/azure/cli/command_modules/sql/_params.py index 5b21cdba7b6..520187db55c 100644 --- a/src/azure-cli/azure/cli/command_modules/sql/_params.py +++ b/src/azure-cli/azure/cli/command_modules/sql/_params.py @@ -115,6 +115,7 @@ def __repr__(self): time_format_help = 'Time should be in following format: "YYYY-MM-DDTHH:MM:SS".' + def get_location_type_with_default_from_resource_group(cli_ctx): return CLIArgumentType( arg_type=get_location_type(cli_ctx),