|
61 | 61 | ServicePrincipalType, |
62 | 62 | SqlServerMinimalTlsVersionType, |
63 | 63 | SqlManagedInstanceMinimalTlsVersionType, |
64 | | - AuthenticationType |
| 64 | + AuthenticationType, |
| 65 | + FreeLimitExhaustionBehavior |
65 | 66 | ) |
66 | 67 |
|
67 | 68 | from ._validators import ( |
@@ -260,6 +261,19 @@ def get_location_type_with_default_from_resource_group(cli_ctx): |
260 | 261 | options_list=['--availability-zone'], |
261 | 262 | help='Availability zone') |
262 | 263 |
|
| 264 | +database_use_free_limit = CLIArgumentType( |
| 265 | + options_list=['--use-free-limit', '--free-limit'], |
| 266 | + help='Whether or not the database uses free monthly limits. Allowed on one database in a subscription.', |
| 267 | + arg_type=get_three_state_flag()) |
| 268 | + |
| 269 | +database_free_limit_exhaustion_behavior = CLIArgumentType( |
| 270 | + options_list=['--free-limit-exhaustion-behavior', '--exhaustion-behavior', '--fleb'], |
| 271 | + help='Specifies the behavior when monthly free limits are exhausted for the free database.' |
| 272 | + 'AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the month.' |
| 273 | + 'BillForUsage: The database will continue to be online upon exhaustion of free limits' |
| 274 | + 'and any overage will be billed.', |
| 275 | + arg_type=get_enum_type(FreeLimitExhaustionBehavior)) |
| 276 | + |
263 | 277 | managed_instance_param_type = CLIArgumentType( |
264 | 278 | options_list=['--managed-instance', '--mi'], |
265 | 279 | help='Name of the Azure SQL Managed Instance.') |
@@ -382,7 +396,7 @@ def get_location_type_with_default_from_resource_group(cli_ctx): |
382 | 396 | help='The name of the event hub. If none is specified ' |
383 | 397 | 'when providing event_hub_authorization_rule_id, the default event hub will be selected.') |
384 | 398 |
|
385 | | -db_service_objective_examples = 'Basic, S0, P1, GP_Gen4_1, GP_Gen5_S_8, BC_Gen5_2, HS_Gen5_32.' |
| 399 | +db_service_objective_examples = 'Basic, S0, P1, GP_Gen4_1, GP_S_Gen5_8, BC_Gen5_2, HS_Gen5_32.' |
386 | 400 | dw_service_objective_examples = 'DW100, DW1000c' |
387 | 401 |
|
388 | 402 |
|
@@ -486,6 +500,12 @@ def _configure_db_dw_params(arg_ctx): |
486 | 500 | arg_ctx.argument('availability_zone', |
487 | 501 | arg_type=database_availability_zone_param_type) |
488 | 502 |
|
| 503 | + arg_ctx.argument('use_free_limit', |
| 504 | + arg_type=database_use_free_limit) |
| 505 | + |
| 506 | + arg_ctx.argument('free_limit_exhaustion_behavior', |
| 507 | + arg_type=database_free_limit_exhaustion_behavior) |
| 508 | + |
489 | 509 | arg_ctx.argument('encryption_protector_auto_rotation', |
490 | 510 | arg_type=database_encryption_protector_auto_rotation_param_type) |
491 | 511 |
|
@@ -589,7 +609,9 @@ def _configure_db_dw_create_params( |
589 | 609 | 'user_assigned_identity_id', |
590 | 610 | 'federated_client_id', |
591 | 611 | 'availability_zone', |
592 | | - 'encryption_protector_auto_rotation' |
| 612 | + 'encryption_protector_auto_rotation', |
| 613 | + 'use_free_limit', |
| 614 | + 'free_limit_exhaustion_behavior' |
593 | 615 | ]) |
594 | 616 |
|
595 | 617 | # Create args that will be used to build up the Database's Sku object |
@@ -651,6 +673,8 @@ def _configure_db_dw_create_params( |
651 | 673 | arg_ctx.ignore('catalog_collation') |
652 | 674 | arg_ctx.ignore('maintenance_configuration_id') |
653 | 675 | arg_ctx.ignore('is_ledger_on') |
| 676 | + arg_ctx.ignore('use_free_limit') |
| 677 | + arg_ctx.ignore('free_limit_exhaustion_behavior') |
654 | 678 |
|
655 | 679 | # Only applicable to point in time restore or deleted restore create mode. |
656 | 680 | if create_mode not in [CreateMode.restore, CreateMode.point_in_time_restore]: |
@@ -712,11 +736,16 @@ def _configure_db_dw_create_params( |
712 | 736 | arg_ctx.ignore('min_capacity') |
713 | 737 | arg_ctx.ignore('compute_model') |
714 | 738 |
|
| 739 | + # Free limit parameters are not applicable to DataWarehouse |
| 740 | + arg_ctx.ignore('use_free_limit') |
| 741 | + arg_ctx.ignore('free_limit_exhaustion_behavior') |
| 742 | + |
715 | 743 | # ReadScale properties are not valid for DataWarehouse |
716 | 744 | # --read-replica-count was accidentally included in previous releases and |
717 | 745 | # therefore is hidden using `deprecate_info` instead of `ignore` |
718 | 746 | arg_ctx.ignore('read_scale') |
719 | 747 | arg_ctx.ignore('high_availability_replica_count') |
| 748 | + |
720 | 749 | arg_ctx.argument('read_replica_count', |
721 | 750 | options_list=['--read-replica-count'], |
722 | 751 | deprecate_info=arg_ctx.deprecate(hide=True)) |
@@ -905,6 +934,12 @@ def load_arguments(self, _): |
905 | 934 | c.argument('availability_zone', |
906 | 935 | arg_type=database_availability_zone_param_type) |
907 | 936 |
|
| 937 | + c.argument('use_free_limit', |
| 938 | + arg_type=database_use_free_limit) |
| 939 | + |
| 940 | + c.argument('free_limit_exhaustion_behavior', |
| 941 | + arg_type=database_free_limit_exhaustion_behavior) |
| 942 | + |
908 | 943 | with self.argument_context('sql db export') as c: |
909 | 944 | # Create args that will be used to build up the ExportDatabaseDefinition object |
910 | 945 | create_args_for_complex_type( |
|
0 commit comments