diff --git a/src/servicebus/.idea/misc.xml b/src/servicebus/.idea/misc.xml
new file mode 100644
index 00000000000..e1b61fdec72
--- /dev/null
+++ b/src/servicebus/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/servicebus/.idea/modules.xml b/src/servicebus/.idea/modules.xml
new file mode 100644
index 00000000000..121669a25e9
--- /dev/null
+++ b/src/servicebus/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/servicebus/.idea/servicebus.iml b/src/servicebus/.idea/servicebus.iml
new file mode 100644
index 00000000000..6f63a63ccb6
--- /dev/null
+++ b/src/servicebus/.idea/servicebus.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/servicebus/.idea/workspace.xml b/src/servicebus/.idea/workspace.xml
new file mode 100644
index 00000000000..2770b1df9d2
--- /dev/null
+++ b/src/servicebus/.idea/workspace.xml
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1513462879511
+
+
+ 1513462879511
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/servicebus/azext_servicebus/__init__.py b/src/servicebus/azext_servicebus/__init__.py
new file mode 100644
index 00000000000..94404ef1427
--- /dev/null
+++ b/src/servicebus/azext_servicebus/__init__.py
@@ -0,0 +1,29 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+from azure.cli.core import AzCommandsLoader
+
+import azure.cli.command_modules.servicebus._help # pylint: disable=unused-import
+
+
+class ServicebusCommandsLoader(AzCommandsLoader):
+
+ def __init__(self, cli_ctx=None):
+ from azure.cli.core.sdk.util import CliCommandType
+ servicebus_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.servicebus.custom#{}')
+ super(ServicebusCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=servicebus_custom,
+ min_profile="2017-03-10-profile")
+
+ def load_command_table(self, args):
+ from azure.cli.command_modules.servicebus.commands import load_command_table
+ load_command_table(self, args)
+ return self.command_table
+
+ def load_arguments(self, command):
+ from azure.cli.command_modules.servicebus._params import load_arguments
+ load_arguments(self, command)
+
+
+COMMAND_LOADER_CLS = ServicebusCommandsLoader
diff --git a/src/servicebus/azext_servicebus/_client_factory.py b/src/servicebus/azext_servicebus/_client_factory.py
new file mode 100644
index 00000000000..c0e52256eba
--- /dev/null
+++ b/src/servicebus/azext_servicebus/_client_factory.py
@@ -0,0 +1,50 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+
+def cf_servicebus(cli_ctx, **_):
+ from azure.cli.core.commands.client_factory import get_mgmt_service_client
+ from azure.mgmt.servicebus import ServiceBusManagementClient
+ return get_mgmt_service_client(cli_ctx, ServiceBusManagementClient)
+
+
+def namespaces_mgmt_client_factory(cli_ctx, _):
+ return cf_servicebus(cli_ctx).namespaces
+
+
+def queues_mgmt_client_factory(cli_ctx, _):
+ return cf_servicebus(cli_ctx).queues
+
+
+def topics_mgmt_client_factory(cli_ctx, _):
+ return cf_servicebus(cli_ctx).topics
+
+
+def subscriptions_mgmt_client_factory(cli_ctx, _):
+ return cf_servicebus(cli_ctx).subscriptions
+
+
+def rules_mgmt_client_factory(cli_ctx, _):
+ return cf_servicebus(cli_ctx).rules
+
+
+def regions_mgmt_client_factory(cli_ctx, _):
+ return cf_servicebus(cli_ctx).regions
+
+
+def premium_messaging_mgmt_client_factory(cli_ctx, _):
+ return cf_servicebus(cli_ctx).premium_messaging
+
+
+def event_subscriptions_mgmt_client_factory(cli_ctx, _):
+ return cf_servicebus(cli_ctx).event_subscriptions
+
+
+def event_hubs_mgmt_client_factory(cli_ctx, _):
+ return cf_servicebus(cli_ctx).event_hubs
+
+
+def disaster_recovery_mgmt_client_factory(cli_ctx, _):
+ return cf_servicebus(cli_ctx).disaster_recovery_configs
diff --git a/src/servicebus/azext_servicebus/_exception_handler.py b/src/servicebus/azext_servicebus/_exception_handler.py
new file mode 100644
index 00000000000..bd08596e219
--- /dev/null
+++ b/src/servicebus/azext_servicebus/_exception_handler.py
@@ -0,0 +1,17 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+from knack.util import CLIError
+
+
+def servicebus_exception_handler(ex):
+ from azure.mgmt.servicebus.models import ErrorResponseException
+ if isinstance(ex, ErrorResponseException):
+ message = ex.error.error.message
+ raise CLIError(message)
+ else:
+ import sys
+ from six import reraise
+ reraise(*sys.exc_info())
diff --git a/src/servicebus/azext_servicebus/_help.py b/src/servicebus/azext_servicebus/_help.py
new file mode 100644
index 00000000000..0b81a6229c8
--- /dev/null
+++ b/src/servicebus/azext_servicebus/_help.py
@@ -0,0 +1,21 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+from knack.help_files import helps
+
+helps['servicebus'] = """
+ type: group
+ short-summary: Manage Azure .
+"""
+
+helps['servicebus namespace'] = """
+ type: group
+ short-summary: Get .
+"""
+
+helps['servicebus queue'] = """
+ type: group
+ short-summary: Get .
+"""
diff --git a/src/servicebus/azext_servicebus/_params.py b/src/servicebus/azext_servicebus/_params.py
new file mode 100644
index 00000000000..06ca633d9d4
--- /dev/null
+++ b/src/servicebus/azext_servicebus/_params.py
@@ -0,0 +1,273 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+from azure.cli.core.commands.parameters import (
+ get_location_type, get_resource_name_completion_list, tags_type,
+ file_type, get_enum_type, zone_type, zones_type, resource_group_name_type, name_type)
+
+from azure.cli.command_modules.servicebus._validators import _validate_max_delivery_count, _validate_maxSizeInMegabytes,\
+ _validate_dead_lettering_on_message_expiration, _validate_requires_session, _validate_enable_batched_operations, \
+ _validate_support_ordering, _validate_enable_express, _validate_enable_partitioning, _validate_dead_lettering_on_message_expiration,\
+ _validate_requires_session, _validate_requiresDuplicateDetection, _validate_auto_delete_on_idle, \
+ _validate_duplicate_detection_history_time_window, _validate_default_message_time_to_live, _validate_lock_duration
+
+
+# pylint: disable=line-too-long
+def load_arguments(self, _):
+
+ # region - Namespace Create
+
+ with self.argument_context('sb namespace check_name_availability') as c:
+ c.argument('namespace_name', options_list=['--name'], required=True, help='name of the Namespace')
+
+ with self.argument_context('sb namespace create') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True)
+ c.argument('namespace_name', options_list=['--name'], required=True, help='name of the Namespace')
+ c.argument('tags', options_list=['--tags', '-t'], arg_type=tags_type, help='tags for the namespace in Key value pair format')
+ c.argument('sku', options_list=['--sku-name'], arg_type=get_enum_type(['Basic', 'Standard', 'Premium']), help='Sku name and allowed values are, Basic, Standard, Premium')
+ c.argument('location', options_list=['--location', '-l'], help='Location')
+ c.argument('skutier', option_list=['--skutier'], arg_type=get_enum_type(['Basic', 'Standard', 'Premium']), help='Sku Tire with allowed values are, Basic, Standard, Premium')
+ c.argument('capacity', option_list=['--capacity'], help='Capacity for Sku')
+
+ # region Namespace Get
+ for scope in ['sb namespace get', 'sb namespace delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True)
+ c.argument('namespace_name', options_list=['--name', '-n'], required=True, help='name of the Namespace')
+
+ with self.argument_context('sb namespace list') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=False)
+
+ # region Namespace Authorizationrule
+ for scope in ['sb namespace authorizationrule create', 'sb namespace authorizationrule get', 'sb namespace authorizationrule listkeys', 'sb namespace authorizationrule regeneratekeys', 'sb namespace authorizationrule delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace'),
+ c.argument('authorization_rule_name', options_list=['--name'], required=True, help='name of the Namespace AuthorizationRule')
+
+ with self.argument_context('sb namespace authorizationrule create') as c:
+ c.argument('accessrights', options_list=['--access-rights'], required=False, help='Authorization rule rights of type list, allowed values are Send, Listen or Manage')
+
+ with self.argument_context('sb namespace authorizationrule regeneratekeys') as c:
+ c.argument('key_type', options_list=['--regeneratekey'], required=True, arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey']), help='Authorization rule rights of type list, allowed values are Send, Listen or Manage')
+
+###################################################################
+ # region - Queue Create
+ with self.argument_context('sb queue create') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True)
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace')
+ c.argument('queue_name', options_list=['--name', '-n'], required=True, help='Queue Name'),
+ c.argument('lock_duration', options_list=['--lock-duration'], validator=_validate_lock_duration, help='String ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute.'),
+ c.argument('max_size_in_megabytes', options_list=['--max-size-in-megabytes'], type=int, validator=_validate_maxSizeInMegabytes, help='The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. Default is 1024.'),
+ c.argument('requires_duplicate_detection', options_list=['--requires-duplicate-detection'], type=bool, validator=_validate_requiresDuplicateDetection, help='A boolean value indicating if this queue requires duplicate detection.'),
+ c.argument('requires_session', options_list=['--requires-session'], type=bool, validator=_validate_requires_session, help='A boolean value that indicates whether the queue supports the concept of sessions.'),
+ c.argument('default_message_time_to_live', options_list=['--default-message-time-to-live'], validator=_validate_default_message_time_to_live, help='ISO 8601 default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.'),
+ c.argument('dead_lettering_on_message_expiration', options_list=['--dead-lettering-on-message-expiration'], validator=_validate_dead_lettering_on_message_expiration, help='A boolean value that indicates whether this queue has dead letter support when a message expires.'),
+ c.argument('duplicate_detection_history_time_window', options_list=['--duplicate-detection-history-time-window'], validator=_validate_duplicate_detection_history_time_window, help='ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.'),
+ c.argument('max_delivery_count', options_list=['--max-delivery-count'], validator=_validate_max_delivery_count, help='The maximum delivery count. A message is automatically deadlettered after this number of deliveries. default value is 10.'),
+ c.argument('status', options_list=['--status'], arg_type=get_enum_type(['Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming','Unknown']), help='Enumerates the possible values for the status of a messaging entity.'),
+ c.argument('auto_delete_on_idle', options_list=['--auto-delete-on-idle'], validator=_validate_auto_delete_on_idle, help='ISO 8601 timeSpan idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes.'),
+ c.argument('enable_partitioning', options_list=['--enable-partitioning'], validator=_validate_enable_partitioning, help='A boolean value that indicates whether the queue is to be partitioned across multiple message brokers.'),
+ c.argument('enable_express', options_list=['--enable-express'], validator=_validate_enable_express, help='A boolean value that indicates whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage.')
+ c.argument('forward_to', options_list=['--forward-to'], arg_type=name_type, help='Queue/Topic name to forward the messages'),
+ c.argument('forward_dead_lettered_messages_to', arg_type=name_type, options_list=['--forward-dead-lettered-messages-to'], help='Queue/Topic name to forward the Dead Letter message')
+
+ # region Queue Get
+ for scope in ['sb queue get', 'sb queue delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True)
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace')
+ c.argument('queue_name', options_list=['--name', '-n'], required=True, help='Queue Name')
+
+ # region Queue Get
+ with self.argument_context('sb queue list') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True)
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace')
+
+ # region Queue Authorizationrule
+ for scope in ['sb queue authorizationrule create', 'sb queue authorizationrule get', 'sb queue authorizationrule delete',
+ 'sb queue authorizationrule listkeys',
+ 'sb queue authorizationrule regeneratekeys']:
+ with self.argument_context(scope) as c:
+ c.argument('authorization_rule_name', options_list=['--name'], required=True,
+ help='name of the Queue AuthorizationRule')
+ c.argument('namespace', options_list=['--namespace-name'], required=True,
+ help='name of the Namespace')
+ c.argument('queuename', options_list=['--queue-name'], required=True,
+ help='name of the Queue')
+
+ with self.argument_context('sb queue authorizationrule create') as c:
+ c.argument('accessrights', options_list=['--access-rights'], required=False,
+ help='Authorization rule rights of type list, allowed values are Send, Listen or Manage')
+
+ with self.argument_context('sb queue authorizationrule regeneratekeys') as c:
+ c.argument('key_type', options_list=['--regeneratekey'], required=True,
+ arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey']),
+ help='Authorization rule rights of type list, allowed values are Send, Listen or Manage')
+
+ #################################################################
+ # region - Topic Create
+ with self.argument_context('sb topic create') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace'),
+ c.argument('topic_name', options_list=['--name', '-n'], required=True, help='Topic Name'),
+ c.argument('default_message_time_to_live', options_list=['--default-message-time-to-live'], validator=_validate_default_message_time_to_live, help='ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.'),
+ c.argument('max_size_in_megabytes', options_list=['--max-size-in-megabytes'], validator=_validate_maxSizeInMegabytes, help='Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. Default is 1024.'),
+ c.argument('requires_duplicate_detection', options_list=['--requires-duplicate-detection'], validator=_validate_requiresDuplicateDetection, help='Value indicating if this topic requires duplicate detection.'),
+ c.argument('duplicate_detection_history_time_window', options_list=['--duplicate-detection-history-time-window'], validator=_validate_duplicate_detection_history_time_window, help='ISO8601 timespan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.'),
+ c.argument('enable_batched_operations', options_list=['--enable-batched-operations'], validator=_validate_enable_batched_operations, help='Value that indicates whether server-side batched operations are enabled.'),
+ c.argument('status', options_list=['--status'], arg_type=get_enum_type(['Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming','Unknown']), help='Enumerates the possible values for the status of a messaging entity.'),
+ c.argument('support_ordering', options_list=['--support-ordering'], validator=_validate_support_ordering, help='Value that indicates whether the topic supports ordering.'),
+ c.argument('auto_delete_on_idle', options_list=['--auto-delete-on-idle'], validator=_validate_auto_delete_on_idle, help='ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes.'),
+ c.argument('enable_partitioning', options_list=['--enable-partitioning'], validator=_validate_enable_partitioning, help='Value that indicates whether the topic to be partitioned across multiple message brokers is enabled.'),
+ c.argument('enable_express', options_list=['--enable-express'], validator=_validate_enable_express, help='Value that indicates whether Express Entities are enabled. An express topic holds a message in memory temporarily before writing it to persistent storage.')
+
+ # region Topic Get
+ for scope in ['sb topic get', 'servicebus topic delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace'),
+ c.argument('topic_name', options_list=['--name', '-n'], help='Topic Name')
+
+ with self.argument_context('sb topic list') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name', '-n'], required=True, help='name of the Namespace')
+
+ # region Topic Authorizationrule
+ for scope in ['sb topic authorizationrule create', 'sb topic authorizationrule get', 'sb topic authorizationrule delete',
+ 'sb topic authorizationrule listkeys',
+ 'sb topic authorizationrule regeneratekeys']:
+ with self.argument_context(scope) as c:
+ c.argument('authorization_rule_name', options_list=['--name'], required=True,
+ help='name of the Topic AuthorizationRule')
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True,
+ help='name of the Namespace')
+ c.argument('topic_name', options_list=['--topic-name'], required=True,
+ help='name of the Topic')
+
+ with self.argument_context('servicebus topic authorizationrule create') as c:
+ c.argument('accessrights', options_list=['--access-rights'], required=False,
+ help='Authorization rule rights of type list, allowed values are Send, Listen or Manage')
+
+ with self.argument_context('servicebus topic authorizationrule regeneratekeys') as c:
+ c.argument('key_type', options_list=['--regeneratekey'], required=True,
+ arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey']),
+ help='Authorization rule rights of type list, allowed values are Send, Listen or Manage')
+
+
+#################################################################
+ # region - Subscription Create
+ with self.argument_context('sb subscription create') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True,help='name of the Namespace'),
+ c.argument('topic_name', options_list=['--topic-name'], required=True, help='Topic Name'),
+ c.argument('subscription_name', options_list=['--name'], required=True, help='Subscription Name'),
+ c.argument('lock_duration', options_list=['--lock-duration'], validator=_validate_lock_duration, help='ISO 8601 lock duration timespan for the subscription. The default value is 1 minute.'),
+ c.argument('requires_session', options_list=['--enable-express'], validator=_validate_requires_session, help='A boolean value that indicates whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage.')
+ c.argument('default_message_time_to_live', options_list=['--default-message-time-to-live'], validator=_validate_default_message_time_to_live, help='ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.'),
+ c.argument('dead_lettering_on_message_expiration', options_list=['--dead-lettering-on-message-expiration'], validator=_validate_dead_lettering_on_message_expiration, help='A boolean Value that indicates whether a subscription has dead letter support when a message expires.'),
+ c.argument('duplicate_detection_history_time_window', options_list=['--duplicate-detection-history-time-window'], validator=_validate_duplicate_detection_history_time_window, help='ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.'),
+ c.argument('max_delivery_count', options_list=['--max-delivery-count'], validator=_validate_max_delivery_count, help='Number of maximum deliveries.'),
+ c.argument('status', options_list=['--status'], arg_type=get_enum_type(['Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming','Unknown']), help='Enumerates the possible values for the status of a messaging entity.'),
+ c.argument('enable_batched_operations', validator=_validate_enable_batched_operations, options_list=['--enable-batched-operations'], help='Value that indicates whether server-side batched operations are enabled.'),
+ c.argument('auto_delete_on_idle', validator=_validate_auto_delete_on_idle, options_list=['--auto-delete-on-idle'], help='ISO 8601 timeSpan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes.'),
+ # c.argument('forward_to', options_list=['--forward-to'], help='Queue/Topic name to forward the messages'),
+ # c.argument('forward_dead_lettered_messages_to', options_list=['--forward-dead-lettered-messages-to'], help='Queue/Topic name to forward the Dead Letter message')
+
+ # region Subscription Get
+ for scope in ['sb subscription get', 'servicebus subscription delete']:
+ with self.argument_context(scope) as c:
+ c.argument('namespacename', options_list=['--namespace-name'], required=True, help='name of the Namespace'),
+ c.argument('topic_name', options_list=['--topic-name'], help='name of the Topic'),
+ c.argument('subscription_name', options_list=['--name'], help='name of the Subscription of Topic')
+
+ with self.argument_context('sb subscription list') as c:
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace'),
+ c.argument('topic_name', options_list=['--topic-name'], required=True, help='name of the Topic')
+
+###### Region Subscription Rules
+
+# Rules Create
+
+ with self.argument_context('sb rule create') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace'),
+ c.argument('topic_name', options_list=['--topic-name'], required=True, help='Topic Name'),
+ c.argument('subscription_name', options_list=['--subscription-name'], required=True, help='Subscription Name'),
+ c.argument('rule_name', options_list=['--name', '-n'], required=True, help='Rule Name'),
+ c.argument('action_sql_expression', options_list=['--action-sql-expression'], help='Action SQL expression.'),
+ c.argument('action_compatibility_level', options_list=['--action-compatibility-level'], type=int, help='This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20.'),
+ c.argument('action_requires_preprocessing', type=bool, default=True, options_list=['--action-requires-preprocessing'], help='Value that indicates whether the rule action requires preprocessing.'),
+ c.argument('filter_sql_expression', options_list=['--filter-sql-expression'], help='SQL expression. e.g.'),
+ c.argument('filter_requires_preprocessing', type=bool, default=True, options_list=['--sql-requires-preprocessing'], help='Value that indicates whether the rule action requires preprocessing.'),
+ c.argument('correlation_id', options_list=['--correlation-id'], help='Identifier of the correlation.'),
+ c.argument('message_id', options_list=['--message-id'], help='Identifier of the message.'),
+ c.argument('to', options_list=['--to'], help='Address to send to.'),
+ c.argument('reply_to', options_list=['--reply_to'], help='Address of the queue to reply to.'),
+ c.argument('label', options_list=['--label'], help='Application specific label.'),
+ c.argument('session_id', options_list=['--session-id'], help='sessionId'),
+ c.argument('reply_to_session_d', options_list=['--reply-to-session-id'], help='Session identifier to reply to.'),
+ c.argument('content_type', options_list=['--content-type'], help='Content type of the message.'),
+ c.argument('requires_preprocessing', type=bool, default=True, options_list=['--requires-preprocessing'], help='Value that indicates whether the rule action requires preprocessing.')
+
+ for scope in ['sb rule get', 'sb rule delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True,
+ help='name of the Namespace'),
+ c.argument('topic_name', options_list=['--topic-name'], required=True, help='Topic Name'),
+ c.argument('subscription_name', options_list=['--subscription-name'], required=True,
+ help='Subscription Name'),
+ c.argument('rule_name', options_list=['--name'], required=True, help='Rule Name')
+
+ with self.argument_context('sb rules list') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True,
+ help='name of the Namespace'),
+ c.argument('topic_name', options_list=['--topic-name'], required=True, help='Topic Name'),
+ c.argument('subscription_name', options_list=['--subscription-name'], required=True,
+ help='Subscription Name')
+
+
+#### Geo DR - Disaster Recovery Configs - Alias : Region
+
+
+ with self.argument_context('sb alias check_name_availability') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace'),
+ c.argument('name', options_list=['--alias'], required=True, help='Name of the Alias (Disaster Recovery) to check availability')
+
+
+ with self.argument_context('sb alias create') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace'),
+ c.argument('alias', options_list=['--alias'], required=True, help='Name of the Alias (Disaster Recovery)'),
+ c.argument('partner_namespace', options_list=['--partner-namespace'], required=True, help='ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairning'),
+ c.argument('alternate_name', options_list=['--alternate-name'], required=False, help='Alternate Name for the Alias, when the Namespace name and Alias name are same')
+
+ for scope in ['sb alias get', 'sb alias delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace'),
+ c.argument('alias', options_list=['--alias'], required=True, help='Name of the Alias (Disaster Recovery)')
+
+
+ with self.argument_context('sb alias list') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace')
+
+ for scope in ['sb alias break_pairing', 'sb alias fail_over', 'sb alias list_authorization_rules']:
+ with self.argument_context(scope)as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type, required=True),
+ c.argument('namespace_name', options_list=['--namespace-name'], required=True, help='name of the Namespace'),
+ c.argument('alias', options_list=['--alias'], required=True, help='Name of the Alias (Disaster Recovery)')
+
+
+ for scope in ['sb alias get_authorization_rule', 'sb alias list_keys']:
+ with self.argument_context(scope)as c:
+ c.argument('resource_group_name', required=True, arg_type=resource_group_name_type),
+ c.argument('namespace_name', required=True, options_list=['--namespace-name'], help='name of the Namespace'),
+ c.argument('alias', options_list=['--alias'], required=True, help='Name of the Alias (Disaster Recovery)'),
+ c.argument('authorization_rule_name', required=True, options_list=['--name'], help='name of the Topic AuthorizationRule')
diff --git a/src/servicebus/azext_servicebus/_utils.py b/src/servicebus/azext_servicebus/_utils.py
new file mode 100644
index 00000000000..3a3e066e276
--- /dev/null
+++ b/src/servicebus/azext_servicebus/_utils.py
@@ -0,0 +1,34 @@
+from azure.mgmt.servicebus.models.service_bus_management_client_enums import SkuName, SkuTier, AccessRights, KeyType
+
+
+def skunameconverter(skuname):
+
+ if skuname == 'Basic':
+ return SkuName.basic
+ if skuname == 'Standard':
+ return SkuName.standard
+ if skuname == 'Premium':
+ return SkuName.premium
+
+
+def skutireconverter(skutire):
+
+ if skutire == 'Basic':
+ return SkuTier.basic
+ if skutire == 'Standard':
+ return SkuTier.standard
+ if skutire == 'Premium':
+ return SkuTier.premium
+
+
+def accessrights_converter(accesrights):
+
+ if len(accesrights) > 0 :
+ for index in range(len(accesrights)):
+ if accesrights[index] == 'Send':
+ accesrights[index] = AccessRights.send
+ if accesrights[index] == 'Manage':
+ accesrights[index] = AccessRights.manage
+ if accesrights[index] == 'Listen':
+ accesrights[index] = AccessRights.listen
+ return accesrights
diff --git a/src/servicebus/azext_servicebus/_validators.py b/src/servicebus/azext_servicebus/_validators.py
new file mode 100644
index 00000000000..fef6971706f
--- /dev/null
+++ b/src/servicebus/azext_servicebus/_validators.py
@@ -0,0 +1,119 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+import argparse
+import base64
+import socket
+import os
+import re
+import isodate
+from isodate import ISO8601Error
+
+from azure.cli.core.commands.validators import \
+ (validate_tags, get_default_location_from_resource_group)
+from azure.cli.core.commands.template_create import get_folded_parameter_validator
+from azure.cli.core.commands.client_factory import get_subscription_id, get_mgmt_service_client
+from azure.cli.core.commands.validators import validate_parameter_set
+from azure.cli.core.profiles import ResourceType
+
+from knack.util import CLIError
+
+# PARAMETER VALIDATORS
+
+###### Queue Parameters
+
+def _validate_maxSizeInMegabytes(namespace):
+ if namespace.max_size_in_megabytes:
+ if type(namespace.max_size_in_megabytes) == int:
+ if namespace.max_size_in_megabytes not in [1024, 2048, 3072, 4096, 5120]:
+ raise CLIError('--max-size-in-megabytes value error: {0} is not allowed, allowed values are [1024, 2048, 3072, 4096, 5120]'.format(namespace.max_size_in_megabytes))
+ else:
+ raise CLIError('--max-size-in-megabytes Value Error: {} value is not in interger format'.format(namespace.max_size_in_megabytes))
+
+
+def _validate_max_delivery_count(namespace):
+ if namespace.max_delivery_count:
+ if type(namespace.max_delivery_count) != int:
+ raise CLIError('--max-delivery-count Value Error: {} value is not in interger format'.format(namespace.max_delivery_count))
+
+
+### Type Boolean
+def _validate_requiresDuplicateDetection(namespace):
+ if namespace.requires_duplicate_detection:
+ if type(namespace.requires_duplicate_detection) != bool:
+ raise CLIError('--requires-duplicate-detection Value Error : {0} value is not in boolean format (True/False)'.format(namespace.requires_duplicate_detection))
+
+
+def _validate_requires_session(namespace):
+ if namespace.requires_session:
+ if type(namespace.requires_session) != bool:
+ raise CLIError('--requires-session Value Error : {0} value is not in boolean format (True/False)'.format(namespace.requires_session))
+
+
+def _validate_dead_lettering_on_message_expiration(namespace):
+ if namespace.dead_lettering_on_message_expiration:
+ if type(namespace.dead_lettering_on_message_expiration) != bool:
+ raise CLIError('--dead-lettering-on-message-expiration Type Error : {0} value is not in boolean format (True/False)'.format(namespace.dead_lettering_on_message_expiration))
+
+def _validate_enable_partitioning(namespace):
+ if namespace.enable_partitioning:
+ if type(namespace.enable_partitioning) != bool:
+ raise CLIError('--enable-partitioning Value Error : {0} value is not in boolean format (True/False)'.format(namespace.enable_partitioning))
+
+def _validate_enable_express(namespace):
+ if namespace.enable_express:
+ if type(namespace.enable_express) != bool:
+ raise CLIError('--enable-express Value Error : {0} value is not in boolean format (True/False)'.format(namespace.enable_express))
+
+
+def _validate_support_ordering(namespace):
+ if namespace.support_ordering:
+ if type(namespace.support_ordering) != bool:
+ raise CLIError('--support-ordering Value Error : {0} value is not in boolean format (True/False)'.format(namespace.support_ordering))
+
+def _validate_enable_batched_operations(namespace):
+ if namespace.enable_batched_operations:
+ if type(namespace.enable_batched_operations) != bool:
+ raise CLIError('--enable-batched-operations Value Error : {0} value is not in boolean format (True/False)'.format(namespace.enable_batched_operations))
+
+def _validate_requires_session(namespace):
+ if namespace.requires_session:
+ if type(namespace.requires_session) != bool:
+ raise CLIError('--requires-sessionValue Error : {0} value is not in boolean format (True/False)'.format(namespace.requires_session))
+
+def _validate_dead_lettering_on_message_expiration(namespace):
+ if namespace.dead_lettering_on_message_expiration:
+ if type(namespace.dead_lettering_on_message_expiration) != bool:
+ raise CLIError('--dead-lettering-on-message-expiration Value Error : {0} value is not in boolean format (True/False)'.format(namespace.dead_lettering_on_message_expiration))
+
+
+### Type ISO 8061 duration
+
+iso8601pattern = re.compile("^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+.)?(\d+S)?)?$")
+
+def _validate_lock_duration(namespace):
+ if namespace.lock_duration:
+ if not iso8601pattern.match(namespace.lock_duration):
+ raise CLIError('--lock-duration Value Error : {0} value is not in ISO 8601 timespan/duration format. e.g. PT10M for duration of 10 min'.format(namespace.lock_duration))
+
+def _validate_default_message_time_to_live(namespace):
+ if namespace.default_message_time_to_live:
+ if not iso8601pattern.match(namespace.default_message_time_to_live):
+ raise CLIError('--default-message-time-to-live Value Error : {0} value is not in ISO 8601 timespan/duration format. e.g. PT10M for duration of 10 min'.format(namespace.default_message_time_to_live))
+
+def _validate_duplicate_detection_history_time_window(namespace):
+ if namespace.duplicate_detection_history_time_window:
+ if not iso8601pattern.match(namespace.duplicate_detection_history_time_window):
+ raise CLIError('--duplicate-detection-history-time-window Value Error : {0} value is not in ISO 8601 timespan/duration format. e.g. PT10M for duration of 10 min'.format(namespace.duplicate_detection_history_time_window))
+
+def _validate_auto_delete_on_idle(namespace):
+ if namespace.auto_delete_on_idle:
+ if not iso8601pattern.match(namespace.auto_delete_on_idle):
+ raise CLIError('--auto-delete-on-idle Value Error : {0} value is not in ISO 8601 timespan/duration format. e.g. PT10M for duration of 10 min'.format(namespace.auto_delete_on_idle))
+
+
+
+
+
diff --git a/src/servicebus/azext_servicebus/commands.py b/src/servicebus/azext_servicebus/commands.py
new file mode 100644
index 00000000000..09035631657
--- /dev/null
+++ b/src/servicebus/azext_servicebus/commands.py
@@ -0,0 +1,131 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+# pylint: disable=line-too-long
+
+from azure.cli.core.sdk.util import CliCommandType
+from azure.cli.command_modules.servicebus._client_factory import (namespaces_mgmt_client_factory,
+ queues_mgmt_client_factory,
+ topics_mgmt_client_factory,
+ subscriptions_mgmt_client_factory,
+ rules_mgmt_client_factory,
+ regions_mgmt_client_factory,
+ premium_messaging_mgmt_client_factory,
+ disaster_recovery_mgmt_client_factory,
+ event_subscriptions_mgmt_client_factory,
+ event_hubs_mgmt_client_factory)
+# from ._exception_handler import billing_exception_handler
+
+
+def load_command_table(self, _):
+ sb_namespace_util = CliCommandType(
+ operations_tmpl='azure.mgmt.servicebus.operations.namespaces_operations#NamespacesOperations.{}',
+ client_factory=namespaces_mgmt_client_factory
+ )
+
+ sb_queue_util = CliCommandType(
+ operations_tmpl='azure.mgmt.servicebus.operations.queues_operations#QueuesOperations.{}',
+ client_factory=queues_mgmt_client_factory
+ )
+
+ sb_topic_util = CliCommandType(
+ operations_tmpl='azure.mgmt.servicebus.operations.topics_operations#TopicsOperations.{}',
+ client_factory=topics_mgmt_client_factory
+ )
+
+ sb_subscriptions_util = CliCommandType(
+ operations_tmpl='azure.mgmt.servicebus.operations.subscriptions_operations#SubscriptionsOperations.{}',
+ client_factory=subscriptions_mgmt_client_factory
+ )
+
+ sb_rule_util = CliCommandType(
+ operations_tmpl='azure.mgmt.servicebus.operations.rules_operations#RulesOperations.{}',
+ client_factory=rules_mgmt_client_factory
+ )
+
+ sb_geodr_util = CliCommandType(
+ operations_tmpl='azure.mgmt.servicebus.operations.disaster_recovery_configs_operations#DisasterRecoveryConfigsOperations.{}',
+ client_factory=disaster_recovery_mgmt_client_factory
+ )
+
+# Namespace Region
+ with self.command_group('sb namespace', sb_namespace_util) as g:
+ g.custom_command('create', 'cli_namespace_create')
+ g.command('get', 'get')
+ g.custom_command('list', 'cli_namespace_list')
+ g.command('delete', 'delete')
+ g.command('check_name_availability', 'check_name_availability_method')
+
+ with self.command_group('sb namespace authorizationrule', sb_namespace_util) as g:
+ g.custom_command('create', 'cli_namespaceautho_create')
+ g.command('get', 'get_authorization_rule')
+ g.command('list', 'list_authorization_rules')
+ g.command('listkeys', 'list_keys')
+ g.command('regeneratekeys', 'regenerate_keys')
+ g.command('delete', 'delete_authorization_rule')
+
+# Queue Region
+
+ with self.command_group('sb queue', sb_queue_util) as g:
+ g.custom_command('create', 'cli_sbqueue_create')
+ g.command('get', 'get')
+ g.command('list', 'list_by_namespace')
+ g.command('delete', 'delete')
+
+ with self.command_group('sb queue authorizationrule', sb_queue_util) as g:
+ g.custom_command('create', 'cli_sbqueueautho_create')
+ g.command('get', 'get_authorization_rule')
+ g.command('list', 'list_authorization_rules')
+ g.command('listkeys', 'list_keys')
+ g.command('regeneratekeys', 'regenerate_keys')
+ g.command('delete', 'delete_authorization_rule')
+
+
+# Topic Region
+
+ with self.command_group('sb topic', sb_topic_util) as g:
+ g.custom_command('create', 'cli_sbtopic_create')
+ g.command('get', 'get')
+ g.command('list', 'list_by_namespace')
+ g.command('delete', 'delete')
+
+ with self.command_group('sb topic authorizationrule', sb_topic_util) as g:
+ g.custom_command('create', 'cli_sbtopicautho_create')
+ g.command('get', 'get_authorization_rule')
+ g.command('list', 'list_authorization_rules')
+ g.command('listkeys', 'list_keys')
+ g.command('regeneratekeys', 'regenerate_keys')
+ g.command('delete', 'delete_authorization_rule')
+
+
+# Subscription Region
+ with self.command_group('sb subscription', sb_subscriptions_util) as g:
+ g.custom_command('create', 'cli_sbsubscription_create')
+ g.command('get', 'get')
+ g.command('list', 'list_by_topic')
+ g.command('delete', 'delete')
+
+
+# Rules Region
+ with self.command_group('sb rule', sb_rule_util) as g:
+ g.custom_command('create', 'cli_rules_create')
+ g.command('get', 'get')
+ g.command('list', 'list_by_subscriptions')
+ g.command('delete', 'delete')
+
+# DisasterRecoveryConfigs Region
+ with self.command_group('sb alias', sb_geodr_util) as g:
+ g.command('create', 'create_or_update')
+ g.command('get', 'get')
+ g.command('list', 'list')
+ g.command('break_pairing', 'break_pairing')
+ g.command('fail_over', 'fail_over')
+ g.command('check_name_availability', 'check_name_availability_method')
+ g.command('list_authorization_rules', 'list_authorization_rules')
+ g.command('get_authorization_rule', 'get_authorization_rule')
+ g.command('list_keys', 'list_keys')
+ g.command('delete', 'delete')
+
+
diff --git a/src/servicebus/azext_servicebus/custom.py b/src/servicebus/azext_servicebus/custom.py
new file mode 100644
index 00000000000..b32fe512aa6
--- /dev/null
+++ b/src/servicebus/azext_servicebus/custom.py
@@ -0,0 +1,160 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+from azure.cli.command_modules.servicebus._utils import skunameconverter, skutireconverter, accessrights_converter
+from azure.mgmt.servicebus.models import ErrorResponseException
+
+from azure.cli.core.commands.client_factory import get_subscription_id
+from azure.mgmt.servicebus.models import (
+ SBNamespace, SBSku, SBAuthorizationRule, SBQueue, SBTopic, SBSubscription, Rule, Action, SqlFilter, CorrelationFilter, ArmDisasterRecovery)
+
+from azure.mgmt.servicebus.models.service_bus_management_client_enums import SkuName, SkuTier, AccessRights, KeyType
+
+
+# Namespace Region
+def cli_namespace_create(client, resource_group_name, namespace_name, location, tags=None, sku='Standard', skutier=None, capacity=None):
+ result = client.create_or_update(resource_group_name, namespace_name, SBNamespace(location, tags,
+ SBSku(skunameconverter(sku),
+ skutireconverter(skutier))))
+ return result
+
+
+def cli_namespace_list(client, resource_group_name=None, namespace_name=None):
+ if(resource_group_name and namespace_name):
+ result = client.get(resource_group_name, namespace_name)
+ return result
+
+ if(resource_group_name and not namespace_name):
+ result = list(client.list_by_resource_group(resource_group_name, namespace_name))
+ return result
+
+ if (not resource_group_name and not namespace_name):
+ result = list(client.list(resource_group_name, namespace_name))
+ return result
+
+
+# Namespace Authorization rule:
+
+
+def cli_namespaceautho_create(client, resource_group_name, namespace_name, name, accessrights=None):
+ rights = ['Send', 'Listen']
+ result = client.create_or_update_authorization_rule(resource_group_name, namespace_name, name,
+ accessrights_converter(rights))
+ return result
+
+# Queue Region
+
+
+def cli_sbqueue_create(client, resource_group_name, namespace_name, name, lock_duration=None, max_size_in_megabytes=None, requires_duplicate_detection=None, requires_session=None, default_message_time_to_live=None, dead_lettering_on_message_expiration=None, duplicate_detection_history_time_window=None, max_delivery_count=None, status=None, auto_delete_on_idle=None, enable_partitioning=None, enable_express=None, forward_to=None, forward_dead_lettered_messages_to=None):
+
+ queue_params = SBQueue(
+ lock_duration=lock_duration,
+ max_size_in_megabytes=max_size_in_megabytes,
+ requires_duplicate_detection=requires_duplicate_detection,
+ requires_session=requires_session,
+ default_message_time_to_live=default_message_time_to_live,
+ dead_lettering_on_message_expiration=dead_lettering_on_message_expiration,
+ duplicate_detection_history_time_window=duplicate_detection_history_time_window,
+ max_delivery_count=max_delivery_count,
+ status=status,
+ auto_delete_on_idle=auto_delete_on_idle,
+ enable_partitioning=enable_partitioning,
+ enable_express=enable_express,
+ # forward_to=forward_to,
+ # forward_dead_lettered_messages_to=forward_dead_lettered_messages_to
+ )
+ result = client.create_or_update(resource_group_name, namespace_name, name, queue_params)
+ return result
+
+
+def cli_sbqueueautho_create(client, resource_group_name, namespace_name, queue_name, name, accessrights=None):
+ temp1 = ['Send', 'Listen']
+ result = client.create_or_update_authorization_rule(resource_group_name, namespace_name, queue_name, name,
+ accessrights_converter(temp1))
+ return result
+
+# Topic Region
+
+
+def cli_sbtopic_create(client, resource_group_name, namespace_name, name, default_message_time_to_live=None, max_size_in_megabytes=None, requires_duplicate_detection=None, duplicate_detection_history_time_window=None, enable_batched_operations=None, status=None, support_ordering=None, auto_delete_on_idle=None, enable_partitioning=None, enable_express=None):
+ topic_params = SBTopic(
+ default_message_time_to_live=default_message_time_to_live,
+ max_size_in_megabytes=max_size_in_megabytes,
+ requires_duplicate_detection=requires_duplicate_detection,
+ duplicate_detection_history_time_window=duplicate_detection_history_time_window,
+ enable_batched_operations=enable_batched_operations,
+ status=status,
+ support_ordering=support_ordering,
+ auto_delete_on_idle=auto_delete_on_idle,
+ enable_partitioning=enable_partitioning,
+ enable_express=enable_express
+ )
+ result = client.create_or_update(resource_group_name, namespace_name, name, topic_params)
+ return result
+
+
+def cli_sbtopicautho_create(client, resource_group_name, namespace_name, topic_name, name, accessrights=None):
+ temp1 = ['Send', 'Listen']
+ result = client.create_or_update_authorization_rule(resource_group_name, namespace_name, topic_name, name,
+ accessrights_converter(temp1))
+ return result
+
+# Subscription Region
+
+
+def cli_sbsubscription_create(client, resource_group_name, namespace_name, topic_name, name, lock_duration=None, requires_session=None, default_message_time_to_live=None, dead_lettering_on_message_expiration=None, duplicate_detection_history_time_window=None, max_delivery_count=None, status=None, enable_batched_operations=None, auto_delete_on_idle=None, forward_to=None, forward_dead_lettered_messages_to=None):
+ subscription_params = SBSubscription(
+ lock_duration=lock_duration,
+ requires_session=requires_session,
+ default_message_time_to_live=default_message_time_to_live,
+ dead_lettering_on_message_expiration=dead_lettering_on_message_expiration,
+ duplicate_detection_history_time_window=duplicate_detection_history_time_window,
+ max_delivery_count=max_delivery_count,
+ status=status,
+ enable_batched_operations=enable_batched_operations,
+ auto_delete_on_idle=auto_delete_on_idle,
+ # forward_to=forward_to,
+ # forward_dead_lettered_messages_to=forward_dead_lettered_messages_to
+ )
+ result = client.create_or_update(resource_group_name, namespace_name, topic_name, name, subscription_params)
+ return result
+
+# Rule Region
+
+
+def cli_rules_create(client, resource_group_name, namespace_name, topic_name, subscription_name, name, action_sql_expression=None, action_compatibility_level=None, action_requires_preprocessing=None, filter_sql_expression=None, filter_requires_preprocessing=None, correlation_id=None, message_id=None, to=None, reply_to=None, label=None, session_id=None, reply_to_sessionid=None, content_type=None, requires_preprocessing=None ):
+ rules_params = Rule()
+ rules_params.action = Action(
+ sql_expression=action_sql_expression,
+ compatibility_level=action_compatibility_level,
+ requires_preprocessing=action_requires_preprocessing
+ )
+ rules_params.sql_filter = SqlFilter(
+ sql_expression=filter_sql_expression,
+ requires_preprocessing=filter_requires_preprocessing
+ )
+ rules_params.correlation_filter = CorrelationFilter(
+ correlation_id=correlation_id,
+ to=to,
+ message_id=message_id,
+ reply_to=reply_to,
+ label=label,
+ session_id=session_id,
+ reply_to_session_id=reply_to_sessionid,
+ content_type=content_type,
+ requires_preprocessing=requires_preprocessing
+ )
+ result = client.create_or_update(resource_group_name, namespace_name, topic_name, subscription_name, name, rules_params)
+ return result
+
+#### Geo DR - Disaster Recovery Configs - Alias Region
+
+
+def cli_alias_create(client, resource_group_name, namespace_name, alias, partner_namespace, alternate_name ):
+ dr_params = ArmDisasterRecovery(
+ partner_namespace=partner_namespace
+ )
+ result = client.create_or_update(resource_group_name, namespace_name, alias, dr_params)
+ return result
diff --git a/src/servicebus/azext_servicebus/servicebus/__init__.py b/src/servicebus/azext_servicebus/servicebus/__init__.py
new file mode 100644
index 00000000000..d26139d3e8b
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/__init__.py
@@ -0,0 +1,18 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .service_bus_management_client import ServiceBusManagementClient
+from .version import VERSION
+
+__all__ = ['ServiceBusManagementClient']
+
+__version__ = VERSION
+
diff --git a/src/servicebus/azext_servicebus/servicebus/models/__init__.py b/src/servicebus/azext_servicebus/servicebus/models/__init__.py
new file mode 100644
index 00000000000..b769252f8a1
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/__init__.py
@@ -0,0 +1,116 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .tracked_resource import TrackedResource
+from .resource import Resource
+from .resource_namespace_patch import ResourceNamespacePatch
+from .sb_sku import SBSku
+from .sb_namespace import SBNamespace
+from .sb_namespace_update_parameters import SBNamespaceUpdateParameters
+from .sb_authorization_rule import SBAuthorizationRule
+from .authorization_rule_properties import AuthorizationRuleProperties
+from .access_keys import AccessKeys
+from .regenerate_access_key_parameters import RegenerateAccessKeyParameters
+from .message_count_details import MessageCountDetails
+from .sb_queue import SBQueue
+from .sb_topic import SBTopic
+from .sb_subscription import SBSubscription
+from .check_name_availability import CheckNameAvailability
+from .check_name_availability_result import CheckNameAvailabilityResult
+from .operation_display import OperationDisplay
+from .operation import Operation
+from .error_response import ErrorResponse, ErrorResponseException
+from .action import Action
+from .sql_filter import SqlFilter
+from .correlation_filter import CorrelationFilter
+from .rule import Rule
+from .sql_rule_action import SqlRuleAction
+from .premium_messaging_regions_properties import PremiumMessagingRegionsProperties
+from .premium_messaging_regions import PremiumMessagingRegions
+from .destination import Destination
+from .capture_description import CaptureDescription
+from .eventhub import Eventhub
+from .arm_disaster_recovery import ArmDisasterRecovery
+from .operation_paged import OperationPaged
+from .sb_namespace_paged import SBNamespacePaged
+from .sb_authorization_rule_paged import SBAuthorizationRulePaged
+from .arm_disaster_recovery_paged import ArmDisasterRecoveryPaged
+from .sb_queue_paged import SBQueuePaged
+from .sb_topic_paged import SBTopicPaged
+from .sb_subscription_paged import SBSubscriptionPaged
+from .rule_paged import RulePaged
+from .premium_messaging_regions_paged import PremiumMessagingRegionsPaged
+from .eventhub_paged import EventhubPaged
+from .service_bus_management_client_enums import (
+ SkuName,
+ SkuTier,
+ AccessRights,
+ KeyType,
+ EntityStatus,
+ UnavailableReason,
+ FilterType,
+ EncodingCaptureDescription,
+ ProvisioningStateDR,
+ RoleDisasterRecovery,
+)
+
+__all__ = [
+ 'TrackedResource',
+ 'Resource',
+ 'ResourceNamespacePatch',
+ 'SBSku',
+ 'SBNamespace',
+ 'SBNamespaceUpdateParameters',
+ 'SBAuthorizationRule',
+ 'AuthorizationRuleProperties',
+ 'AccessKeys',
+ 'RegenerateAccessKeyParameters',
+ 'MessageCountDetails',
+ 'SBQueue',
+ 'SBTopic',
+ 'SBSubscription',
+ 'CheckNameAvailability',
+ 'CheckNameAvailabilityResult',
+ 'OperationDisplay',
+ 'Operation',
+ 'ErrorResponse', 'ErrorResponseException',
+ 'Action',
+ 'SqlFilter',
+ 'CorrelationFilter',
+ 'Rule',
+ 'SqlRuleAction',
+ 'PremiumMessagingRegionsProperties',
+ 'PremiumMessagingRegions',
+ 'Destination',
+ 'CaptureDescription',
+ 'Eventhub',
+ 'ArmDisasterRecovery',
+ 'OperationPaged',
+ 'SBNamespacePaged',
+ 'SBAuthorizationRulePaged',
+ 'ArmDisasterRecoveryPaged',
+ 'SBQueuePaged',
+ 'SBTopicPaged',
+ 'SBSubscriptionPaged',
+ 'RulePaged',
+ 'PremiumMessagingRegionsPaged',
+ 'EventhubPaged',
+ 'SkuName',
+ 'SkuTier',
+ 'AccessRights',
+ 'KeyType',
+ 'EntityStatus',
+ 'UnavailableReason',
+ 'FilterType',
+ 'EncodingCaptureDescription',
+ 'ProvisioningStateDR',
+ 'RoleDisasterRecovery',
+]
diff --git a/src/servicebus/azext_servicebus/servicebus/models/access_keys.py b/src/servicebus/azext_servicebus/servicebus/models/access_keys.py
new file mode 100644
index 00000000000..6165c5ce6d5
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/access_keys.py
@@ -0,0 +1,70 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class AccessKeys(Model):
+ """Namespace/ServiceBus Connection String.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar primary_connection_string: Primary connection string of the created
+ namespace authorization rule.
+ :vartype primary_connection_string: str
+ :ivar secondary_connection_string: Secondary connection string of the
+ created namespace authorization rule.
+ :vartype secondary_connection_string: str
+ :ivar alias_primary_connection_string: Primary connection string of the
+ alias if GEO DR is enabled
+ :vartype alias_primary_connection_string: str
+ :ivar alias_secondary_connection_string: Secondary connection string of
+ the alias if GEO DR is enabled
+ :vartype alias_secondary_connection_string: str
+ :ivar primary_key: A base64-encoded 256-bit primary key for signing and
+ validating the SAS token.
+ :vartype primary_key: str
+ :ivar secondary_key: A base64-encoded 256-bit primary key for signing and
+ validating the SAS token.
+ :vartype secondary_key: str
+ :ivar key_name: A string that describes the authorization rule.
+ :vartype key_name: str
+ """
+
+ _validation = {
+ 'primary_connection_string': {'readonly': True},
+ 'secondary_connection_string': {'readonly': True},
+ 'alias_primary_connection_string': {'readonly': True},
+ 'alias_secondary_connection_string': {'readonly': True},
+ 'primary_key': {'readonly': True},
+ 'secondary_key': {'readonly': True},
+ 'key_name': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'},
+ 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'},
+ 'alias_primary_connection_string': {'key': 'aliasPrimaryConnectionString', 'type': 'str'},
+ 'alias_secondary_connection_string': {'key': 'aliasSecondaryConnectionString', 'type': 'str'},
+ 'primary_key': {'key': 'primaryKey', 'type': 'str'},
+ 'secondary_key': {'key': 'secondaryKey', 'type': 'str'},
+ 'key_name': {'key': 'keyName', 'type': 'str'},
+ }
+
+ def __init__(self):
+ self.primary_connection_string = None
+ self.secondary_connection_string = None
+ self.alias_primary_connection_string = None
+ self.alias_secondary_connection_string = None
+ self.primary_key = None
+ self.secondary_key = None
+ self.key_name = None
diff --git a/src/servicebus/azext_servicebus/servicebus/models/action.py b/src/servicebus/azext_servicebus/servicebus/models/action.py
new file mode 100644
index 00000000000..b65e94fb079
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/action.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class Action(Model):
+ """Represents the filter actions which are allowed for the transformation of a
+ message that have been matched by a filter expression.
+
+ :param sql_expression: SQL expression. e.g. MyProperty='ABC'
+ :type sql_expression: str
+ :param compatibility_level: This property is reserved for future use. An
+ integer value showing the compatibility level, currently hard-coded to 20.
+ :type compatibility_level: int
+ :param requires_preprocessing: Value that indicates whether the rule
+ action requires preprocessing. Default value: True .
+ :type requires_preprocessing: bool
+ """
+
+ _attribute_map = {
+ 'sql_expression': {'key': 'sqlExpression', 'type': 'str'},
+ 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'int'},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'},
+ }
+
+ def __init__(self, sql_expression=None, compatibility_level=None, requires_preprocessing=True):
+ self.sql_expression = sql_expression
+ self.compatibility_level = compatibility_level
+ self.requires_preprocessing = requires_preprocessing
diff --git a/src/servicebus/azext_servicebus/servicebus/models/arm_disaster_recovery.py b/src/servicebus/azext_servicebus/servicebus/models/arm_disaster_recovery.py
new file mode 100644
index 00000000000..9e722e9b375
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/arm_disaster_recovery.py
@@ -0,0 +1,68 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource import Resource
+
+
+class ArmDisasterRecovery(Resource):
+ """Single item in List or Get Alias(Disaster Recovery configuration)
+ operation.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :ivar provisioning_state: Provisioning state of the Alias(Disaster
+ Recovery configuration) - possible values 'Accepted' or 'Succeeded' or
+ 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed'
+ :vartype provisioning_state: str or
+ ~azure.mgmt.servicebus.models.ProvisioningStateDR
+ :param partner_namespace: ARM Id of the Primary/Secondary eventhub
+ namespace name, which is part of GEO DR pairning
+ :type partner_namespace: str
+ :param alternate_name: Primary/Secondary eventhub namespace name, which is
+ part of GEO DR pairning
+ :type alternate_name: str
+ :ivar role: role of namespace in GEO DR - possible values 'Primary' or
+ 'PrimaryNotReplicating' or 'Secondary'. Possible values include:
+ 'Primary', 'PrimaryNotReplicating', 'Secondary'
+ :vartype role: str or ~azure.mgmt.servicebus.models.RoleDisasterRecovery
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'provisioning_state': {'readonly': True},
+ 'role': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningStateDR'},
+ 'partner_namespace': {'key': 'properties.partnerNamespace', 'type': 'str'},
+ 'alternate_name': {'key': 'properties.alternateName', 'type': 'str'},
+ 'role': {'key': 'properties.role', 'type': 'RoleDisasterRecovery'},
+ }
+
+ def __init__(self, partner_namespace=None, alternate_name=None):
+ super(ArmDisasterRecovery, self).__init__()
+ self.provisioning_state = None
+ self.partner_namespace = partner_namespace
+ self.alternate_name = alternate_name
+ self.role = None
diff --git a/src/servicebus/azext_servicebus/servicebus/models/arm_disaster_recovery_paged.py b/src/servicebus/azext_servicebus/servicebus/models/arm_disaster_recovery_paged.py
new file mode 100644
index 00000000000..819a0361825
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/arm_disaster_recovery_paged.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.paging import Paged
+
+
+class ArmDisasterRecoveryPaged(Paged):
+ """
+ A paging container for iterating over a list of :class:`ArmDisasterRecovery ` object
+ """
+
+ _attribute_map = {
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ 'current_page': {'key': 'value', 'type': '[ArmDisasterRecovery]'}
+ }
+
+ def __init__(self, *args, **kwargs):
+
+ super(ArmDisasterRecoveryPaged, self).__init__(*args, **kwargs)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/authorization_rule_properties.py b/src/servicebus/azext_servicebus/servicebus/models/authorization_rule_properties.py
new file mode 100644
index 00000000000..8c6139f558a
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/authorization_rule_properties.py
@@ -0,0 +1,31 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class AuthorizationRuleProperties(Model):
+ """AuthorizationRule properties.
+
+ :param rights: The rights associated with the rule.
+ :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights]
+ """
+
+ _validation = {
+ 'rights': {'required': True},
+ }
+
+ _attribute_map = {
+ 'rights': {'key': 'rights', 'type': '[AccessRights]'},
+ }
+
+ def __init__(self, rights):
+ self.rights = rights
diff --git a/src/servicebus/azext_servicebus/servicebus/models/capture_description.py b/src/servicebus/azext_servicebus/servicebus/models/capture_description.py
new file mode 100644
index 00000000000..15cd6938ed3
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/capture_description.py
@@ -0,0 +1,56 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class CaptureDescription(Model):
+ """Properties to configure capture description for eventhub.
+
+ :param enabled: A value that indicates whether capture description is
+ enabled.
+ :type enabled: bool
+ :param encoding: Enumerates the possible values for the encoding format of
+ capture description. Possible values include: 'Avro', 'AvroDeflate'
+ :type encoding: str or
+ ~azure.mgmt.servicebus.models.EncodingCaptureDescription
+ :param interval_in_seconds: The time window allows you to set the
+ frequency with which the capture to Azure Blobs will happen, value should
+ between 60 to 900 seconds
+ :type interval_in_seconds: int
+ :param size_limit_in_bytes: The size window defines the amount of data
+ built up in your Event Hub before an capture operation, value should be
+ between 10485760 and 524288000 bytes
+ :type size_limit_in_bytes: int
+ :param destination: Properties of Destination where capture will be
+ stored. (Storage Account, Blob Names)
+ :type destination: ~azure.mgmt.servicebus.models.Destination
+ """
+
+ _validation = {
+ 'interval_in_seconds': {'maximum': 900, 'minimum': 60},
+ 'size_limit_in_bytes': {'maximum': 524288000, 'minimum': 10485760},
+ }
+
+ _attribute_map = {
+ 'enabled': {'key': 'enabled', 'type': 'bool'},
+ 'encoding': {'key': 'encoding', 'type': 'EncodingCaptureDescription'},
+ 'interval_in_seconds': {'key': 'intervalInSeconds', 'type': 'int'},
+ 'size_limit_in_bytes': {'key': 'sizeLimitInBytes', 'type': 'int'},
+ 'destination': {'key': 'destination', 'type': 'Destination'},
+ }
+
+ def __init__(self, enabled=None, encoding=None, interval_in_seconds=None, size_limit_in_bytes=None, destination=None):
+ self.enabled = enabled
+ self.encoding = encoding
+ self.interval_in_seconds = interval_in_seconds
+ self.size_limit_in_bytes = size_limit_in_bytes
+ self.destination = destination
diff --git a/src/servicebus/azext_servicebus/servicebus/models/check_name_availability.py b/src/servicebus/azext_servicebus/servicebus/models/check_name_availability.py
new file mode 100644
index 00000000000..85499916b22
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/check_name_availability.py
@@ -0,0 +1,34 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class CheckNameAvailability(Model):
+ """Description of a Check Name availability request properties.
+
+ :param name: The Name to check the namespce name availability and The
+ namespace name can contain only letters, numbers, and hyphens. The
+ namespace must start with a letter, and it must end with a letter or
+ number.
+ :type name: str
+ """
+
+ _validation = {
+ 'name': {'required': True},
+ }
+
+ _attribute_map = {
+ 'name': {'key': 'name', 'type': 'str'},
+ }
+
+ def __init__(self, name):
+ self.name = name
diff --git a/src/servicebus/azext_servicebus/servicebus/models/check_name_availability_result.py b/src/servicebus/azext_servicebus/servicebus/models/check_name_availability_result.py
new file mode 100644
index 00000000000..e6243401297
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/check_name_availability_result.py
@@ -0,0 +1,46 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class CheckNameAvailabilityResult(Model):
+ """Description of a Check Name availability request properties.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar message: The detailed info regarding the reason associated with the
+ namespace.
+ :vartype message: str
+ :param name_available: Value indicating namespace is availability, true if
+ the namespace is available; otherwise, false.
+ :type name_available: bool
+ :param reason: The reason for unavailability of a namespace. Possible
+ values include: 'None', 'InvalidName', 'SubscriptionIsDisabled',
+ 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'
+ :type reason: str or ~azure.mgmt.servicebus.models.UnavailableReason
+ """
+
+ _validation = {
+ 'message': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'message': {'key': 'message', 'type': 'str'},
+ 'name_available': {'key': 'nameAvailable', 'type': 'bool'},
+ 'reason': {'key': 'reason', 'type': 'UnavailableReason'},
+ }
+
+ def __init__(self, name_available=None, reason=None):
+ self.message = None
+ self.name_available = name_available
+ self.reason = reason
diff --git a/src/servicebus/azext_servicebus/servicebus/models/correlation_filter.py b/src/servicebus/azext_servicebus/servicebus/models/correlation_filter.py
new file mode 100644
index 00000000000..13f694e5a52
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/correlation_filter.py
@@ -0,0 +1,60 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class CorrelationFilter(Model):
+ """Represents the correlation filter expression.
+
+ :param correlation_id: Identifier of the correlation.
+ :type correlation_id: str
+ :param message_id: Identifier of the message.
+ :type message_id: str
+ :param to: Address to send to.
+ :type to: str
+ :param reply_to: Address of the queue to reply to.
+ :type reply_to: str
+ :param label: Application specific label.
+ :type label: str
+ :param session_id: Session identifier.
+ :type session_id: str
+ :param reply_to_session_id: Session identifier to reply to.
+ :type reply_to_session_id: str
+ :param content_type: Content type of the message.
+ :type content_type: str
+ :param requires_preprocessing: Value that indicates whether the rule
+ action requires preprocessing. Default value: True .
+ :type requires_preprocessing: bool
+ """
+
+ _attribute_map = {
+ 'correlation_id': {'key': 'correlationId', 'type': 'str'},
+ 'message_id': {'key': 'messageId', 'type': 'str'},
+ 'to': {'key': 'to', 'type': 'str'},
+ 'reply_to': {'key': 'replyTo', 'type': 'str'},
+ 'label': {'key': 'label', 'type': 'str'},
+ 'session_id': {'key': 'sessionId', 'type': 'str'},
+ 'reply_to_session_id': {'key': 'replyToSessionId', 'type': 'str'},
+ 'content_type': {'key': 'contentType', 'type': 'str'},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'},
+ }
+
+ def __init__(self, correlation_id=None, message_id=None, to=None, reply_to=None, label=None, session_id=None, reply_to_session_id=None, content_type=None, requires_preprocessing=True):
+ self.correlation_id = correlation_id
+ self.message_id = message_id
+ self.to = to
+ self.reply_to = reply_to
+ self.label = label
+ self.session_id = session_id
+ self.reply_to_session_id = reply_to_session_id
+ self.content_type = content_type
+ self.requires_preprocessing = requires_preprocessing
diff --git a/src/servicebus/azext_servicebus/servicebus/models/destination.py b/src/servicebus/azext_servicebus/servicebus/models/destination.py
new file mode 100644
index 00000000000..7bdacd2cb1a
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/destination.py
@@ -0,0 +1,43 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class Destination(Model):
+ """Capture storage details for capture description.
+
+ :param name: Name for capture destination
+ :type name: str
+ :param storage_account_resource_id: Resource id of the storage account to
+ be used to create the blobs
+ :type storage_account_resource_id: str
+ :param blob_container: Blob container Name
+ :type blob_container: str
+ :param archive_name_format: Blob naming convention for archive, e.g.
+ {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}.
+ Here all the parameters (Namespace,EventHub .. etc) are mandatory
+ irrespective of order
+ :type archive_name_format: str
+ """
+
+ _attribute_map = {
+ 'name': {'key': 'name', 'type': 'str'},
+ 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'},
+ 'blob_container': {'key': 'properties.blobContainer', 'type': 'str'},
+ 'archive_name_format': {'key': 'properties.archiveNameFormat', 'type': 'str'},
+ }
+
+ def __init__(self, name=None, storage_account_resource_id=None, blob_container=None, archive_name_format=None):
+ self.name = name
+ self.storage_account_resource_id = storage_account_resource_id
+ self.blob_container = blob_container
+ self.archive_name_format = archive_name_format
diff --git a/src/servicebus/azext_servicebus/servicebus/models/error_response.py b/src/servicebus/azext_servicebus/servicebus/models/error_response.py
new file mode 100644
index 00000000000..6d818fd45e1
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/error_response.py
@@ -0,0 +1,45 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+from msrest.exceptions import HttpOperationError
+
+
+class ErrorResponse(Model):
+ """Error reponse indicates ServiceBus service is not able to process the
+ incoming request. The reason is provided in the error message.
+
+ :param code: Error code.
+ :type code: str
+ :param message: Error message indicating why the operation failed.
+ :type message: str
+ """
+
+ _attribute_map = {
+ 'code': {'key': 'code', 'type': 'str'},
+ 'message': {'key': 'message', 'type': 'str'},
+ }
+
+ def __init__(self, code=None, message=None):
+ self.code = code
+ self.message = message
+
+
+class ErrorResponseException(HttpOperationError):
+ """Server responsed with exception of type: 'ErrorResponse'.
+
+ :param deserialize: A deserializer
+ :param response: Server response to be deserialized.
+ """
+
+ def __init__(self, deserialize, response, *args):
+
+ super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/eventhub.py b/src/servicebus/azext_servicebus/servicebus/models/eventhub.py
new file mode 100644
index 00000000000..0df85eb93eb
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/eventhub.py
@@ -0,0 +1,81 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource import Resource
+
+
+class Eventhub(Resource):
+ """Single item in List or Get Event Hub operation.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :ivar partition_ids: Current number of shards on the Event Hub.
+ :vartype partition_ids: list[str]
+ :ivar created_at: Exact time the Event Hub was created.
+ :vartype created_at: datetime
+ :ivar updated_at: The exact time the message was updated.
+ :vartype updated_at: datetime
+ :param message_retention_in_days: Number of days to retain the events for
+ this Event Hub, value should be 1 to 7 days
+ :type message_retention_in_days: long
+ :param partition_count: Number of partitions created for the Event Hub,
+ allowed values are from 1 to 32 partitions.
+ :type partition_count: long
+ :param status: Enumerates the possible values for the status of the Event
+ Hub. Possible values include: 'Active', 'Disabled', 'Restoring',
+ 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming',
+ 'Unknown'
+ :type status: str or ~azure.mgmt.servicebus.models.EntityStatus
+ :param capture_description: Properties of capture description
+ :type capture_description:
+ ~azure.mgmt.servicebus.models.CaptureDescription
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'partition_ids': {'readonly': True},
+ 'created_at': {'readonly': True},
+ 'updated_at': {'readonly': True},
+ 'message_retention_in_days': {'maximum': 7, 'minimum': 1},
+ 'partition_count': {'maximum': 32, 'minimum': 1},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'partition_ids': {'key': 'properties.partitionIds', 'type': '[str]'},
+ 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'},
+ 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'},
+ 'message_retention_in_days': {'key': 'properties.messageRetentionInDays', 'type': 'long'},
+ 'partition_count': {'key': 'properties.partitionCount', 'type': 'long'},
+ 'status': {'key': 'properties.status', 'type': 'EntityStatus'},
+ 'capture_description': {'key': 'properties.captureDescription', 'type': 'CaptureDescription'},
+ }
+
+ def __init__(self, message_retention_in_days=None, partition_count=None, status=None, capture_description=None):
+ super(Eventhub, self).__init__()
+ self.partition_ids = None
+ self.created_at = None
+ self.updated_at = None
+ self.message_retention_in_days = message_retention_in_days
+ self.partition_count = partition_count
+ self.status = status
+ self.capture_description = capture_description
diff --git a/src/servicebus/azext_servicebus/servicebus/models/eventhub_paged.py b/src/servicebus/azext_servicebus/servicebus/models/eventhub_paged.py
new file mode 100644
index 00000000000..3de52d9d20e
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/eventhub_paged.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.paging import Paged
+
+
+class EventhubPaged(Paged):
+ """
+ A paging container for iterating over a list of :class:`Eventhub ` object
+ """
+
+ _attribute_map = {
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ 'current_page': {'key': 'value', 'type': '[Eventhub]'}
+ }
+
+ def __init__(self, *args, **kwargs):
+
+ super(EventhubPaged, self).__init__(*args, **kwargs)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/message_count_details.py b/src/servicebus/azext_servicebus/servicebus/models/message_count_details.py
new file mode 100644
index 00000000000..86ccbdf5d8d
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/message_count_details.py
@@ -0,0 +1,58 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class MessageCountDetails(Model):
+ """Message Count Details.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar active_message_count: Number of active messages in the queue, topic,
+ or subscription.
+ :vartype active_message_count: long
+ :ivar dead_letter_message_count: Number of messages that are dead
+ lettered.
+ :vartype dead_letter_message_count: long
+ :ivar scheduled_message_count: Number of scheduled messages.
+ :vartype scheduled_message_count: long
+ :ivar transfer_message_count: Number of messages transferred to another
+ queue, topic, or subscription.
+ :vartype transfer_message_count: long
+ :ivar transfer_dead_letter_message_count: Number of messages transferred
+ into dead letters.
+ :vartype transfer_dead_letter_message_count: long
+ """
+
+ _validation = {
+ 'active_message_count': {'readonly': True},
+ 'dead_letter_message_count': {'readonly': True},
+ 'scheduled_message_count': {'readonly': True},
+ 'transfer_message_count': {'readonly': True},
+ 'transfer_dead_letter_message_count': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'active_message_count': {'key': 'activeMessageCount', 'type': 'long'},
+ 'dead_letter_message_count': {'key': 'deadLetterMessageCount', 'type': 'long'},
+ 'scheduled_message_count': {'key': 'scheduledMessageCount', 'type': 'long'},
+ 'transfer_message_count': {'key': 'transferMessageCount', 'type': 'long'},
+ 'transfer_dead_letter_message_count': {'key': 'transferDeadLetterMessageCount', 'type': 'long'},
+ }
+
+ def __init__(self):
+ self.active_message_count = None
+ self.dead_letter_message_count = None
+ self.scheduled_message_count = None
+ self.transfer_message_count = None
+ self.transfer_dead_letter_message_count = None
diff --git a/src/servicebus/azext_servicebus/servicebus/models/operation.py b/src/servicebus/azext_servicebus/servicebus/models/operation.py
new file mode 100644
index 00000000000..8646086dff6
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/operation.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class Operation(Model):
+ """A ServiceBus REST API operation.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar name: Operation name: {provider}/{resource}/{operation}
+ :vartype name: str
+ :param display: The object that represents the operation.
+ :type display: ~azure.mgmt.servicebus.models.OperationDisplay
+ """
+
+ _validation = {
+ 'name': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'name': {'key': 'name', 'type': 'str'},
+ 'display': {'key': 'display', 'type': 'OperationDisplay'},
+ }
+
+ def __init__(self, display=None):
+ self.name = None
+ self.display = display
diff --git a/src/servicebus/azext_servicebus/servicebus/models/operation_display.py b/src/servicebus/azext_servicebus/servicebus/models/operation_display.py
new file mode 100644
index 00000000000..a0ca6fa0544
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/operation_display.py
@@ -0,0 +1,45 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class OperationDisplay(Model):
+ """The object that represents the operation.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar provider: Service provider: Microsoft.ServiceBus
+ :vartype provider: str
+ :ivar resource: Resource on which the operation is performed: Invoice,
+ etc.
+ :vartype resource: str
+ :ivar operation: Operation type: Read, write, delete, etc.
+ :vartype operation: str
+ """
+
+ _validation = {
+ 'provider': {'readonly': True},
+ 'resource': {'readonly': True},
+ 'operation': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'provider': {'key': 'provider', 'type': 'str'},
+ 'resource': {'key': 'resource', 'type': 'str'},
+ 'operation': {'key': 'operation', 'type': 'str'},
+ }
+
+ def __init__(self):
+ self.provider = None
+ self.resource = None
+ self.operation = None
diff --git a/src/servicebus/azext_servicebus/servicebus/models/operation_paged.py b/src/servicebus/azext_servicebus/servicebus/models/operation_paged.py
new file mode 100644
index 00000000000..aaa7a15b352
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/operation_paged.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.paging import Paged
+
+
+class OperationPaged(Paged):
+ """
+ A paging container for iterating over a list of :class:`Operation ` object
+ """
+
+ _attribute_map = {
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ 'current_page': {'key': 'value', 'type': '[Operation]'}
+ }
+
+ def __init__(self, *args, **kwargs):
+
+ super(OperationPaged, self).__init__(*args, **kwargs)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/premium_messaging_regions.py b/src/servicebus/azext_servicebus/servicebus/models/premium_messaging_regions.py
new file mode 100644
index 00000000000..3c57fe09f2f
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/premium_messaging_regions.py
@@ -0,0 +1,53 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource_namespace_patch import ResourceNamespacePatch
+
+
+class PremiumMessagingRegions(ResourceNamespacePatch):
+ """Premium Messaging Region.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :param location: Resource location
+ :type location: str
+ :param tags: Resource tags
+ :type tags: dict[str, str]
+ :param properties:
+ :type properties:
+ ~azure.mgmt.servicebus.models.PremiumMessagingRegionsProperties
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'location': {'key': 'location', 'type': 'str'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'properties': {'key': 'properties', 'type': 'PremiumMessagingRegionsProperties'},
+ }
+
+ def __init__(self, location=None, tags=None, properties=None):
+ super(PremiumMessagingRegions, self).__init__(location=location, tags=tags)
+ self.properties = properties
diff --git a/src/servicebus/azext_servicebus/servicebus/models/premium_messaging_regions_paged.py b/src/servicebus/azext_servicebus/servicebus/models/premium_messaging_regions_paged.py
new file mode 100644
index 00000000000..4d57754d8fb
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/premium_messaging_regions_paged.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.paging import Paged
+
+
+class PremiumMessagingRegionsPaged(Paged):
+ """
+ A paging container for iterating over a list of :class:`PremiumMessagingRegions ` object
+ """
+
+ _attribute_map = {
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ 'current_page': {'key': 'value', 'type': '[PremiumMessagingRegions]'}
+ }
+
+ def __init__(self, *args, **kwargs):
+
+ super(PremiumMessagingRegionsPaged, self).__init__(*args, **kwargs)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/premium_messaging_regions_properties.py b/src/servicebus/azext_servicebus/servicebus/models/premium_messaging_regions_properties.py
new file mode 100644
index 00000000000..aa09312088a
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/premium_messaging_regions_properties.py
@@ -0,0 +1,39 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class PremiumMessagingRegionsProperties(Model):
+ """PremiumMessagingRegionsProperties.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar code: Region code
+ :vartype code: str
+ :ivar full_name: Full name of the region
+ :vartype full_name: str
+ """
+
+ _validation = {
+ 'code': {'readonly': True},
+ 'full_name': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'code': {'key': 'code', 'type': 'str'},
+ 'full_name': {'key': 'fullName', 'type': 'str'},
+ }
+
+ def __init__(self):
+ self.code = None
+ self.full_name = None
diff --git a/src/servicebus/azext_servicebus/servicebus/models/regenerate_access_key_parameters.py b/src/servicebus/azext_servicebus/servicebus/models/regenerate_access_key_parameters.py
new file mode 100644
index 00000000000..310c98901b0
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/regenerate_access_key_parameters.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class RegenerateAccessKeyParameters(Model):
+ """Parameters supplied to the Regenerate Authorization Rule operation,
+ specifies which key neeeds to be reset.
+
+ :param key_type: The access key to regenerate. Possible values include:
+ 'PrimaryKey', 'SecondaryKey'
+ :type key_type: str or ~azure.mgmt.servicebus.models.KeyType
+ :param key: Optional, if the key value provided, is reset for KeyType
+ value or autogenerate Key value set for keyType
+ :type key: str
+ """
+
+ _validation = {
+ 'key_type': {'required': True},
+ }
+
+ _attribute_map = {
+ 'key_type': {'key': 'keyType', 'type': 'KeyType'},
+ 'key': {'key': 'key', 'type': 'str'},
+ }
+
+ def __init__(self, key_type, key=None):
+ self.key_type = key_type
+ self.key = key
diff --git a/src/servicebus/azext_servicebus/servicebus/models/resource.py b/src/servicebus/azext_servicebus/servicebus/models/resource.py
new file mode 100644
index 00000000000..3ceb6eac8a7
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/resource.py
@@ -0,0 +1,44 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class Resource(Model):
+ """The Resource definition for other than namespace.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ }
+
+ def __init__(self):
+ self.id = None
+ self.name = None
+ self.type = None
diff --git a/src/servicebus/azext_servicebus/servicebus/models/resource_namespace_patch.py b/src/servicebus/azext_servicebus/servicebus/models/resource_namespace_patch.py
new file mode 100644
index 00000000000..053416e7196
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/resource_namespace_patch.py
@@ -0,0 +1,50 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource import Resource
+
+
+class ResourceNamespacePatch(Resource):
+ """The Resource definition.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :param location: Resource location
+ :type location: str
+ :param tags: Resource tags
+ :type tags: dict[str, str]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'location': {'key': 'location', 'type': 'str'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ }
+
+ def __init__(self, location=None, tags=None):
+ super(ResourceNamespacePatch, self).__init__()
+ self.location = location
+ self.tags = tags
diff --git a/src/servicebus/azext_servicebus/servicebus/models/rule.py b/src/servicebus/azext_servicebus/servicebus/models/rule.py
new file mode 100644
index 00000000000..7a439128611
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/rule.py
@@ -0,0 +1,60 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource import Resource
+
+
+class Rule(Resource):
+ """Description of Rule Resource.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :param action: Represents the filter actions which are allowed for the
+ transformation of a message that have been matched by a filter expression.
+ :type action: ~azure.mgmt.servicebus.models.Action
+ :param filter_type: Filter type that is evaluated against a
+ BrokeredMessage. Possible values include: 'SqlFilter', 'CorrelationFilter'
+ :type filter_type: str or ~azure.mgmt.servicebus.models.FilterType
+ :param sql_filter: Properties of sqlFilter
+ :type sql_filter: ~azure.mgmt.servicebus.models.SqlFilter
+ :param correlation_filter: Properties of correlationFilter
+ :type correlation_filter: ~azure.mgmt.servicebus.models.CorrelationFilter
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'action': {'key': 'properties.action', 'type': 'Action'},
+ 'filter_type': {'key': 'properties.filterType', 'type': 'FilterType'},
+ 'sql_filter': {'key': 'properties.sqlFilter', 'type': 'SqlFilter'},
+ 'correlation_filter': {'key': 'properties.correlationFilter', 'type': 'CorrelationFilter'},
+ }
+
+ def __init__(self, action=None, filter_type=None, sql_filter=None, correlation_filter=None):
+ super(Rule, self).__init__()
+ self.action = action
+ self.filter_type = filter_type
+ self.sql_filter = sql_filter
+ self.correlation_filter = correlation_filter
diff --git a/src/servicebus/azext_servicebus/servicebus/models/rule_paged.py b/src/servicebus/azext_servicebus/servicebus/models/rule_paged.py
new file mode 100644
index 00000000000..1cfb1a4e836
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/rule_paged.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.paging import Paged
+
+
+class RulePaged(Paged):
+ """
+ A paging container for iterating over a list of :class:`Rule ` object
+ """
+
+ _attribute_map = {
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ 'current_page': {'key': 'value', 'type': '[Rule]'}
+ }
+
+ def __init__(self, *args, **kwargs):
+
+ super(RulePaged, self).__init__(*args, **kwargs)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_authorization_rule.py b/src/servicebus/azext_servicebus/servicebus/models/sb_authorization_rule.py
new file mode 100644
index 00000000000..b94c5c4a0cb
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_authorization_rule.py
@@ -0,0 +1,47 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource import Resource
+
+
+class SBAuthorizationRule(Resource):
+ """Description of a namespace authorization rule.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :param rights: The rights associated with the rule.
+ :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'rights': {'required': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'rights': {'key': 'properties.rights', 'type': '[AccessRights]'},
+ }
+
+ def __init__(self, rights):
+ super(SBAuthorizationRule, self).__init__()
+ self.rights = rights
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_authorization_rule_paged.py b/src/servicebus/azext_servicebus/servicebus/models/sb_authorization_rule_paged.py
new file mode 100644
index 00000000000..24c4f71b000
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_authorization_rule_paged.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.paging import Paged
+
+
+class SBAuthorizationRulePaged(Paged):
+ """
+ A paging container for iterating over a list of :class:`SBAuthorizationRule ` object
+ """
+
+ _attribute_map = {
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ 'current_page': {'key': 'value', 'type': '[SBAuthorizationRule]'}
+ }
+
+ def __init__(self, *args, **kwargs):
+
+ super(SBAuthorizationRulePaged, self).__init__(*args, **kwargs)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_namespace.py b/src/servicebus/azext_servicebus/servicebus/models/sb_namespace.py
new file mode 100644
index 00000000000..9af8bb55912
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_namespace.py
@@ -0,0 +1,79 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .tracked_resource import TrackedResource
+
+
+class SBNamespace(TrackedResource):
+ """Description of a namespace resource.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :param location: The Geo-location where the resource lives
+ :type location: str
+ :param tags: Resource tags
+ :type tags: dict[str, str]
+ :param sku: Porperties of Sku
+ :type sku: ~azure.mgmt.servicebus.models.SBSku
+ :ivar provisioning_state: Provisioning state of the namespace.
+ :vartype provisioning_state: str
+ :ivar created_at: The time the namespace was created.
+ :vartype created_at: datetime
+ :ivar updated_at: The time the namespace was updated.
+ :vartype updated_at: datetime
+ :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus
+ operations.
+ :vartype service_bus_endpoint: str
+ :ivar metric_id: Identifier for Azure Insights metrics
+ :vartype metric_id: str
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'location': {'required': True},
+ 'provisioning_state': {'readonly': True},
+ 'created_at': {'readonly': True},
+ 'updated_at': {'readonly': True},
+ 'service_bus_endpoint': {'readonly': True},
+ 'metric_id': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'location': {'key': 'location', 'type': 'str'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'sku': {'key': 'sku', 'type': 'SBSku'},
+ 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
+ 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'},
+ 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'},
+ 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'},
+ 'metric_id': {'key': 'properties.metricId', 'type': 'str'},
+ }
+
+ def __init__(self, location, tags=None, sku=None):
+ super(SBNamespace, self).__init__(location=location, tags=tags)
+ self.sku = sku
+ self.provisioning_state = None
+ self.created_at = None
+ self.updated_at = None
+ self.service_bus_endpoint = None
+ self.metric_id = None
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_namespace_paged.py b/src/servicebus/azext_servicebus/servicebus/models/sb_namespace_paged.py
new file mode 100644
index 00000000000..e0e77d8c605
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_namespace_paged.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.paging import Paged
+
+
+class SBNamespacePaged(Paged):
+ """
+ A paging container for iterating over a list of :class:`SBNamespace ` object
+ """
+
+ _attribute_map = {
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ 'current_page': {'key': 'value', 'type': '[SBNamespace]'}
+ }
+
+ def __init__(self, *args, **kwargs):
+
+ super(SBNamespacePaged, self).__init__(*args, **kwargs)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_namespace_update_parameters.py b/src/servicebus/azext_servicebus/servicebus/models/sb_namespace_update_parameters.py
new file mode 100644
index 00000000000..dd3fde4636d
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_namespace_update_parameters.py
@@ -0,0 +1,78 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource_namespace_patch import ResourceNamespacePatch
+
+
+class SBNamespaceUpdateParameters(ResourceNamespacePatch):
+ """Description of a namespace resource.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :param location: Resource location
+ :type location: str
+ :param tags: Resource tags
+ :type tags: dict[str, str]
+ :param sku: Porperties of Sku
+ :type sku: ~azure.mgmt.servicebus.models.SBSku
+ :ivar provisioning_state: Provisioning state of the namespace.
+ :vartype provisioning_state: str
+ :ivar created_at: The time the namespace was created.
+ :vartype created_at: datetime
+ :ivar updated_at: The time the namespace was updated.
+ :vartype updated_at: datetime
+ :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus
+ operations.
+ :vartype service_bus_endpoint: str
+ :ivar metric_id: Identifier for Azure Insights metrics
+ :vartype metric_id: str
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'provisioning_state': {'readonly': True},
+ 'created_at': {'readonly': True},
+ 'updated_at': {'readonly': True},
+ 'service_bus_endpoint': {'readonly': True},
+ 'metric_id': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'location': {'key': 'location', 'type': 'str'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ 'sku': {'key': 'sku', 'type': 'SBSku'},
+ 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
+ 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'},
+ 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'},
+ 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'},
+ 'metric_id': {'key': 'properties.metricId', 'type': 'str'},
+ }
+
+ def __init__(self, location=None, tags=None, sku=None):
+ super(SBNamespaceUpdateParameters, self).__init__(location=location, tags=tags)
+ self.sku = sku
+ self.provisioning_state = None
+ self.created_at = None
+ self.updated_at = None
+ self.service_bus_endpoint = None
+ self.metric_id = None
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_queue.py b/src/servicebus/azext_servicebus/servicebus/models/sb_queue.py
new file mode 100644
index 00000000000..97ef3c09de1
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_queue.py
@@ -0,0 +1,151 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource import Resource
+
+
+class SBQueue(Resource):
+ """Description of queue Resource.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :ivar count_details: Message Count Details.
+ :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails
+ :ivar created_at: The exact time the message was created.
+ :vartype created_at: datetime
+ :ivar updated_at: The exact time the message was updated.
+ :vartype updated_at: datetime
+ :ivar accessed_at: Last time a message was sent, or the last time there
+ was a receive request to this queue.
+ :vartype accessed_at: datetime
+ :ivar size_in_bytes: The size of the queue, in bytes.
+ :vartype size_in_bytes: long
+ :ivar message_count: The number of messages in the queue.
+ :vartype message_count: long
+ :param lock_duration: ISO 8601 timespan duration of a peek-lock; that is,
+ the amount of time that the message is locked for other receivers. The
+ maximum value for LockDuration is 5 minutes; the default value is 1
+ minute.
+ :type lock_duration: timedelta
+ :param max_size_in_megabytes: The maximum size of the queue in megabytes,
+ which is the size of memory allocated for the queue. Default is 1024.
+ :type max_size_in_megabytes: int
+ :param requires_duplicate_detection: A value indicating if this queue
+ requires duplicate detection.
+ :type requires_duplicate_detection: bool
+ :param requires_session: A value that indicates whether the queue supports
+ the concept of sessions.
+ :type requires_session: bool
+ :param default_message_time_to_live: ISO 8601 default message timespan to
+ live value. This is the duration after which the message expires, starting
+ from when the message is sent to Service Bus. This is the default value
+ used when TimeToLive is not set on a message itself.
+ :type default_message_time_to_live: timedelta
+ :param dead_lettering_on_message_expiration: A value that indicates
+ whether this queue has dead letter support when a message expires.
+ :type dead_lettering_on_message_expiration: bool
+ :param duplicate_detection_history_time_window: ISO 8601 timeSpan
+ structure that defines the duration of the duplicate detection history.
+ The default value is 10 minutes.
+ :type duplicate_detection_history_time_window: timedelta
+ :param max_delivery_count: The maximum delivery count. A message is
+ automatically deadlettered after this number of deliveries. default value
+ is 10.
+ :type max_delivery_count: int
+ :param status: Enumerates the possible values for the status of a
+ messaging entity. Possible values include: 'Active', 'Disabled',
+ 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting',
+ 'Renaming', 'Unknown'
+ :type status: str or ~azure.mgmt.servicebus.models.EntityStatus
+ :param auto_delete_on_idle: ISO 8061 timeSpan idle interval after which
+ the queue is automatically deleted. The minimum duration is 5 minutes.
+ :type auto_delete_on_idle: timedelta
+ :param enable_partitioning: A value that indicates whether the queue is to
+ be partitioned across multiple message brokers.
+ :type enable_partitioning: bool
+ :param enable_express: A value that indicates whether Express Entities are
+ enabled. An express queue holds a message in memory temporarily before
+ writing it to persistent storage.
+ :type enable_express: bool
+ :param forward_to: Queue/Topic name to forward the messages
+ :type forward_to: str
+ :param forward_dead_lettered_messages_to: Queue/Topic name to forward the
+ Dead Letter message
+ :type forward_dead_lettered_messages_to: str
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'count_details': {'readonly': True},
+ 'created_at': {'readonly': True},
+ 'updated_at': {'readonly': True},
+ 'accessed_at': {'readonly': True},
+ 'size_in_bytes': {'readonly': True},
+ 'message_count': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'count_details': {'key': 'properties.countDetails', 'type': 'MessageCountDetails'},
+ 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'},
+ 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'},
+ 'accessed_at': {'key': 'properties.accessedAt', 'type': 'iso-8601'},
+ 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'},
+ 'message_count': {'key': 'properties.messageCount', 'type': 'long'},
+ 'lock_duration': {'key': 'properties.lockDuration', 'type': 'duration'},
+ 'max_size_in_megabytes': {'key': 'properties.maxSizeInMegabytes', 'type': 'int'},
+ 'requires_duplicate_detection': {'key': 'properties.requiresDuplicateDetection', 'type': 'bool'},
+ 'requires_session': {'key': 'properties.requiresSession', 'type': 'bool'},
+ 'default_message_time_to_live': {'key': 'properties.defaultMessageTimeToLive', 'type': 'duration'},
+ 'dead_lettering_on_message_expiration': {'key': 'properties.deadLetteringOnMessageExpiration', 'type': 'bool'},
+ 'duplicate_detection_history_time_window': {'key': 'properties.duplicateDetectionHistoryTimeWindow', 'type': 'duration'},
+ 'max_delivery_count': {'key': 'properties.maxDeliveryCount', 'type': 'int'},
+ 'status': {'key': 'properties.status', 'type': 'EntityStatus'},
+ 'auto_delete_on_idle': {'key': 'properties.autoDeleteOnIdle', 'type': 'duration'},
+ 'enable_partitioning': {'key': 'properties.enablePartitioning', 'type': 'bool'},
+ 'enable_express': {'key': 'properties.enableExpress', 'type': 'bool'},
+ 'forward_to': {'key': 'properties.forwardTo', 'type': 'str'},
+ 'forward_dead_lettered_messages_to': {'key': 'properties.forwardDeadLetteredMessagesTo', 'type': 'str'},
+ }
+
+ def __init__(self, lock_duration=None, max_size_in_megabytes=None, requires_duplicate_detection=None, requires_session=None, default_message_time_to_live=None, dead_lettering_on_message_expiration=None, duplicate_detection_history_time_window=None, max_delivery_count=None, status=None, auto_delete_on_idle=None, enable_partitioning=None, enable_express=None, forward_to=None, forward_dead_lettered_messages_to=None):
+ super(SBQueue, self).__init__()
+ self.count_details = None
+ self.created_at = None
+ self.updated_at = None
+ self.accessed_at = None
+ self.size_in_bytes = None
+ self.message_count = None
+ self.lock_duration = lock_duration
+ self.max_size_in_megabytes = max_size_in_megabytes
+ self.requires_duplicate_detection = requires_duplicate_detection
+ self.requires_session = requires_session
+ self.default_message_time_to_live = default_message_time_to_live
+ self.dead_lettering_on_message_expiration = dead_lettering_on_message_expiration
+ self.duplicate_detection_history_time_window = duplicate_detection_history_time_window
+ self.max_delivery_count = max_delivery_count
+ self.status = status
+ self.auto_delete_on_idle = auto_delete_on_idle
+ self.enable_partitioning = enable_partitioning
+ self.enable_express = enable_express
+ self.forward_to = forward_to
+ self.forward_dead_lettered_messages_to = forward_dead_lettered_messages_to
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_queue_paged.py b/src/servicebus/azext_servicebus/servicebus/models/sb_queue_paged.py
new file mode 100644
index 00000000000..f85adb4bb59
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_queue_paged.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.paging import Paged
+
+
+class SBQueuePaged(Paged):
+ """
+ A paging container for iterating over a list of :class:`SBQueue ` object
+ """
+
+ _attribute_map = {
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ 'current_page': {'key': 'value', 'type': '[SBQueue]'}
+ }
+
+ def __init__(self, *args, **kwargs):
+
+ super(SBQueuePaged, self).__init__(*args, **kwargs)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_sku.py b/src/servicebus/azext_servicebus/servicebus/models/sb_sku.py
new file mode 100644
index 00000000000..6410cd381f8
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_sku.py
@@ -0,0 +1,42 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class SBSku(Model):
+ """SKU of the namespace.
+
+ :param name: Name of this SKU. Possible values include: 'Basic',
+ 'Standard', 'Premium'
+ :type name: str or ~azure.mgmt.servicebus.models.SkuName
+ :param tier: The billing tier of this particular SKU. Possible values
+ include: 'Basic', 'Standard', 'Premium'
+ :type tier: str or ~azure.mgmt.servicebus.models.SkuTier
+ :param capacity: The specified messaging units for the tier. For Premium
+ tier, capacity are 1,2 and 4.
+ :type capacity: int
+ """
+
+ _validation = {
+ 'name': {'required': True},
+ }
+
+ _attribute_map = {
+ 'name': {'key': 'name', 'type': 'SkuName'},
+ 'tier': {'key': 'tier', 'type': 'SkuTier'},
+ 'capacity': {'key': 'capacity', 'type': 'int'},
+ }
+
+ def __init__(self, name, tier=None, capacity=None):
+ self.name = name
+ self.tier = tier
+ self.capacity = capacity
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_subscription.py b/src/servicebus/azext_servicebus/servicebus/models/sb_subscription.py
new file mode 100644
index 00000000000..dab0aff0ff0
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_subscription.py
@@ -0,0 +1,126 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource import Resource
+
+
+class SBSubscription(Resource):
+ """Description of subscription resource.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :ivar message_count: Number of messages.
+ :vartype message_count: long
+ :ivar created_at: Exact time the message was created.
+ :vartype created_at: datetime
+ :ivar accessed_at: Last time there was a receive request to this
+ subscription.
+ :vartype accessed_at: datetime
+ :ivar updated_at: The exact time the message was updated.
+ :vartype updated_at: datetime
+ :ivar count_details: Message count details
+ :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails
+ :param lock_duration: ISO 8061 lock duration timespan for the
+ subscription. The default value is 1 minute.
+ :type lock_duration: timedelta
+ :param requires_session: Value indicating if a subscription supports the
+ concept of sessions.
+ :type requires_session: bool
+ :param default_message_time_to_live: ISO 8061 Default message timespan to
+ live value. This is the duration after which the message expires, starting
+ from when the message is sent to Service Bus. This is the default value
+ used when TimeToLive is not set on a message itself.
+ :type default_message_time_to_live: timedelta
+ :param dead_lettering_on_message_expiration: Value that indicates whether
+ a subscription has dead letter support when a message expires.
+ :type dead_lettering_on_message_expiration: bool
+ :param duplicate_detection_history_time_window: ISO 8601 timeSpan
+ structure that defines the duration of the duplicate detection history.
+ The default value is 10 minutes.
+ :type duplicate_detection_history_time_window: timedelta
+ :param max_delivery_count: Number of maximum deliveries.
+ :type max_delivery_count: int
+ :param status: Enumerates the possible values for the status of a
+ messaging entity. Possible values include: 'Active', 'Disabled',
+ 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting',
+ 'Renaming', 'Unknown'
+ :type status: str or ~azure.mgmt.servicebus.models.EntityStatus
+ :param enable_batched_operations: Value that indicates whether server-side
+ batched operations are enabled.
+ :type enable_batched_operations: bool
+ :param auto_delete_on_idle: ISO 8061 timeSpan idle interval after which
+ the topic is automatically deleted. The minimum duration is 5 minutes.
+ :type auto_delete_on_idle: timedelta
+ :param forward_to: Queue/Topic name to forward the messages
+ :type forward_to: str
+ :param forward_dead_lettered_messages_to: Queue/Topic name to forward the
+ Dead Letter message
+ :type forward_dead_lettered_messages_to: str
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'message_count': {'readonly': True},
+ 'created_at': {'readonly': True},
+ 'accessed_at': {'readonly': True},
+ 'updated_at': {'readonly': True},
+ 'count_details': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'message_count': {'key': 'properties.messageCount', 'type': 'long'},
+ 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'},
+ 'accessed_at': {'key': 'properties.accessedAt', 'type': 'iso-8601'},
+ 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'},
+ 'count_details': {'key': 'properties.countDetails', 'type': 'MessageCountDetails'},
+ 'lock_duration': {'key': 'properties.lockDuration', 'type': 'duration'},
+ 'requires_session': {'key': 'properties.requiresSession', 'type': 'bool'},
+ 'default_message_time_to_live': {'key': 'properties.defaultMessageTimeToLive', 'type': 'duration'},
+ 'dead_lettering_on_message_expiration': {'key': 'properties.deadLetteringOnMessageExpiration', 'type': 'bool'},
+ 'duplicate_detection_history_time_window': {'key': 'properties.duplicateDetectionHistoryTimeWindow', 'type': 'duration'},
+ 'max_delivery_count': {'key': 'properties.maxDeliveryCount', 'type': 'int'},
+ 'status': {'key': 'properties.status', 'type': 'EntityStatus'},
+ 'enable_batched_operations': {'key': 'properties.enableBatchedOperations', 'type': 'bool'},
+ 'auto_delete_on_idle': {'key': 'properties.autoDeleteOnIdle', 'type': 'duration'},
+ 'forward_to': {'key': 'properties.forwardTo', 'type': 'str'},
+ 'forward_dead_lettered_messages_to': {'key': 'properties.forwardDeadLetteredMessagesTo', 'type': 'str'},
+ }
+
+ def __init__(self, lock_duration=None, requires_session=None, default_message_time_to_live=None, dead_lettering_on_message_expiration=None, duplicate_detection_history_time_window=None, max_delivery_count=None, status=None, enable_batched_operations=None, auto_delete_on_idle=None, forward_to=None, forward_dead_lettered_messages_to=None):
+ super(SBSubscription, self).__init__()
+ self.message_count = None
+ self.created_at = None
+ self.accessed_at = None
+ self.updated_at = None
+ self.count_details = None
+ self.lock_duration = lock_duration
+ self.requires_session = requires_session
+ self.default_message_time_to_live = default_message_time_to_live
+ self.dead_lettering_on_message_expiration = dead_lettering_on_message_expiration
+ self.duplicate_detection_history_time_window = duplicate_detection_history_time_window
+ self.max_delivery_count = max_delivery_count
+ self.status = status
+ self.enable_batched_operations = enable_batched_operations
+ self.auto_delete_on_idle = auto_delete_on_idle
+ self.forward_to = forward_to
+ self.forward_dead_lettered_messages_to = forward_dead_lettered_messages_to
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_subscription_paged.py b/src/servicebus/azext_servicebus/servicebus/models/sb_subscription_paged.py
new file mode 100644
index 00000000000..019bb9524f9
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_subscription_paged.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.paging import Paged
+
+
+class SBSubscriptionPaged(Paged):
+ """
+ A paging container for iterating over a list of :class:`SBSubscription ` object
+ """
+
+ _attribute_map = {
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ 'current_page': {'key': 'value', 'type': '[SBSubscription]'}
+ }
+
+ def __init__(self, *args, **kwargs):
+
+ super(SBSubscriptionPaged, self).__init__(*args, **kwargs)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_topic.py b/src/servicebus/azext_servicebus/servicebus/models/sb_topic.py
new file mode 100644
index 00000000000..5f0b806bed3
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_topic.py
@@ -0,0 +1,129 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource import Resource
+
+
+class SBTopic(Resource):
+ """Description of topic resource.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :ivar size_in_bytes: Size of the topic, in bytes.
+ :vartype size_in_bytes: long
+ :ivar created_at: Exact time the message was created.
+ :vartype created_at: datetime
+ :ivar updated_at: The exact time the message was updated.
+ :vartype updated_at: datetime
+ :ivar accessed_at: Last time the message was sent, or a request was
+ received, for this topic.
+ :vartype accessed_at: datetime
+ :ivar subscription_count: Number of subscriptions.
+ :vartype subscription_count: int
+ :ivar count_details: Message count deatils
+ :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails
+ :param default_message_time_to_live: ISO 8601 Default message timespan to
+ live value. This is the duration after which the message expires, starting
+ from when the message is sent to Service Bus. This is the default value
+ used when TimeToLive is not set on a message itself.
+ :type default_message_time_to_live: timedelta
+ :param max_size_in_megabytes: Maximum size of the topic in megabytes,
+ which is the size of the memory allocated for the topic. Default is 1024.
+ :type max_size_in_megabytes: int
+ :param requires_duplicate_detection: Value indicating if this topic
+ requires duplicate detection.
+ :type requires_duplicate_detection: bool
+ :param duplicate_detection_history_time_window: ISO8601 timespan structure
+ that defines the duration of the duplicate detection history. The default
+ value is 10 minutes.
+ :type duplicate_detection_history_time_window: timedelta
+ :param enable_batched_operations: Value that indicates whether server-side
+ batched operations are enabled.
+ :type enable_batched_operations: bool
+ :param status: Enumerates the possible values for the status of a
+ messaging entity. Possible values include: 'Active', 'Disabled',
+ 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting',
+ 'Renaming', 'Unknown'
+ :type status: str or ~azure.mgmt.servicebus.models.EntityStatus
+ :param support_ordering: Value that indicates whether the topic supports
+ ordering.
+ :type support_ordering: bool
+ :param auto_delete_on_idle: ISO 8601 timespan idle interval after which
+ the topic is automatically deleted. The minimum duration is 5 minutes.
+ :type auto_delete_on_idle: timedelta
+ :param enable_partitioning: Value that indicates whether the topic to be
+ partitioned across multiple message brokers is enabled.
+ :type enable_partitioning: bool
+ :param enable_express: Value that indicates whether Express Entities are
+ enabled. An express topic holds a message in memory temporarily before
+ writing it to persistent storage.
+ :type enable_express: bool
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'size_in_bytes': {'readonly': True},
+ 'created_at': {'readonly': True},
+ 'updated_at': {'readonly': True},
+ 'accessed_at': {'readonly': True},
+ 'subscription_count': {'readonly': True},
+ 'count_details': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'},
+ 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'},
+ 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'},
+ 'accessed_at': {'key': 'properties.accessedAt', 'type': 'iso-8601'},
+ 'subscription_count': {'key': 'properties.subscriptionCount', 'type': 'int'},
+ 'count_details': {'key': 'properties.countDetails', 'type': 'MessageCountDetails'},
+ 'default_message_time_to_live': {'key': 'properties.defaultMessageTimeToLive', 'type': 'duration'},
+ 'max_size_in_megabytes': {'key': 'properties.maxSizeInMegabytes', 'type': 'int'},
+ 'requires_duplicate_detection': {'key': 'properties.requiresDuplicateDetection', 'type': 'bool'},
+ 'duplicate_detection_history_time_window': {'key': 'properties.duplicateDetectionHistoryTimeWindow', 'type': 'duration'},
+ 'enable_batched_operations': {'key': 'properties.enableBatchedOperations', 'type': 'bool'},
+ 'status': {'key': 'properties.status', 'type': 'EntityStatus'},
+ 'support_ordering': {'key': 'properties.supportOrdering', 'type': 'bool'},
+ 'auto_delete_on_idle': {'key': 'properties.autoDeleteOnIdle', 'type': 'duration'},
+ 'enable_partitioning': {'key': 'properties.enablePartitioning', 'type': 'bool'},
+ 'enable_express': {'key': 'properties.enableExpress', 'type': 'bool'},
+ }
+
+ def __init__(self, default_message_time_to_live=None, max_size_in_megabytes=None, requires_duplicate_detection=None, duplicate_detection_history_time_window=None, enable_batched_operations=None, status=None, support_ordering=None, auto_delete_on_idle=None, enable_partitioning=None, enable_express=None):
+ super(SBTopic, self).__init__()
+ self.size_in_bytes = None
+ self.created_at = None
+ self.updated_at = None
+ self.accessed_at = None
+ self.subscription_count = None
+ self.count_details = None
+ self.default_message_time_to_live = default_message_time_to_live
+ self.max_size_in_megabytes = max_size_in_megabytes
+ self.requires_duplicate_detection = requires_duplicate_detection
+ self.duplicate_detection_history_time_window = duplicate_detection_history_time_window
+ self.enable_batched_operations = enable_batched_operations
+ self.status = status
+ self.support_ordering = support_ordering
+ self.auto_delete_on_idle = auto_delete_on_idle
+ self.enable_partitioning = enable_partitioning
+ self.enable_express = enable_express
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sb_topic_paged.py b/src/servicebus/azext_servicebus/servicebus/models/sb_topic_paged.py
new file mode 100644
index 00000000000..1a1330b1d9d
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sb_topic_paged.py
@@ -0,0 +1,27 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.paging import Paged
+
+
+class SBTopicPaged(Paged):
+ """
+ A paging container for iterating over a list of :class:`SBTopic ` object
+ """
+
+ _attribute_map = {
+ 'next_link': {'key': 'nextLink', 'type': 'str'},
+ 'current_page': {'key': 'value', 'type': '[SBTopic]'}
+ }
+
+ def __init__(self, *args, **kwargs):
+
+ super(SBTopicPaged, self).__init__(*args, **kwargs)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/service_bus_management_client_enums.py b/src/servicebus/azext_servicebus/servicebus/models/service_bus_management_client_enums.py
new file mode 100644
index 00000000000..52f86b7f900
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/service_bus_management_client_enums.py
@@ -0,0 +1,88 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from enum import Enum
+
+
+class SkuName(Enum):
+
+ basic = "Basic"
+ standard = "Standard"
+ premium = "Premium"
+
+
+class SkuTier(Enum):
+
+ basic = "Basic"
+ standard = "Standard"
+ premium = "Premium"
+
+
+class AccessRights(Enum):
+
+ manage = "Manage"
+ send = "Send"
+ listen = "Listen"
+
+
+class KeyType(Enum):
+
+ primary_key = "PrimaryKey"
+ secondary_key = "SecondaryKey"
+
+
+class EntityStatus(Enum):
+
+ active = "Active"
+ disabled = "Disabled"
+ restoring = "Restoring"
+ send_disabled = "SendDisabled"
+ receive_disabled = "ReceiveDisabled"
+ creating = "Creating"
+ deleting = "Deleting"
+ renaming = "Renaming"
+ unknown = "Unknown"
+
+
+class UnavailableReason(Enum):
+
+ none = "None"
+ invalid_name = "InvalidName"
+ subscription_is_disabled = "SubscriptionIsDisabled"
+ name_in_use = "NameInUse"
+ name_in_lockdown = "NameInLockdown"
+ too_many_namespace_in_current_subscription = "TooManyNamespaceInCurrentSubscription"
+
+
+class FilterType(Enum):
+
+ sql_filter = "SqlFilter"
+ correlation_filter = "CorrelationFilter"
+
+
+class EncodingCaptureDescription(Enum):
+
+ avro = "Avro"
+ avro_deflate = "AvroDeflate"
+
+
+class ProvisioningStateDR(Enum):
+
+ accepted = "Accepted"
+ succeeded = "Succeeded"
+ failed = "Failed"
+
+
+class RoleDisasterRecovery(Enum):
+
+ primary = "Primary"
+ primary_not_replicating = "PrimaryNotReplicating"
+ secondary = "Secondary"
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sql_filter.py b/src/servicebus/azext_servicebus/servicebus/models/sql_filter.py
new file mode 100644
index 00000000000..66b5ebac20f
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sql_filter.py
@@ -0,0 +1,46 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.serialization import Model
+
+
+class SqlFilter(Model):
+ """Represents a filter which is a composition of an expression and an action
+ that is executed in the pub/sub pipeline.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :param sql_expression: The SQL expression. e.g. MyProperty='ABC'
+ :type sql_expression: str
+ :ivar compatibility_level: This property is reserved for future use. An
+ integer value showing the compatibility level, currently hard-coded to 20.
+ Default value: 20 .
+ :vartype compatibility_level: int
+ :param requires_preprocessing: Value that indicates whether the rule
+ action requires preprocessing. Default value: True .
+ :type requires_preprocessing: bool
+ """
+
+ _validation = {
+ 'compatibility_level': {'readonly': True},
+ }
+
+ _attribute_map = {
+ 'sql_expression': {'key': 'sqlExpression', 'type': 'str'},
+ 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'int'},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool'},
+ }
+
+ def __init__(self, sql_expression=None, requires_preprocessing=True):
+ self.sql_expression = sql_expression
+ self.compatibility_level = None
+ self.requires_preprocessing = requires_preprocessing
diff --git a/src/servicebus/azext_servicebus/servicebus/models/sql_rule_action.py b/src/servicebus/azext_servicebus/servicebus/models/sql_rule_action.py
new file mode 100644
index 00000000000..0150ca05ae2
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/sql_rule_action.py
@@ -0,0 +1,30 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .action import Action
+
+
+class SqlRuleAction(Action):
+ """Represents set of actions written in SQL language-based syntax that is
+ performed against a ServiceBus.Messaging.BrokeredMessage .
+
+ :param sql_expression: SQL expression. e.g. MyProperty='ABC'
+ :type sql_expression: str
+ :param compatibility_level: This property is reserved for future use. An
+ integer value showing the compatibility level, currently hard-coded to 20.
+ :type compatibility_level: int
+ :param requires_preprocessing: Value that indicates whether the rule
+ action requires preprocessing. Default value: True .
+ :type requires_preprocessing: bool
+ """
+
+ def __init__(self, sql_expression=None, compatibility_level=None, requires_preprocessing=True):
+ super(SqlRuleAction, self).__init__(sql_expression=sql_expression, compatibility_level=compatibility_level, requires_preprocessing=requires_preprocessing)
diff --git a/src/servicebus/azext_servicebus/servicebus/models/tracked_resource.py b/src/servicebus/azext_servicebus/servicebus/models/tracked_resource.py
new file mode 100644
index 00000000000..192adcc84b2
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/models/tracked_resource.py
@@ -0,0 +1,51 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .resource import Resource
+
+
+class TrackedResource(Resource):
+ """The Resource definition.
+
+ Variables are only populated by the server, and will be ignored when
+ sending a request.
+
+ :ivar id: Resource Id
+ :vartype id: str
+ :ivar name: Resource name
+ :vartype name: str
+ :ivar type: Resource type
+ :vartype type: str
+ :param location: The Geo-location where the resource lives
+ :type location: str
+ :param tags: Resource tags
+ :type tags: dict[str, str]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'location': {'required': True},
+ }
+
+ _attribute_map = {
+ 'id': {'key': 'id', 'type': 'str'},
+ 'name': {'key': 'name', 'type': 'str'},
+ 'type': {'key': 'type', 'type': 'str'},
+ 'location': {'key': 'location', 'type': 'str'},
+ 'tags': {'key': 'tags', 'type': '{str}'},
+ }
+
+ def __init__(self, location, tags=None):
+ super(TrackedResource, self).__init__()
+ self.location = location
+ self.tags = tags
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/__init__.py b/src/servicebus/azext_servicebus/servicebus/operations/__init__.py
new file mode 100644
index 00000000000..a6b1de61646
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/__init__.py
@@ -0,0 +1,34 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from .operations import Operations
+from .namespaces_operations import NamespacesOperations
+from .disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations
+from .queues_operations import QueuesOperations
+from .topics_operations import TopicsOperations
+from .subscriptions_operations import SubscriptionsOperations
+from .rules_operations import RulesOperations
+from .regions_operations import RegionsOperations
+from .premium_messaging_regions_operations import PremiumMessagingRegionsOperations
+from .event_hubs_operations import EventHubsOperations
+
+__all__ = [
+ 'Operations',
+ 'NamespacesOperations',
+ 'DisasterRecoveryConfigsOperations',
+ 'QueuesOperations',
+ 'TopicsOperations',
+ 'SubscriptionsOperations',
+ 'RulesOperations',
+ 'RegionsOperations',
+ 'PremiumMessagingRegionsOperations',
+ 'EventHubsOperations',
+]
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/disaster_recovery_configs_operations.py b/src/servicebus/azext_servicebus/servicebus/operations/disaster_recovery_configs_operations.py
new file mode 100644
index 00000000000..cd20cb71773
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/disaster_recovery_configs_operations.py
@@ -0,0 +1,697 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+import uuid
+from msrest.pipeline import ClientRawResponse
+
+from .. import models
+
+
+class DisasterRecoveryConfigsOperations(object):
+ """DisasterRecoveryConfigsOperations operations.
+
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An objec model deserializer.
+ :ivar api_version: Client API version. Constant value: "2017-04-01".
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self.api_version = "2017-04-01"
+
+ self.config = config
+
+ def check_name_availability_method(
+ self, resource_group_name, namespace_name, name, custom_headers=None, raw=False, **operation_config):
+ """Check the give namespace name availability.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param name: The Name to check the namespce name availability and The
+ namespace name can contain only letters, numbers, and hyphens. The
+ namespace must start with a letter, and it must end with a letter or
+ number.
+ :type name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: CheckNameAvailabilityResult or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ parameters = models.CheckNameAvailability(name=name)
+
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'CheckNameAvailability')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('CheckNameAvailabilityResult', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def list(
+ self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config):
+ """Gets all Alias(Disaster Recovery configurations).
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of ArmDisasterRecovery
+ :rtype:
+ ~azure.mgmt.servicebus.models.ArmDisasterRecoveryPaged[~azure.mgmt.servicebus.models.ArmDisasterRecovery]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.ArmDisasterRecoveryPaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.ArmDisasterRecoveryPaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def create_or_update(
+ self, resource_group_name, namespace_name, alias, partner_namespace=None, alternate_name=None, custom_headers=None, raw=False, **operation_config):
+ """Creates or updates a new Alias(Disaster Recovery configuration).
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param alias: The Disaster Recovery configuration name
+ :type alias: str
+ :param partner_namespace: ARM Id of the Primary/Secondary eventhub
+ namespace name, which is part of GEO DR pairning
+ :type partner_namespace: str
+ :param alternate_name: Primary/Secondary eventhub namespace name,
+ which is part of GEO DR pairning
+ :type alternate_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: ArmDisasterRecovery or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.ArmDisasterRecovery or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ parameters = models.ArmDisasterRecovery(partner_namespace=partner_namespace, alternate_name=alternate_name)
+
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'ArmDisasterRecovery')
+
+ # Construct and send request
+ request = self._client.put(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200, 201]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('ArmDisasterRecovery', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def delete(
+ self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config):
+ """Deletes an Alias(Disaster Recovery configuration).
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param alias: The Disaster Recovery configuration name
+ :type alias: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: None or ClientRawResponse if raw=true
+ :rtype: None or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ def get(
+ self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config):
+ """Retrieves Alias(Disaster Recovery configuration) for primary or
+ secondary namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param alias: The Disaster Recovery configuration name
+ :type alias: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: ArmDisasterRecovery or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.ArmDisasterRecovery or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('ArmDisasterRecovery', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def break_pairing(
+ self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config):
+ """This operation disables the Disaster Recovery and stops replicating
+ changes from primary to secondary namespaces.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param alias: The Disaster Recovery configuration name
+ :type alias: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: None or ClientRawResponse if raw=true
+ :rtype: None or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ def fail_over(
+ self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config):
+ """envokes GEO DR failover and reconfigure the alias to point to the
+ secondary namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param alias: The Disaster Recovery configuration name
+ :type alias: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: None or ClientRawResponse if raw=true
+ :rtype: None or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ def list_authorization_rules(
+ self, resource_group_name, namespace_name, alias, custom_headers=None, raw=False, **operation_config):
+ """Gets the authorization rules for a namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param alias: The Disaster Recovery configuration name
+ :type alias: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of SBAuthorizationRule
+ :rtype:
+ ~azure.mgmt.servicebus.models.SBAuthorizationRulePaged[~azure.mgmt.servicebus.models.SBAuthorizationRule]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def get_authorization_rule(
+ self, resource_group_name, namespace_name, alias, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Gets an authorization rule for a namespace by rule name.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param alias: The Disaster Recovery configuration name
+ :type alias: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBAuthorizationRule or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBAuthorizationRule', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def list_keys(
+ self, resource_group_name, namespace_name, alias, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Gets the primary and secondary connection strings for the namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param alias: The Disaster Recovery configuration name
+ :type alias: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: AccessKeys or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.AccessKeys or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/AuthorizationRules/{authorizationRuleName}/listKeys'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('AccessKeys', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/event_hubs_operations.py b/src/servicebus/azext_servicebus/servicebus/operations/event_hubs_operations.py
new file mode 100644
index 00000000000..53434911990
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/event_hubs_operations.py
@@ -0,0 +1,107 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+import uuid
+from msrest.pipeline import ClientRawResponse
+
+from .. import models
+
+
+class EventHubsOperations(object):
+ """EventHubsOperations operations.
+
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An objec model deserializer.
+ :ivar api_version: Client API version. Constant value: "2017-04-01".
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self.api_version = "2017-04-01"
+
+ self.config = config
+
+ def list_by_namespace(
+ self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config):
+ """Gets all the Event Hubs in a service bus Namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of Eventhub
+ :rtype:
+ ~azure.mgmt.servicebus.models.EventhubPaged[~azure.mgmt.servicebus.models.Eventhub]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/eventhubs'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.EventhubPaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.EventhubPaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/namespaces_operations.py b/src/servicebus/azext_servicebus/servicebus/operations/namespaces_operations.py
new file mode 100644
index 00000000000..72abad2ce7f
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/namespaces_operations.py
@@ -0,0 +1,939 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+import uuid
+from msrest.pipeline import ClientRawResponse
+from msrestazure.azure_operation import AzureOperationPoller
+
+from .. import models
+
+
+class NamespacesOperations(object):
+ """NamespacesOperations operations.
+
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An objec model deserializer.
+ :ivar api_version: Client API version. Constant value: "2017-04-01".
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self.api_version = "2017-04-01"
+
+ self.config = config
+
+ def check_name_availability_method(
+ self, name, custom_headers=None, raw=False, **operation_config):
+ """Check the give namespace name availability.
+
+ :param name: The Name to check the namespce name availability and The
+ namespace name can contain only letters, numbers, and hyphens. The
+ namespace must start with a letter, and it must end with a letter or
+ number.
+ :type name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: CheckNameAvailabilityResult or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ parameters = models.CheckNameAvailability(name=name)
+
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability'
+ path_format_arguments = {
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'CheckNameAvailability')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('CheckNameAvailabilityResult', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def list(
+ self, custom_headers=None, raw=False, **operation_config):
+ """Gets all the available namespaces within the subscription, irrespective
+ of the resource groups.
+
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of SBNamespace
+ :rtype:
+ ~azure.mgmt.servicebus.models.SBNamespacePaged[~azure.mgmt.servicebus.models.SBNamespace]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces'
+ path_format_arguments = {
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.SBNamespacePaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.SBNamespacePaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def list_by_resource_group(
+ self, resource_group_name, custom_headers=None, raw=False, **operation_config):
+ """Gets the available namespaces within a resource group.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of SBNamespace
+ :rtype:
+ ~azure.mgmt.servicebus.models.SBNamespacePaged[~azure.mgmt.servicebus.models.SBNamespace]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.SBNamespacePaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.SBNamespacePaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def create_or_update(
+ self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config):
+ """Creates or updates a service namespace. Once created, this namespace's
+ resource manifest is immutable. This operation is idempotent.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name.
+ :type namespace_name: str
+ :param parameters: Parameters supplied to create a namespace resource.
+ :type parameters: ~azure.mgmt.servicebus.models.SBNamespace
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :return: An instance of AzureOperationPoller that returns SBNamespace
+ or ClientRawResponse if raw=true
+ :rtype:
+ ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servicebus.models.SBNamespace]
+ or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'SBNamespace')
+
+ # Construct and send request
+ def long_running_send():
+
+ request = self._client.put(url, query_parameters)
+ return self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ def get_long_running_status(status_link, headers=None):
+
+ request = self._client.get(status_link)
+ if headers:
+ request.headers.update(headers)
+ return self._client.send(
+ request, header_parameters, **operation_config)
+
+ def get_long_running_output(response):
+
+ if response.status_code not in [200, 201, 202]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBNamespace', response)
+ if response.status_code == 201:
+ deserialized = self._deserialize('SBNamespace', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ if raw:
+ response = long_running_send()
+ return get_long_running_output(response)
+
+ long_running_operation_timeout = operation_config.get(
+ 'long_running_operation_timeout',
+ self.config.long_running_operation_timeout)
+ return AzureOperationPoller(
+ long_running_send, get_long_running_output,
+ get_long_running_status, long_running_operation_timeout)
+
+ def delete(
+ self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config):
+ """Deletes an existing namespace. This operation also removes all
+ associated resources under the namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :return: An instance of AzureOperationPoller that returns None or
+ ClientRawResponse if raw=true
+ :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ def long_running_send():
+
+ request = self._client.delete(url, query_parameters)
+ return self._client.send(request, header_parameters, **operation_config)
+
+ def get_long_running_status(status_link, headers=None):
+
+ request = self._client.get(status_link)
+ if headers:
+ request.headers.update(headers)
+ return self._client.send(
+ request, header_parameters, **operation_config)
+
+ def get_long_running_output(response):
+
+ if response.status_code not in [200, 202, 204]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ if raw:
+ response = long_running_send()
+ return get_long_running_output(response)
+
+ long_running_operation_timeout = operation_config.get(
+ 'long_running_operation_timeout',
+ self.config.long_running_operation_timeout)
+ return AzureOperationPoller(
+ long_running_send, get_long_running_output,
+ get_long_running_status, long_running_operation_timeout)
+
+ def get(
+ self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config):
+ """Gets a description for the specified namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBNamespace or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBNamespace or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBNamespace', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def update(
+ self, resource_group_name, namespace_name, parameters, custom_headers=None, raw=False, **operation_config):
+ """Updates a service namespace. Once created, this namespace's resource
+ manifest is immutable. This operation is idempotent.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param parameters: Parameters supplied to update a namespace resource.
+ :type parameters:
+ ~azure.mgmt.servicebus.models.SBNamespaceUpdateParameters
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBNamespace or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBNamespace or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'SBNamespaceUpdateParameters')
+
+ # Construct and send request
+ request = self._client.patch(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200, 201, 202]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBNamespace', response)
+ if response.status_code == 201:
+ deserialized = self._deserialize('SBNamespace', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def list_authorization_rules(
+ self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config):
+ """Gets the authorization rules for a namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of SBAuthorizationRule
+ :rtype:
+ ~azure.mgmt.servicebus.models.SBAuthorizationRulePaged[~azure.mgmt.servicebus.models.SBAuthorizationRule]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def create_or_update_authorization_rule(
+ self, resource_group_name, namespace_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config):
+ """Creates or updates an authorization rule for a namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param rights: The rights associated with the rule.
+ :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights]
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBAuthorizationRule or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ parameters = models.SBAuthorizationRule(rights=rights)
+
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'SBAuthorizationRule')
+
+ # Construct and send request
+ request = self._client.put(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBAuthorizationRule', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def delete_authorization_rule(
+ self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Deletes a namespace authorization rule.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: None or ClientRawResponse if raw=true
+ :rtype: None or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200, 204]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ def get_authorization_rule(
+ self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Gets an authorization rule for a namespace by rule name.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBAuthorizationRule or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBAuthorizationRule', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def list_keys(
+ self, resource_group_name, namespace_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Gets the primary and secondary connection strings for the namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: AccessKeys or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.AccessKeys or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('AccessKeys', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def regenerate_keys(
+ self, resource_group_name, namespace_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config):
+ """Regenerates the primary or secondary connection strings for the
+ namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param key_type: The access key to regenerate. Possible values
+ include: 'PrimaryKey', 'SecondaryKey'
+ :type key_type: str or ~azure.mgmt.servicebus.models.KeyType
+ :param key: Optional, if the key value provided, is reset for KeyType
+ value or autogenerate Key value set for keyType
+ :type key: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: AccessKeys or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.AccessKeys or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key)
+
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('AccessKeys', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/operations.py b/src/servicebus/azext_servicebus/servicebus/operations/operations.py
new file mode 100644
index 00000000000..9b98254ae1e
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/operations.py
@@ -0,0 +1,96 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+import uuid
+from msrest.pipeline import ClientRawResponse
+
+from .. import models
+
+
+class Operations(object):
+ """Operations operations.
+
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An objec model deserializer.
+ :ivar api_version: Client API version. Constant value: "2017-04-01".
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self.api_version = "2017-04-01"
+
+ self.config = config
+
+ def list(
+ self, custom_headers=None, raw=False, **operation_config):
+ """Lists all of the available ServiceBus REST API operations.
+
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of Operation
+ :rtype:
+ ~azure.mgmt.servicebus.models.OperationPaged[~azure.mgmt.servicebus.models.Operation]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/providers/Microsoft.ServiceBus/operations'
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/premium_messaging_regions_operations.py b/src/servicebus/azext_servicebus/servicebus/operations/premium_messaging_regions_operations.py
new file mode 100644
index 00000000000..61dba404096
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/premium_messaging_regions_operations.py
@@ -0,0 +1,100 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+import uuid
+from msrest.pipeline import ClientRawResponse
+
+from .. import models
+
+
+class PremiumMessagingRegionsOperations(object):
+ """PremiumMessagingRegionsOperations operations.
+
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An objec model deserializer.
+ :ivar api_version: Client API version. Constant value: "2017-04-01".
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self.api_version = "2017-04-01"
+
+ self.config = config
+
+ def list(
+ self, custom_headers=None, raw=False, **operation_config):
+ """Gets the available premium messaging regions for servicebus .
+
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of PremiumMessagingRegions
+ :rtype:
+ ~azure.mgmt.servicebus.models.PremiumMessagingRegionsPaged[~azure.mgmt.servicebus.models.PremiumMessagingRegions]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/premiumMessagingRegions'
+ path_format_arguments = {
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.PremiumMessagingRegionsPaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.PremiumMessagingRegionsPaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/queues_operations.py b/src/servicebus/azext_servicebus/servicebus/operations/queues_operations.py
new file mode 100644
index 00000000000..f46dfc10223
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/queues_operations.py
@@ -0,0 +1,718 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+import uuid
+from msrest.pipeline import ClientRawResponse
+
+from .. import models
+
+
+class QueuesOperations(object):
+ """QueuesOperations operations.
+
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An objec model deserializer.
+ :ivar api_version: Client API version. Constant value: "2017-04-01".
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self.api_version = "2017-04-01"
+
+ self.config = config
+
+ def list_by_namespace(
+ self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config):
+ """Gets the queues within a namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of SBQueue
+ :rtype:
+ ~azure.mgmt.servicebus.models.SBQueuePaged[~azure.mgmt.servicebus.models.SBQueue]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.SBQueuePaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.SBQueuePaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def create_or_update(
+ self, resource_group_name, namespace_name, queue_name, parameters, custom_headers=None, raw=False, **operation_config):
+ """Creates or updates a Service Bus queue. This operation is idempotent.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param queue_name: The queue name.
+ :type queue_name: str
+ :param parameters: Parameters supplied to create or update a queue
+ resource.
+ :type parameters: ~azure.mgmt.servicebus.models.SBQueue
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBQueue or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBQueue or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'SBQueue')
+
+ # Construct and send request
+ request = self._client.put(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBQueue', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def delete(
+ self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config):
+ """Deletes a queue from the specified namespace in a resource group.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param queue_name: The queue name.
+ :type queue_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: None or ClientRawResponse if raw=true
+ :rtype: None or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200, 204]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ def get(
+ self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config):
+ """Returns a description for the specified queue.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param queue_name: The queue name.
+ :type queue_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBQueue or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBQueue or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBQueue', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def list_authorization_rules(
+ self, resource_group_name, namespace_name, queue_name, custom_headers=None, raw=False, **operation_config):
+ """Gets all authorization rules for a queue.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param queue_name: The queue name.
+ :type queue_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of SBAuthorizationRule
+ :rtype:
+ ~azure.mgmt.servicebus.models.SBAuthorizationRulePaged[~azure.mgmt.servicebus.models.SBAuthorizationRule]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def create_or_update_authorization_rule(
+ self, resource_group_name, namespace_name, queue_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config):
+ """Creates an authorization rule for a queue.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param queue_name: The queue name.
+ :type queue_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param rights: The rights associated with the rule.
+ :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights]
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBAuthorizationRule or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ parameters = models.SBAuthorizationRule(rights=rights)
+
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'SBAuthorizationRule')
+
+ # Construct and send request
+ request = self._client.put(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBAuthorizationRule', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def delete_authorization_rule(
+ self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Deletes a queue authorization rule.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param queue_name: The queue name.
+ :type queue_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: None or ClientRawResponse if raw=true
+ :rtype: None or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200, 204]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ def get_authorization_rule(
+ self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Gets an authorization rule for a queue by rule name.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param queue_name: The queue name.
+ :type queue_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBAuthorizationRule or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBAuthorizationRule', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def list_keys(
+ self, resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Primary and secondary connection strings to the queue.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param queue_name: The queue name.
+ :type queue_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: AccessKeys or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.AccessKeys or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('AccessKeys', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def regenerate_keys(
+ self, resource_group_name, namespace_name, queue_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config):
+ """Regenerates the primary or secondary connection strings to the queue.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param queue_name: The queue name.
+ :type queue_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param key_type: The access key to regenerate. Possible values
+ include: 'PrimaryKey', 'SecondaryKey'
+ :type key_type: str or ~azure.mgmt.servicebus.models.KeyType
+ :param key: Optional, if the key value provided, is reset for KeyType
+ value or autogenerate Key value set for keyType
+ :type key: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: AccessKeys or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.AccessKeys or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key)
+
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'queueName': self._serialize.url("queue_name", queue_name, 'str', min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('AccessKeys', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/regions_operations.py b/src/servicebus/azext_servicebus/servicebus/operations/regions_operations.py
new file mode 100644
index 00000000000..7719011387f
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/regions_operations.py
@@ -0,0 +1,103 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+import uuid
+from msrest.pipeline import ClientRawResponse
+
+from .. import models
+
+
+class RegionsOperations(object):
+ """RegionsOperations operations.
+
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An objec model deserializer.
+ :ivar api_version: Client API version. Constant value: "2017-04-01".
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self.api_version = "2017-04-01"
+
+ self.config = config
+
+ def list_by_sku(
+ self, sku, custom_headers=None, raw=False, **operation_config):
+ """Gets the available Regions for a given sku.
+
+ :param sku: The sku type.
+ :type sku: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of PremiumMessagingRegions
+ :rtype:
+ ~azure.mgmt.servicebus.models.PremiumMessagingRegionsPaged[~azure.mgmt.servicebus.models.PremiumMessagingRegions]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/sku/{sku}/regions'
+ path_format_arguments = {
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
+ 'sku': self._serialize.url("sku", sku, 'str', max_length=50, min_length=1)
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.PremiumMessagingRegionsPaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.PremiumMessagingRegionsPaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/rules_operations.py b/src/servicebus/azext_servicebus/servicebus/operations/rules_operations.py
new file mode 100644
index 00000000000..1027ec33b58
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/rules_operations.py
@@ -0,0 +1,321 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+import uuid
+from msrest.pipeline import ClientRawResponse
+
+from .. import models
+
+
+class RulesOperations(object):
+ """RulesOperations operations.
+
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An objec model deserializer.
+ :ivar api_version: Client API version. Constant value: "2017-04-01".
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self.api_version = "2017-04-01"
+
+ self.config = config
+
+ def list_by_subscriptions(
+ self, resource_group_name, namespace_name, topic_name, subscription_name, custom_headers=None, raw=False, **operation_config):
+ """List all the rules within given topic-subscription.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param subscription_name: The subscription name.
+ :type subscription_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of Rule
+ :rtype:
+ ~azure.mgmt.servicebus.models.RulePaged[~azure.mgmt.servicebus.models.Rule]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionName': self._serialize.url("subscription_name", subscription_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.RulePaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.RulePaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def create_or_update(
+ self, resource_group_name, namespace_name, topic_name, subscription_name, rule_name, parameters, custom_headers=None, raw=False, **operation_config):
+ """Creates a new rule and updates an existing rule.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param subscription_name: The subscription name.
+ :type subscription_name: str
+ :param rule_name: The rule name.
+ :type rule_name: str
+ :param parameters: Parameters supplied to create a rule.
+ :type parameters: ~azure.mgmt.servicebus.models.Rule
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: Rule or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.Rule or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionName': self._serialize.url("subscription_name", subscription_name, 'str', max_length=50, min_length=1),
+ 'ruleName': self._serialize.url("rule_name", rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'Rule')
+
+ # Construct and send request
+ request = self._client.put(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('Rule', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def delete(
+ self, resource_group_name, namespace_name, topic_name, subscription_name, rule_name, custom_headers=None, raw=False, **operation_config):
+ """Deletes an existing rule.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param subscription_name: The subscription name.
+ :type subscription_name: str
+ :param rule_name: The rule name.
+ :type rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: None or ClientRawResponse if raw=true
+ :rtype: None or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionName': self._serialize.url("subscription_name", subscription_name, 'str', max_length=50, min_length=1),
+ 'ruleName': self._serialize.url("rule_name", rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200, 204]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ def get(
+ self, resource_group_name, namespace_name, topic_name, subscription_name, rule_name, custom_headers=None, raw=False, **operation_config):
+ """Retrieves the description for the specified rule.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param subscription_name: The subscription name.
+ :type subscription_name: str
+ :param rule_name: The rule name.
+ :type rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: Rule or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.Rule or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionName': self._serialize.url("subscription_name", subscription_name, 'str', max_length=50, min_length=1),
+ 'ruleName': self._serialize.url("rule_name", rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('Rule', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/subscriptions_operations.py b/src/servicebus/azext_servicebus/servicebus/operations/subscriptions_operations.py
new file mode 100644
index 00000000000..a2f607b62fe
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/subscriptions_operations.py
@@ -0,0 +1,310 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+import uuid
+from msrest.pipeline import ClientRawResponse
+
+from .. import models
+
+
+class SubscriptionsOperations(object):
+ """SubscriptionsOperations operations.
+
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An objec model deserializer.
+ :ivar api_version: Client API version. Constant value: "2017-04-01".
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self.api_version = "2017-04-01"
+
+ self.config = config
+
+ def list_by_topic(
+ self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config):
+ """List all the subscriptions under a specified topic.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of SBSubscription
+ :rtype:
+ ~azure.mgmt.servicebus.models.SBSubscriptionPaged[~azure.mgmt.servicebus.models.SBSubscription]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.SBSubscriptionPaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.SBSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def create_or_update(
+ self, resource_group_name, namespace_name, topic_name, subscription_name, parameters, custom_headers=None, raw=False, **operation_config):
+ """Creates a topic subscription.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param subscription_name: The subscription name.
+ :type subscription_name: str
+ :param parameters: Parameters supplied to create a subscription
+ resource.
+ :type parameters: ~azure.mgmt.servicebus.models.SBSubscription
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBSubscription or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBSubscription or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionName': self._serialize.url("subscription_name", subscription_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'SBSubscription')
+
+ # Construct and send request
+ request = self._client.put(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBSubscription', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def delete(
+ self, resource_group_name, namespace_name, topic_name, subscription_name, custom_headers=None, raw=False, **operation_config):
+ """Deletes a subscription from the specified topic.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param subscription_name: The subscription name.
+ :type subscription_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: None or ClientRawResponse if raw=true
+ :rtype: None or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionName': self._serialize.url("subscription_name", subscription_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200, 204]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ def get(
+ self, resource_group_name, namespace_name, topic_name, subscription_name, custom_headers=None, raw=False, **operation_config):
+ """Returns a subscription description for the specified topic.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param subscription_name: The subscription name.
+ :type subscription_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBSubscription or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBSubscription or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionName': self._serialize.url("subscription_name", subscription_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBSubscription', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
diff --git a/src/servicebus/azext_servicebus/servicebus/operations/topics_operations.py b/src/servicebus/azext_servicebus/servicebus/operations/topics_operations.py
new file mode 100644
index 00000000000..d9761363df8
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/operations/topics_operations.py
@@ -0,0 +1,717 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+import uuid
+from msrest.pipeline import ClientRawResponse
+
+from .. import models
+
+
+class TopicsOperations(object):
+ """TopicsOperations operations.
+
+ :param client: Client for service requests.
+ :param config: Configuration of service client.
+ :param serializer: An object model serializer.
+ :param deserializer: An objec model deserializer.
+ :ivar api_version: Client API version. Constant value: "2017-04-01".
+ """
+
+ models = models
+
+ def __init__(self, client, config, serializer, deserializer):
+
+ self._client = client
+ self._serialize = serializer
+ self._deserialize = deserializer
+ self.api_version = "2017-04-01"
+
+ self.config = config
+
+ def list_by_namespace(
+ self, resource_group_name, namespace_name, custom_headers=None, raw=False, **operation_config):
+ """Gets all the topics in a namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of SBTopic
+ :rtype:
+ ~azure.mgmt.servicebus.models.SBTopicPaged[~azure.mgmt.servicebus.models.SBTopic]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.SBTopicPaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.SBTopicPaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def create_or_update(
+ self, resource_group_name, namespace_name, topic_name, parameters, custom_headers=None, raw=False, **operation_config):
+ """Creates a topic in the specified namespace.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param parameters: Parameters supplied to create a topic resource.
+ :type parameters: ~azure.mgmt.servicebus.models.SBTopic
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBTopic or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBTopic or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'SBTopic')
+
+ # Construct and send request
+ request = self._client.put(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBTopic', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def delete(
+ self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config):
+ """Deletes a topic from the specified namespace and resource group.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: None or ClientRawResponse if raw=true
+ :rtype: None or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200, 204]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ def get(
+ self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config):
+ """Returns a description for the specified topic.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBTopic or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBTopic or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBTopic', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def list_authorization_rules(
+ self, resource_group_name, namespace_name, topic_name, custom_headers=None, raw=False, **operation_config):
+ """Gets authorization rules for a topic.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: An iterator like instance of SBAuthorizationRule
+ :rtype:
+ ~azure.mgmt.servicebus.models.SBAuthorizationRulePaged[~azure.mgmt.servicebus.models.SBAuthorizationRule]
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ def internal_paging(next_link=None, raw=False):
+
+ if not next_link:
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ else:
+ url = next_link
+ query_parameters = {}
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ return response
+
+ # Deserialize response
+ deserialized = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies)
+
+ if raw:
+ header_dict = {}
+ client_raw_response = models.SBAuthorizationRulePaged(internal_paging, self._deserialize.dependencies, header_dict)
+ return client_raw_response
+
+ return deserialized
+
+ def create_or_update_authorization_rule(
+ self, resource_group_name, namespace_name, topic_name, authorization_rule_name, rights, custom_headers=None, raw=False, **operation_config):
+ """Creates an authorizatio rule for the specified topic.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param rights: The rights associated with the rule.
+ :type rights: list[str or ~azure.mgmt.servicebus.models.AccessRights]
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBAuthorizationRule or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ parameters = models.SBAuthorizationRule(rights=rights)
+
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'SBAuthorizationRule')
+
+ # Construct and send request
+ request = self._client.put(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBAuthorizationRule', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def get_authorization_rule(
+ self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Returns the specified authorization rule.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: SBAuthorizationRule or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.get(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('SBAuthorizationRule', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def delete_authorization_rule(
+ self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Deletes a topic authorization rule.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: None or ClientRawResponse if raw=true
+ :rtype: None or ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.delete(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200, 204]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(None, response)
+ return client_raw_response
+
+ def list_keys(
+ self, resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers=None, raw=False, **operation_config):
+ """Gets the primary and secondary connection strings for the topic.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: AccessKeys or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.AccessKeys or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(request, header_parameters, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('AccessKeys', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
+
+ def regenerate_keys(
+ self, resource_group_name, namespace_name, topic_name, authorization_rule_name, key_type, key=None, custom_headers=None, raw=False, **operation_config):
+ """Regenerates primary or secondary connection strings for the topic.
+
+ :param resource_group_name: Name of the Resource group within the
+ Azure subscription.
+ :type resource_group_name: str
+ :param namespace_name: The namespace name
+ :type namespace_name: str
+ :param topic_name: The topic name.
+ :type topic_name: str
+ :param authorization_rule_name: The authorizationrule name.
+ :type authorization_rule_name: str
+ :param key_type: The access key to regenerate. Possible values
+ include: 'PrimaryKey', 'SecondaryKey'
+ :type key_type: str or ~azure.mgmt.servicebus.models.KeyType
+ :param key: Optional, if the key value provided, is reset for KeyType
+ value or autogenerate Key value set for keyType
+ :type key: str
+ :param dict custom_headers: headers that will be added to the request
+ :param bool raw: returns the direct response alongside the
+ deserialized response
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :return: AccessKeys or ClientRawResponse if raw=true
+ :rtype: ~azure.mgmt.servicebus.models.AccessKeys or
+ ~msrest.pipeline.ClientRawResponse
+ :raises:
+ :class:`ErrorResponseException`
+ """
+ parameters = models.RegenerateAccessKeyParameters(key_type=key_type, key=key)
+
+ # Construct URL
+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys'
+ path_format_arguments = {
+ 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
+ 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6),
+ 'topicName': self._serialize.url("topic_name", topic_name, 'str', min_length=1),
+ 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', max_length=50, min_length=1),
+ 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
+ }
+ url = self._client.format_url(url, **path_format_arguments)
+
+ # Construct parameters
+ query_parameters = {}
+ query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
+
+ # Construct headers
+ header_parameters = {}
+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'
+ if self.config.generate_client_request_id:
+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
+ if custom_headers:
+ header_parameters.update(custom_headers)
+ if self.config.accept_language is not None:
+ header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
+
+ # Construct body
+ body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters')
+
+ # Construct and send request
+ request = self._client.post(url, query_parameters)
+ response = self._client.send(
+ request, header_parameters, body_content, **operation_config)
+
+ if response.status_code not in [200]:
+ raise models.ErrorResponseException(self._deserialize, response)
+
+ deserialized = None
+
+ if response.status_code == 200:
+ deserialized = self._deserialize('AccessKeys', response)
+
+ if raw:
+ client_raw_response = ClientRawResponse(deserialized, response)
+ return client_raw_response
+
+ return deserialized
diff --git a/src/servicebus/azext_servicebus/servicebus/service_bus_management_client.py b/src/servicebus/azext_servicebus/servicebus/service_bus_management_client.py
new file mode 100644
index 00000000000..8f6fb7cea88
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/service_bus_management_client.py
@@ -0,0 +1,130 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+from msrest.service_client import ServiceClient
+from msrest import Serializer, Deserializer
+from msrestazure import AzureConfiguration
+from .version import VERSION
+from .operations.operations import Operations
+from .operations.namespaces_operations import NamespacesOperations
+from .operations.disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations
+from .operations.queues_operations import QueuesOperations
+from .operations.topics_operations import TopicsOperations
+from .operations.subscriptions_operations import SubscriptionsOperations
+from .operations.rules_operations import RulesOperations
+from .operations.regions_operations import RegionsOperations
+from .operations.premium_messaging_regions_operations import PremiumMessagingRegionsOperations
+from .operations.event_hubs_operations import EventHubsOperations
+from . import models
+
+
+class ServiceBusManagementClientConfiguration(AzureConfiguration):
+ """Configuration for ServiceBusManagementClient
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param credentials: Credentials needed for the client to connect to Azure.
+ :type credentials: :mod:`A msrestazure Credentials
+ object`
+ :param subscription_id: Subscription credentials that uniquely identify a
+ Microsoft Azure subscription. The subscription ID forms part of the URI
+ for every service call.
+ :type subscription_id: str
+ :param str base_url: Service URL
+ """
+
+ def __init__(
+ self, credentials, subscription_id, base_url=None):
+
+ if credentials is None:
+ raise ValueError("Parameter 'credentials' must not be None.")
+ if subscription_id is None:
+ raise ValueError("Parameter 'subscription_id' must not be None.")
+ if not base_url:
+ base_url = 'https://management.azure.com'
+
+ super(ServiceBusManagementClientConfiguration, self).__init__(base_url)
+
+ self.add_user_agent('azure-mgmt-servicebus/{}'.format(VERSION))
+ self.add_user_agent('Azure-SDK-For-Python')
+
+ self.credentials = credentials
+ self.subscription_id = subscription_id
+
+
+class ServiceBusManagementClient(object):
+ """Azure Service Bus client
+
+ :ivar config: Configuration for client.
+ :vartype config: ServiceBusManagementClientConfiguration
+
+ :ivar operations: Operations operations
+ :vartype operations: azure.mgmt.servicebus.operations.Operations
+ :ivar namespaces: Namespaces operations
+ :vartype namespaces: azure.mgmt.servicebus.operations.NamespacesOperations
+ :ivar disaster_recovery_configs: DisasterRecoveryConfigs operations
+ :vartype disaster_recovery_configs: azure.mgmt.servicebus.operations.DisasterRecoveryConfigsOperations
+ :ivar queues: Queues operations
+ :vartype queues: azure.mgmt.servicebus.operations.QueuesOperations
+ :ivar topics: Topics operations
+ :vartype topics: azure.mgmt.servicebus.operations.TopicsOperations
+ :ivar subscriptions: Subscriptions operations
+ :vartype subscriptions: azure.mgmt.servicebus.operations.SubscriptionsOperations
+ :ivar rules: Rules operations
+ :vartype rules: azure.mgmt.servicebus.operations.RulesOperations
+ :ivar regions: Regions operations
+ :vartype regions: azure.mgmt.servicebus.operations.RegionsOperations
+ :ivar premium_messaging_regions: PremiumMessagingRegions operations
+ :vartype premium_messaging_regions: azure.mgmt.servicebus.operations.PremiumMessagingRegionsOperations
+ :ivar event_hubs: EventHubs operations
+ :vartype event_hubs: azure.mgmt.servicebus.operations.EventHubsOperations
+
+ :param credentials: Credentials needed for the client to connect to Azure.
+ :type credentials: :mod:`A msrestazure Credentials
+ object`
+ :param subscription_id: Subscription credentials that uniquely identify a
+ Microsoft Azure subscription. The subscription ID forms part of the URI
+ for every service call.
+ :type subscription_id: str
+ :param str base_url: Service URL
+ """
+
+ def __init__(
+ self, credentials, subscription_id, base_url=None):
+
+ self.config = ServiceBusManagementClientConfiguration(credentials, subscription_id, base_url)
+ self._client = ServiceClient(self.config.credentials, self.config)
+
+ client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
+ self.api_version = '2017-04-01'
+ self._serialize = Serializer(client_models)
+ self._deserialize = Deserializer(client_models)
+
+ self.operations = Operations(
+ self._client, self.config, self._serialize, self._deserialize)
+ self.namespaces = NamespacesOperations(
+ self._client, self.config, self._serialize, self._deserialize)
+ self.disaster_recovery_configs = DisasterRecoveryConfigsOperations(
+ self._client, self.config, self._serialize, self._deserialize)
+ self.queues = QueuesOperations(
+ self._client, self.config, self._serialize, self._deserialize)
+ self.topics = TopicsOperations(
+ self._client, self.config, self._serialize, self._deserialize)
+ self.subscriptions = SubscriptionsOperations(
+ self._client, self.config, self._serialize, self._deserialize)
+ self.rules = RulesOperations(
+ self._client, self.config, self._serialize, self._deserialize)
+ self.regions = RegionsOperations(
+ self._client, self.config, self._serialize, self._deserialize)
+ self.premium_messaging_regions = PremiumMessagingRegionsOperations(
+ self._client, self.config, self._serialize, self._deserialize)
+ self.event_hubs = EventHubsOperations(
+ self._client, self.config, self._serialize, self._deserialize)
diff --git a/src/servicebus/azext_servicebus/servicebus/version.py b/src/servicebus/azext_servicebus/servicebus/version.py
new file mode 100644
index 00000000000..85da2c00c1a
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/version.py
@@ -0,0 +1,13 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for
+# license information.
+#
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is
+# regenerated.
+# --------------------------------------------------------------------------
+
+VERSION = "0.4.0"
+
diff --git a/src/servicebus/azext_servicebus/tests/__init__.py b/src/servicebus/azext_servicebus/tests/__init__.py
new file mode 100644
index 00000000000..34913fb394d
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/__init__.py
@@ -0,0 +1,4 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
diff --git a/src/servicebus/azext_servicebus/tests/recordings/Testing.py b/src/servicebus/azext_servicebus/tests/recordings/Testing.py
new file mode 100644
index 00000000000..038036e8d36
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/recordings/Testing.py
@@ -0,0 +1,9 @@
+import isodate
+from isodate.isoerror import ISO8601Error
+from knack.util import CLIError
+
+try:
+ isodate.parse_duration('PT11qM')
+except ISO8601Error as s:
+ raise CLIError(s)
+
diff --git a/src/servicebus/azext_servicebus/tests/recordings/latest/test_get_latest_invoice.yaml b/src/servicebus/azext_servicebus/tests/recordings/latest/test_get_latest_invoice.yaml
new file mode 100644
index 00000000000..7de82d9b2ef
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/recordings/latest/test_get_latest_invoice.yaml
@@ -0,0 +1,32 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [billing invoice show-latest]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.1 (Windows-10-10.0.15063-SP0) requests/2.9.1 msrest/0.4.7
+ msrest_azure/0.4.7 billingmanagementclient/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.6+dev]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/invoices/latest?api-version=2017-04-24-preview
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/invoices/201705-217089190378988","type":"Microsoft.Billing/invoices","name":"201705-217089190378988","properties":{"downloadUrl":{"expiryTime":"2017-05-17T02:55:46Z","url":"https://billinginsightsstore02.blob.core.windows.net/invoices/f515e8e7-163d-4634-8b1d-e09d3fb4e866-201705-217089190378988.pdf?sv=2014-02-14&sr=b&sig=Cghf8nJEDGR%2BVUpD8%2Fe5pqw2krhxYvGPMbf9XNhsP98%3D&se=2017-05-17T02%3A55%3A46Z&sp=r"},"invoicePeriodEndDate":"2017-04-26","invoicePeriodStartDate":"2017-03-27","billingPeriodIds":["/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201705-1"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['697']
+ content-type: [application/json; charset=utf-8]
+ date: ['Wed, 17 May 2017 01:55:49 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Microsoft-IIS/8.5]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-aspnet-version: [4.0.30319]
+ x-ms-ratelimit-remaining-subscription-resource-requests: ['99']
+ x-powered-by: [ASP.NET]
+ status: {code: 200, message: OK}
+version: 1
diff --git a/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_alias.yaml b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_alias.yaml
new file mode 100644
index 00000000000..9934724f34d
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_alias.yaml
@@ -0,0 +1,1325 @@
+interactions:
+- request:
+ body: '{"location": "westus", "tags": {"use": "az-test"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['50']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_namespace000001?api-version=2017-05-10
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001","name":"cli_test_sb_namespace000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['328']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:52:42 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 201, message: Created}
+- request:
+ body: 'b''{"name": "sb-nscli000002"}'''
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['32']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceBus/CheckNameAvailability?api-version=2017-04-01
+ response:
+ body: {string: '{"nameAvailable":true,"reason":"None","message":null}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['53']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:52:43 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: '{"location": "SouthCentralUS", "tags": {"{tag1: value1,": "", "tag2: value2}":
+ ""}, "sku": {"name": "Premium", "tier": "Premium"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['130']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"South
+ Central US","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-16T18:52:45.79Z","updatedAt":"2017-12-16T18:52:45.79Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['712']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:52:45 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"South
+ Central US","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-16T18:52:45.79Z","updatedAt":"2017-12-16T18:52:45.79Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['712']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:53:15 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"South
+ Central US","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-16T18:52:45.79Z","updatedAt":"2017-12-16T18:53:30.617Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['711']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:53:45 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"South
+ Central US","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-16T18:52:45.79Z","updatedAt":"2017-12-16T18:53:30.617Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['711']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:53:47 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"location": "NorthCentralUS", "tags": {"{tag1: value1,": "", "tag2: value2}":
+ ""}, "sku": {"name": "Premium", "tier": "Premium"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['130']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","name":"sb-nscli000003","type":"Microsoft.ServiceBus/Namespaces","location":"North
+ Central US","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000003","createdAt":"2017-12-16T18:53:49.243Z","updatedAt":"2017-12-16T18:53:49.243Z","serviceBusEndpoint":"https://sb-nscli000003.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['714']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:53:48 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","name":"sb-nscli000003","type":"Microsoft.ServiceBus/Namespaces","location":"North
+ Central US","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000003","createdAt":"2017-12-16T18:53:49.243Z","updatedAt":"2017-12-16T18:53:49.243Z","serviceBusEndpoint":"https://sb-nscli000003.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['714']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:54:18 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","name":"sb-nscli000003","type":"Microsoft.ServiceBus/Namespaces","location":"North
+ Central US","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000003","createdAt":"2017-12-16T18:53:49.243Z","updatedAt":"2017-12-16T18:54:40.477Z","serviceBusEndpoint":"https://sb-nscli000003.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['712']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:54:49 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","name":"sb-nscli000003","type":"Microsoft.ServiceBus/Namespaces","location":"North
+ Central US","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000003","createdAt":"2017-12-16T18:53:49.243Z","updatedAt":"2017-12-16T18:54:40.477Z","serviceBusEndpoint":"https://sb-nscli000003.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['712']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:54:50 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"properties": {"rights": ["Send", "Listen"]}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['46']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/AuthorizationRules/cliAutho000004?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/AuthorizationRules/cliAutho000004","name":"cliAutho000004","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"South
+ Central US","properties":{"rights":["Send","Listen"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['416']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:55:23 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/AuthorizationRules/cliAutho000004?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/AuthorizationRules/cliAutho000004","name":"cliAutho000004","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"South
+ Central US","properties":{"rights":["Send","Listen"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['416']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:55:25 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: 'b''{"name": "cliAlias000005"}'''
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['32']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/CheckNameAvailability?api-version=2017-04-01
+ response:
+ body: {string: '{"nameAvailable":true,"reason":"None"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['38']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:55:25 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: 'b''b\''{"properties": {"partnerNamespace": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003"}}\'''''
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['245']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:55:58 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:55:59 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","role":"Secondary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['675']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:55:59 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:56:00 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:56:30 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:57:01 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:57:32 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Succeeded","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['674']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:58:02 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005/breakPairing?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 18:58:03 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:58:03 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:58:34 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:59:04 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Succeeded","partnerNamespace":"","role":"PrimaryNotReplicating","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['483']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:59:34 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: 'b''b\''{"properties": {"partnerNamespace": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003"}}\'''''
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['245']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:59:52 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 18:59:53 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 19:00:24 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 19:00:54 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 19:01:25 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Succeeded","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003","role":"Primary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['674']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 19:01:55 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005/failover?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:01:56 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","role":"Secondary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['675']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 19:01:56 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","role":"Secondary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['675']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 19:02:27 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Accepted","partnerNamespace":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","role":"Secondary","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['675']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 19:02:58 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005","name":"cliAlias000005","type":"Microsoft.ServiceBus/Namespaces/disasterrecoveryconfigs","properties":{"provisioningState":"Succeeded","partnerNamespace":"","role":"PrimaryNotReplicating","type":"MetadataReplication"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['483']
+ content-type: [application/json; charset=utf-8]
+ date: ['Sat, 16 Dec 2017 19:03:28 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/disasterRecoveryConfigs/cliAlias000005?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:03:29 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:03:30 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/operationresults/sb-nscli000002?api-version=2017-04-01']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/operationresults/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:04:00 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/operationresults/sb-nscli000002?api-version=2017-04-01']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/operationresults/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:04:31 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/operationresults/sb-nscli000002?api-version=2017-04-01']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/operationresults/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:05:02 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:05:03 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/operationresults/sb-nscli000003?api-version=2017-04-01']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/operationresults/sb-nscli000003?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:05:33 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/operationresults/sb-nscli000003?api-version=2017-04-01']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/operationresults/sb-nscli000003?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:06:04 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/operationresults/sb-nscli000003?api-version=2017-04-01']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 azure-mgmt-servicebus/0.4.0 Azure-SDK-For-Python AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003/operationresults/sb-nscli000003?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:06:35 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ server: [Service-Bus-Resource-Provider/SN1, Microsoft-HTTPAPI/2.0]
+ server-sb: [Service-Bus-Resource-Provider/SN1]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [unknown]
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.6.3 (Windows-10-10.0.15063-SP0) requests/2.18.4 msrest/0.4.19
+ msrest_azure/0.4.18 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.22]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_namespace000001?api-version=2017-05-10
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Sat, 16 Dec 2017 19:06:36 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGU0I6NUZOQU1FU1BBQ0VVNFRMN1NOSUxCVk5USldNRUFaV3xFQ0Y2MTYzREZGOEU3OUI2LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10']
+ pragma: [no-cache]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 202, message: Accepted}
+version: 1
diff --git a/src/servicebus/azext_servicebus/tests/test_sbAlias_commands.py b/src/servicebus/azext_servicebus/tests/test_sbAlias_commands.py
new file mode 100644
index 00000000000..7b6726aa84f
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/test_sbAlias_commands.py
@@ -0,0 +1,158 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+# AZURE CLI VM TEST DEFINITIONS
+import json
+import os
+import platform
+import tempfile
+import time
+import unittest
+import mock
+import uuid
+
+import six
+
+from knack.util import CLIError
+
+from azure.cli.core.profiles import ResourceType
+from azure.cli.testsdk import (
+ ScenarioTest, ResourceGroupPreparer, LiveScenarioTest, api_version_constraint, StorageAccountPreparer)
+from azure.mgmt.servicebus.models import ProvisioningStateDR, SBNamespace
+
+TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
+
+# pylint: disable=line-too-long
+# pylint: disable=too-many-lines
+
+
+class SBAliasCURDScenarioTest(ScenarioTest):
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_namespace')
+ def test_sb_alias(self, resource_group):
+
+ self.kwargs.update({
+ 'loc_south': 'SouthCentralUS',
+ 'loc_north': 'NorthCentralUS',
+ 'namespacenameprimary': self.create_random_name(prefix='sb-nscli', length=20),
+ 'namespacenamesecondary': self.create_random_name(prefix='sb-nscli', length=20),
+ 'tags': {'tag1: value1', 'tag2: value2'},
+ 'sku': 'Premium',
+ 'tier': 'Premium',
+ 'authoname': self.create_random_name(prefix='cliAutho', length=20),
+ 'defaultauthorizationrule': 'RootManageSharedAccessKey',
+ 'accessrights': 'Send, Listen',
+ 'primary': 'PrimaryKey',
+ 'secondary': 'SecondaryKey',
+ 'aliasname': self.create_random_name(prefix='cliAlias', length=20),
+ 'alternatename': self.create_random_name(prefix='cliAlter', length=20),
+ 'id': '',
+ 'test': ''
+ })
+
+ checknamespaceresult = self.cmd('sb namespace check_name_availability --name {namespacenameprimary}', checks=[self.check('nameAvailable', True)]).output
+
+ self.kwargs.update({'test': json.loads(checknamespaceresult)['reason']})
+
+ # Create Namespace - Primary
+ createnames1paceresult = self.cmd('sb namespace create --resource-group {rg} --name {namespacenameprimary} --location {loc_south} --tags {tags} --sku-name {sku} --skutier {tier}', checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Get Created Namespace - Primary
+ getnamespace1result = self.cmd('sb namespace get --resource-group {rg} --name {namespacenameprimary}', checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Create Namespace - Secondary
+ createnamespace2result = self.cmd('sb namespace create --resource-group {rg} --name {namespacenamesecondary} --location {loc_north} --tags {tags} --sku-name {sku} --skutier {tier}', checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Get Created Namespace - Secondary
+ getnamespace2result = self.cmd('sb namespace get --resource-group {rg} --name {namespacenamesecondary}', checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Create Authoriazation Rule
+ # createauthorizationruleresult = self.cmd('sb namespace authorizationrule create --resource-group {rg} --namespace-name {namespacename} --name {authoname} --access-rights {accessrights}',
+ createauthorizationruleresult = self.cmd(
+ 'sb namespace authorizationrule create --resource-group {rg} --namespace-name {namespacenameprimary} --name {authoname}', checks=[self.check('name', self.kwargs['authoname'])]).output
+
+ partnernamespaceid = json.loads(getnamespace2result)['id']
+ self.kwargs.update({'id': partnernamespaceid})
+ # Get Create Authorization Rule
+ getauthorizationruleresult = self.cmd(
+ 'sb namespace authorizationrule get --resource-group {rg} --namespace-name {namespacenameprimary} --name {authoname}', checks=[self.check('name', self.kwargs['authoname'])]).output
+
+ # CheckNameAvailability - Alias
+
+ checkaliasresult = self.cmd('sb alias check_name_availability --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}', checks=[self.check('nameAvailable', True)]).output
+
+ # Create alias
+ createalias = self.cmd('sb alias create --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname} --partner-namespace {id}').output
+
+ # get alias - Primary
+ getaliasprimary = self.cmd(
+ 'sb alias get --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+ # get alias - Secondary
+ getaliassecondary = self.cmd(
+ 'sb alias get --resource-group {rg} --namespace-name {namespacenamesecondary} --alias {aliasname}').output
+
+ getaliasprimarynamespace = self.cmd(
+ 'sb alias get --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+ #check for the Alias Provisioning succeeded
+ while json.loads(getaliasprimarynamespace)['provisioningState'] != ProvisioningStateDR.succeeded.value:
+ time.sleep(30)
+ getaliasprimarynamespace = self.cmd(
+ 'sb alias get --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+
+ # Break Pairing
+ breakpairing = self.cmd(
+ 'sb alias break_pairing --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+ getaliasafterbreak = self.cmd(
+ 'sb alias get --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+ # check for the Alias Provisioning succeeded
+ while json.loads(getaliasafterbreak)['provisioningState'] != ProvisioningStateDR.succeeded.value:
+ time.sleep(30)
+ getaliasafterbreak = self.cmd(
+ 'sb alias get --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+
+ # Create alias
+ createalias = self.cmd(
+ 'sb alias create --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname} --partner-namespace {id}').output
+
+ getaliasaftercreate = self.cmd(
+ 'sb alias get --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+ # check for the Alias Provisioning succeeded
+ while json.loads(getaliasaftercreate)['provisioningState'] != ProvisioningStateDR.succeeded.value:
+ time.sleep(30)
+ getaliasaftercreate = self.cmd(
+ 'sb alias get --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+ # FailOver
+ failover = self.cmd(
+ 'sb alias fail_over --resource-group {rg} --namespace-name {namespacenamesecondary} --alias {aliasname}').output
+
+ getaliasafterfail = self.cmd(
+ 'sb alias get --resource-group {rg} --namespace-name {namespacenamesecondary} --alias {aliasname}').output
+
+ # check for the Alias Provisioning succeeded
+ while json.loads(getaliasafterfail)['provisioningState'] != ProvisioningStateDR.succeeded.value:
+ time.sleep(30)
+ getaliasafterfail = self.cmd(
+ 'sb alias get --resource-group {rg} --namespace-name {namespacenamesecondary} --alias {aliasname}').output
+
+ # Delete Alias
+ deleteailais = self.cmd(
+ 'sb alias delete --resource-group {rg} --namespace-name {namespacenamesecondary} --alias {aliasname}').output
+
+ # Delete Namespace - primary
+ self.cmd('sb namespace delete --resource-group {rg} --name {namespacenameprimary}')
+
+ # Delete Namespace - secondary
+ self.cmd('sb namespace delete --resource-group {rg} --name {namespacenamesecondary}')
+
+
+
diff --git a/src/servicebus/azext_servicebus/tests/test_sbQueue_commands.py b/src/servicebus/azext_servicebus/tests/test_sbQueue_commands.py
new file mode 100644
index 00000000000..9b17f57749e
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/test_sbQueue_commands.py
@@ -0,0 +1,113 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+# AZURE CLI VM TEST DEFINITIONS
+import json
+import os
+import platform
+import tempfile
+import time
+import unittest
+import mock
+import uuid
+
+import six
+
+from knack.util import CLIError
+
+from azure.cli.core.profiles import ResourceType
+from azure.cli.testsdk import (
+ ScenarioTest, ResourceGroupPreparer, LiveScenarioTest, api_version_constraint, StorageAccountPreparer)
+
+TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
+
+# pylint: disable=line-too-long
+# pylint: disable=too-many-lines
+
+
+class SBQueueCURDScenarioTest(ScenarioTest):
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_namespace')
+ def test_sb_namespace(self, resource_group):
+
+ self.kwargs.update({
+ 'loc': 'westus2',
+ 'namespacename': self.create_random_name(prefix='sb-nscli', length=20),
+ 'tags': {'tag1: value1', 'tag2: value2'},
+ 'sku': 'Standard',
+ 'tier': 'Standard',
+ 'authoname': self.create_random_name(prefix='cliAutho', length=20),
+ 'defaultauthorizationrule': 'RootManageSharedAccessKey',
+ 'accessrights': 'Send, Listen',
+ 'primary': 'PrimaryKey',
+ 'secondary': 'SecondaryKey',
+ 'queuename': self.create_random_name(prefix='sb-queuecli', length=25),
+ 'queueauthoname': self.create_random_name(prefix='cliQueueAutho', length=25),
+ 'lock_duration': 'PT10M'
+
+ })
+
+ # Create Namespace
+ createnamespaceresult = self.cmd(
+ 'sb namespace create --resource-group {rg} --name {namespacename} '
+ '--location {loc} --tags {tags} --sku-name {sku} --skutier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Get Created Namespace
+ getnamespaceresult = self.cmd(
+ 'sb namespace get --resource-group {rg} --name {namespacename}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Create Queue
+ createqueueresult = self.cmd(
+ 'sb queue create --resource-group {rg} --namespace-name {namespacename} --name {queuename} --auto-delete-on-idle {lock_duration} ',
+ checks=[self.check('name', self.kwargs['queuename'])]).output
+
+ # Get Queue
+ getqueueresult = self.cmd(
+ 'sb queue get --resource-group {rg} --namespace-name {namespacename} --name {queuename}',
+ checks=[self.check('name', self.kwargs['queuename'])]).output
+
+ # Queue List
+ listqueueresult = self.cmd(
+ 'sb queue list --resource-group {rg} --namespace-name {namespacename}').output
+
+ # Create Authoriazation Rule
+ # createauthorizationruleresult = self.cmd('sb namespace authorizationrule create --resource-group {rg} --namespace-name {namespacename} --name {authoname} --access-rights {accessrights}',
+ createauthorizationruleresult = self.cmd(
+ 'sb queue authorizationrule create --resource-group {rg} --namespace-name {namespacename} --queue-name {queuename} --name {authoname}',
+ checks=[self.check('name', self.kwargs['authoname'])]).output
+
+ # Get Create Authorization Rule
+ getauthorizationruleresult = self.cmd(
+ 'sb queue authorizationrule get --resource-group {rg} --namespace-name {namespacename} --queue-name {queuename} --name {authoname}',
+ checks=[self.check('name', self.kwargs['authoname'])]).output
+
+ # Get Authorization Rule Listkeys
+ authorizationrulelistkeysresult = self.cmd(
+ 'sb queue authorizationrule listkeys --resource-group {rg} --namespace-name {namespacename} --queue-name {queuename} --name {authoname}').output
+
+ # Regeneratekeys - Primary
+ regenrateprimarykeyresult = self.cmd(
+ 'sb queue authorizationrule regeneratekeys --resource-group {rg} --namespace-name {namespacename} --queue-name {queuename} --name {authoname} --regeneratekey {primary}').output
+ self.assertIsNotNone(regenrateprimarykeyresult)
+
+ # Regeneratekeys - Secondary
+ regenratesecondarykeyresult = self.cmd(
+ 'sb queue authorizationrule regeneratekeys --resource-group {rg} --namespace-name {namespacename} --queue-name {queuename} --name {authoname} --regeneratekey {secondary}').output
+ self.assertIsNotNone(regenratesecondarykeyresult)
+
+ # Delete Queue AuthorizationRule
+ deleteauthorizationruleresult = self.cmd(
+ 'sb queue authorizationrule delete --resource-group {rg} --namespace-name {namespacename} --queue-name {queuename} --name {authoname}').output
+
+ # Delete Queue
+ self.cmd('sb queue delete --resource-group {rg} --namespace-name {namespacename} --name {queuename}')
+
+ # Delete Namespace
+ self.cmd('sb namespace delete --resource-group {rg} --name {namespacename}')
+
+
+
diff --git a/src/servicebus/azext_servicebus/tests/test_sbRules_commands.py b/src/servicebus/azext_servicebus/tests/test_sbRules_commands.py
new file mode 100644
index 00000000000..0fa3515f2db
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/test_sbRules_commands.py
@@ -0,0 +1,110 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+# AZURE CLI VM TEST DEFINITIONS
+import json
+import os
+import platform
+import tempfile
+import time
+import unittest
+import mock
+import uuid
+
+import six
+
+from knack.util import CLIError
+
+from azure.cli.core.profiles import ResourceType
+from azure.cli.testsdk import (
+ ScenarioTest, ResourceGroupPreparer, LiveScenarioTest, api_version_constraint, StorageAccountPreparer)
+
+TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
+
+# pylint: disable=line-too-long
+# pylint: disable=too-many-lines
+
+
+class SBRulesCURDScenarioTest(ScenarioTest):
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_namespace')
+ def test_sb_rules(self, resource_group):
+
+ self.kwargs.update({
+ 'loc': 'westus2',
+ 'namespacename': self.create_random_name(prefix='sb-nscli', length=20),
+ 'tags': {'tag1: value1', 'tag2: value2'},
+ 'sku': 'Standard',
+ 'tier': 'Standard',
+ 'authoname': self.create_random_name(prefix='cliAutho', length=20),
+ 'defaultauthorizationrule': 'RootManageSharedAccessKey',
+ 'accessrights': 'Send, Listen',
+ 'primary': 'PrimaryKey',
+ 'secondary': 'SecondaryKey',
+ 'topicname': self.create_random_name(prefix='sb-topiccli', length=25),
+ 'topicauthoname': self.create_random_name(prefix='cliTopicAutho', length=25),
+ 'subscriptionname': self.create_random_name(prefix='sb-subscli', length=25),
+ 'rulename': self.create_random_name(prefix='sb-rulecli', length=25),
+ 'sqlexpression': 'test=test'
+ })
+
+ # Create Namespace
+ createnamespaceresult = self.cmd(
+ 'sb namespace create --resource-group {rg} --name {namespacename} '
+ '--location {loc} --tags {tags} --sku-name {sku} --skutier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Get Created Namespace
+ getnamespaceresult = self.cmd(
+ 'sb namespace get --resource-group {rg} --name {namespacename}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Create Topic
+ createtopicresult = self.cmd(
+ 'sb topic create --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])]).output
+
+ # Get Topic
+ gettopicresult = self.cmd(
+ 'sb topic get --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])]).output
+
+ # Create Subscription
+ createsubscriptionresult = self.cmd(
+ 'sb subscription create --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {subscriptionname}',
+ checks=[self.check('name', self.kwargs['subscriptionname'])]).output
+
+ # Get Create Subscription
+ getsubscriptionresult = self.cmd(
+ 'sb subscription get --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {subscriptionname}',
+ checks=[self.check('name', self.kwargs['subscriptionname'])]).output
+
+ # Create Rules
+ createrulesresult = self.cmd(
+ 'sb rule create --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --subscription-name {subscriptionname} --name {rulename} --filter-sql-expression {sqlexpression}',
+ checks=[self.check('name', self.kwargs['rulename'])]).output
+
+ # Get Created Rules
+ getrulesnresult = self.cmd(
+ 'sb rule get --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --subscription-name {subscriptionname} --name {rulename}',
+ checks=[self.check('name', self.kwargs['rulename'])]).output
+
+ # Get Rules List By Subscription
+ listrulesnresult = self.cmd(
+ 'sb rule list --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --subscription-name {subscriptionname}').output
+ self.assertGreater(len(listrulesnresult), 0)
+
+ # Delete create Subscription
+ self.cmd(
+ 'sb rule delete --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --subscription-name {subscriptionname} --name {rulename}')
+
+ # Delete create Subscription
+ self.cmd('sb subscription delete --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {subscriptionname}')
+
+ # Delete Topic
+ self.cmd('sb topic delete --resource-group {rg} --namespace-name {namespacename} --name {topicname}')
+
+ # Delete Namespace
+ self.cmd('sb namespace delete --resource-group {rg} --name {namespacename}')
diff --git a/src/servicebus/azext_servicebus/tests/test_sbSubscription_commands.py b/src/servicebus/azext_servicebus/tests/test_sbSubscription_commands.py
new file mode 100644
index 00000000000..2a8e6fe69f8
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/test_sbSubscription_commands.py
@@ -0,0 +1,93 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+# AZURE CLI VM TEST DEFINITIONS
+import json
+import os
+import platform
+import tempfile
+import time
+import unittest
+import mock
+import uuid
+
+import six
+
+from knack.util import CLIError
+
+from azure.cli.core.profiles import ResourceType
+from azure.cli.testsdk import (
+ ScenarioTest, ResourceGroupPreparer, LiveScenarioTest, api_version_constraint, StorageAccountPreparer)
+
+TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
+
+# pylint: disable=line-too-long
+# pylint: disable=too-many-lines
+
+
+class SBSubscriptionCURDScenarioTest(ScenarioTest):
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_namespace')
+ def test_sb_namespace(self, resource_group):
+
+ self.kwargs.update({
+ 'loc': 'westus2',
+ 'namespacename': self.create_random_name(prefix='sb-nscli', length=20),
+ 'tags': {'tag1: value1', 'tag2: value2'},
+ 'sku': 'Standard',
+ 'tier': 'Standard',
+ 'authoname': self.create_random_name(prefix='cliAutho', length=20),
+ 'defaultauthorizationrule': 'RootManageSharedAccessKey',
+ 'accessrights': 'Send, Listen',
+ 'primary': 'PrimaryKey',
+ 'secondary': 'SecondaryKey',
+ 'topicname': self.create_random_name(prefix='sb-topiccli', length=25),
+ 'topicauthoname': self.create_random_name(prefix='cliTopicAutho', length=25),
+ 'subscriptionname': self.create_random_name(prefix='sb-subscli', length=25)
+ })
+
+ # Create Namespace
+ createnamespaceresult = self.cmd(
+ 'sb namespace create --resource-group {rg} --name {namespacename} '
+ '--location {loc} --tags {tags} --sku-name {sku} --skutier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Get Created Namespace
+ getnamespaceresult = self.cmd(
+ 'sb namespace get --resource-group {rg} --name {namespacename}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Create Topic
+ createtopicresult = self.cmd(
+ 'sb topic create --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])]).output
+
+ # Get Topic
+ gettopicresult = self.cmd(
+ 'sb topic get --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])]).output
+
+ # Create Subscription
+ createsubscriptionresult = self.cmd(
+ 'sb subscription create --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {subscriptionname}',
+ checks=[self.check('name', self.kwargs['subscriptionname'])]).output
+
+ # Get Create Subscription
+ getsubscriptionresult = self.cmd(
+ 'sb subscription get --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {subscriptionname}',
+ checks=[self.check('name', self.kwargs['subscriptionname'])]).output
+
+ # Get list of Subscription+
+ listsubscriptionresult = self.cmd(
+ 'sb subscription list --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname}').output
+
+ # Delete create Subscription
+ self.cmd('sb subscription delete --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {subscriptionname}')
+
+ # Delete Topic
+ self.cmd('sb topic delete --resource-group {rg} --namespace-name {namespacename} --name {topicname}')
+
+ # Delete Namespace
+ self.cmd('sb namespace delete --resource-group {rg} --name {namespacename}')
diff --git a/src/servicebus/azext_servicebus/tests/test_sbTopic_commands.py b/src/servicebus/azext_servicebus/tests/test_sbTopic_commands.py
new file mode 100644
index 00000000000..39e00270447
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/test_sbTopic_commands.py
@@ -0,0 +1,108 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+# AZURE CLI VM TEST DEFINITIONS
+import json
+import os
+import platform
+import tempfile
+import time
+import unittest
+import mock
+import uuid
+
+import six
+
+from knack.util import CLIError
+
+from azure.cli.core.profiles import ResourceType
+from azure.cli.testsdk import (
+ ScenarioTest, ResourceGroupPreparer, LiveScenarioTest, api_version_constraint, StorageAccountPreparer)
+
+TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
+
+# pylint: disable=line-too-long
+# pylint: disable=too-many-lines
+
+
+class SBTopicsCURDScenarioTest(ScenarioTest):
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_namespace')
+ def test_sb_namespace(self, resource_group):
+
+ self.kwargs.update({
+ 'loc': 'westus2',
+ 'namespacename': self.create_random_name(prefix='sb-nscli', length=20),
+ 'tags': {'tag1: value1', 'tag2: value2'},
+ 'sku': 'Standard',
+ 'tier': 'Standard',
+ 'authoname': self.create_random_name(prefix='cliAutho', length=20),
+ 'defaultauthorizationrule': 'RootManageSharedAccessKey',
+ 'accessrights': 'Send, Listen',
+ 'primary': 'PrimaryKey',
+ 'secondary': 'SecondaryKey',
+ 'topicname': self.create_random_name(prefix='sb-topiccli', length=25),
+ 'topicauthoname': self.create_random_name(prefix='cliTopicAutho', length=25)
+ })
+
+ # Create Namespace
+ createnamespaceresult = self.cmd(
+ 'servicebus namespace create --resource-group {rg} --name {namespacename} '
+ '--location {loc} --tags {tags} --sku-name {sku} --skutier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Get Created Namespace
+ getnamespaceresult = self.cmd(
+ 'servicebus namespace get --resource-group {rg} --name {namespacename}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Create Topic
+ createtopicresult = self.cmd(
+ 'servicebus topic create --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])]).output
+
+ # Get Topic
+ gettopicresult = self.cmd(
+ 'servicebus topic get --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])]).output
+
+ # Topic List
+ listtopicresult = self.cmd(
+ 'servicebus topic list --resource-group {rg} --namespace-name {namespacename}').output
+
+ # Create Authoriazation Rule
+ # createauthorizationruleresult = self.cmd('servicebus namespace authorizationrule create --resource-group {rg} --namespace-name {namespacename} --name {authoname} --access-rights {accessrights}',
+ createauthorizationruleresult = self.cmd(
+ 'servicebus topic authorizationrule create --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {authoname}',
+ checks=[self.check('name', self.kwargs['authoname'])]).output
+
+ # Get Create Authorization Rule
+ getauthorizationruleresult = self.cmd(
+ 'servicebus topic authorizationrule get --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {authoname}',
+ checks=[self.check('name', self.kwargs['authoname'])]).output
+
+ # Get Authorization Rule Listkeys
+ authorizationrulelistkeysresult = self.cmd(
+ 'servicebus topic authorizationrule listkeys --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {authoname}').output
+
+ # Regeneratekeys - Primary
+ regenrateprimarykeyresult = self.cmd(
+ 'servicebus topic authorizationrule regeneratekeys --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {authoname} --regeneratekey {primary}').output
+ self.assertIsNotNone(regenrateprimarykeyresult)
+
+ # Regeneratekeys - Secondary
+ regenratesecondarykeyresult = self.cmd(
+ 'servicebus topic authorizationrule regeneratekeys --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {authoname} --regeneratekey {secondary}').output
+ self.assertIsNotNone(regenratesecondarykeyresult)
+
+ # Delete Topic AuthorizationRule
+ deleteauthorizationruleresult = self.cmd(
+ 'servicebus topic authorizationrule delete --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {authoname}').output
+
+ # Delete Topic
+ self.cmd('servicebus topic delete --resource-group {rg} --namespace-name {namespacename} --name {topicname}')
+
+ # Delete Namespace
+ self.cmd('servicebus namespace delete --resource-group {rg} --name {namespacename}')
diff --git a/src/servicebus/azext_servicebus/tests/test_servicebus_commands.py b/src/servicebus/azext_servicebus/tests/test_servicebus_commands.py
new file mode 100644
index 00000000000..f44fd4e8a20
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/test_servicebus_commands.py
@@ -0,0 +1,108 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+# AZURE CLI VM TEST DEFINITIONS
+import json
+import os
+import platform
+import tempfile
+import time
+import unittest
+import mock
+import uuid
+
+import six
+
+from knack.util import CLIError
+
+from azure.cli.core.profiles import ResourceType
+from azure.cli.testsdk import (
+ ScenarioTest, ResourceGroupPreparer, LiveScenarioTest, api_version_constraint, StorageAccountPreparer)
+
+TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
+
+# pylint: disable=line-too-long
+# pylint: disable=too-many-lines
+
+
+class SBNamespaceCURDScenarioTest(ScenarioTest):
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_namespace')
+ def test_sb_namespace(self, resource_group):
+
+ self.kwargs.update({
+ 'loc': 'westus2',
+ 'namespacename': self.create_random_name(prefix='sb-nscli', length=20),
+ 'tags': {'tag1: value1', 'tag2: value2'},
+ 'sku': 'Standard',
+ 'tier': 'Standard',
+ 'authoname': self.create_random_name(prefix='cliAutho', length=20),
+ 'defaultauthorizationrule': 'RootManageSharedAccessKey',
+ 'accessrights': 'Send, Listen',
+ 'primary': 'PrimaryKey',
+ 'secondary': 'SecondaryKey'
+ })
+
+ # Check for the NameSpace name Availability
+
+ checknamespaceresult = self.cmd('sb namespace check_name_availability --name {namespacename}',
+ checks=[self.check('nameAvailable', True)]).output
+
+
+ # Create Namespace
+ createnamespaceresult = self.cmd('sb namespace create --resource-group {rg} --name {namespacename}'
+ '--location {loc} --tags {tags} --sku-name {sku} --skutier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Get Created Namespace
+ getnamespaceresult = self.cmd('sb namespace get --resource-group {rg} --name {namespacename}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Get Created Namespace list by subscription
+ listnamespaceresult = self.cmd('sb namespace list').output
+ self.assertGreater(len(listnamespaceresult), 0)
+
+ # Get Created Namespace list by ResourceGroup
+ listnamespacebyresourcegroupresult = self.cmd('sb namespace list --resource-group {rg}').output
+ self.assertGreater(len(listnamespacebyresourcegroupresult), 0)
+
+ # Create Authoriazation Rule
+ # createauthorizationruleresult = self.cmd('sb namespace authorizationrule create --resource-group {rg} --namespace-name {namespacename} --name {authoname} --access-rights {accessrights}',
+ createauthorizationruleresult = self.cmd('sb namespace authorizationrule create --resource-group {rg} --namespace-name {namespacename} --name {authoname}',
+ checks=[self.check('name', self.kwargs['authoname'])]).output
+
+ # Get Create Authorization Rule
+ getauthorizationruleresult = self.cmd(
+ 'sb namespace authorizationrule get --resource-group {rg} --namespace-name {namespacename} --name {authoname}',
+ checks=[self.check('name', self.kwargs['authoname'])]).output
+
+ # Get Default Authorization Rule
+ getdefaultauthorizationruleresult = self.cmd(
+ 'sb namespace authorizationrule get --resource-group {rg} --namespace-name {namespacename} --name {defaultauthorizationrule}',
+ checks=[self.check('name', self.kwargs['defaultauthorizationrule'])]).output
+
+ # Get Authorization Rule Listkeys
+ authorizationrulelistkeysresult = self.cmd(
+ 'sb namespace authorizationrule listkeys --resource-group {rg} --namespace-name {namespacename} --name {authoname}').output
+
+ # Regeneratekeys - Primary
+ regenrateprimarykeyresult = self.cmd(
+ 'sb namespace authorizationrule regeneratekeys --resource-group {rg} --namespace-name {namespacename} --name {authoname} --regeneratekey {primary}').output
+ self.assertIsNotNone(regenrateprimarykeyresult)
+
+ # Regeneratekeys - Secondary
+ regenratesecondarykeyresult = self.cmd(
+ 'sb namespace authorizationrule regeneratekeys --resource-group {rg} --namespace-name {namespacename} --name {authoname} --regeneratekey {secondary}').output
+ self.assertIsNotNone(regenratesecondarykeyresult)
+
+ # Delete AuthorizationRule
+ deleteauthorizationruleresult = self.cmd(
+ 'sb namespace authorizationrule delete --resource-group {rg} --namespace-name {namespacename} --name {authoname}').output
+
+ # Delete Namespace list by ResourceGroup
+ self.cmd('sb namespace delete --resource-group {rg} --name {namespacename}')
+
+
+
diff --git a/src/servicebus/setup.cfg b/src/servicebus/setup.cfg
new file mode 100644
index 00000000000..3c6e79cf31d
--- /dev/null
+++ b/src/servicebus/setup.cfg
@@ -0,0 +1,2 @@
+[bdist_wheel]
+universal=1
diff --git a/src/servicebus/setup.py b/src/servicebus/setup.py
new file mode 100644
index 00000000000..7ef415ee570
--- /dev/null
+++ b/src/servicebus/setup.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+from codecs import open
+from setuptools import setup, find_packages
+
+VERSION = "0.0.4"
+
+CLASSIFIERS = [
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: System Administrators',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'License :: OSI Approved :: MIT License',
+]
+
+DEPENDENCIES = [
+ 'isodate==0.6.0',
+ 'msrest==0.4.22'
+]
+
+setup(
+ name='servicebus-extension',
+ version=VERSION,
+ description='An Azure CLI Extension that copies images from region to region.',
+ long_description='An Azure CLI Extension that copies images from region to region.',
+ license='MIT',
+ author='Ajit Navasare',
+ author_email='v-ajnava@microsoft.com',
+ url='https://github.com/Azure/azure-cli-extensions',
+ classifiers=CLASSIFIERS,
+ packages=find_packages(),
+ install_requires=DEPENDENCIES
+)