Skip to content

Commit

Permalink
[Service Bus] az servicebus namespace create: Add zone redundant p…
Browse files Browse the repository at this point in the history
…arameter (#22099)
  • Loading branch information
damodaravadhani authored Apr 19, 2022
1 parent 41b4222 commit f08940c
Show file tree
Hide file tree
Showing 4 changed files with 512 additions and 300 deletions.
3 changes: 3 additions & 0 deletions src/azure-cli/azure/cli/command_modules/servicebus/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def load_arguments_sb(self, _):
c.argument('tags', arg_type=tags_type)
c.argument('sku', arg_type=get_enum_type(SkuName), help='Namespace SKU.')
c.argument('capacity', type=int, choices=[1, 2, 4, 8, 16], help='Number of message units. This property is only applicable to namespaces of Premium SKU', validator=validate_premiumsku_capacity)
c.argument('zone_redundant', options_list=['--zone-redundant'], is_preview=True,
arg_type=get_three_state_flag(),
help='Enabling this property creates a Standard Service Bus Namespace in regions supported availability zones')
c.argument('mi_system_assigned', arg_group='Managed Identity',
arg_type=get_three_state_flag(),
help='Enable System Assigned Identity')
Expand Down
5 changes: 4 additions & 1 deletion src/azure-cli/azure/cli/command_modules/servicebus/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Namespace Region
def cli_namespace_create(cmd, client, resource_group_name, namespace_name, location=None, tags=None, sku='Standard',
capacity=None, default_action=None, mi_system_assigned=None, mi_user_assigned=None, encryption_config=None):
capacity=None, zone_redundant=None, default_action=None, mi_system_assigned=None, mi_user_assigned=None, encryption_config=None):

SBSku = cmd.get_models('SBSku', resource_type=ResourceType.MGMT_SERVICEBUS)
SBNamespace = cmd.get_models('SBNamespace', resource_type=ResourceType.MGMT_SERVICEBUS)
Expand All @@ -29,6 +29,9 @@ def cli_namespace_create(cmd, client, resource_group_name, namespace_name, locat
parameter.tags = tags
parameter.sku = SBSku(name=sku, tier=sku, capacity=capacity)

if zone_redundant is not None:
parameter.zone_redundant = zone_redundant

if mi_system_assigned:
parameter.identity = Identity(type=IdentityType.SYSTEM_ASSIGNED)

Expand Down
Loading

0 comments on commit f08940c

Please sign in to comment.