diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index b349363eb8a..5c44db92fca 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -3,3 +3,5 @@
/src/index.json @derekbekoe
/src/image-copy/ @tamirkamara
+
+/src/servicebus/ @v-ajnava
diff --git a/.gitignore b/.gitignore
index e0c2b3809cc..a7eda3dfd26 100644
--- a/.gitignore
+++ b/.gitignore
@@ -103,3 +103,6 @@ ENV/
# mypy
.mypy_cache/
+
+# idea
+.idea/
diff --git a/src/image-copy/setup.py b/src/image-copy/setup.py
index 1412b91fe0b..b381f4de2e1 100644
--- a/src/image-copy/setup.py
+++ b/src/image-copy/setup.py
@@ -8,7 +8,7 @@
from codecs import open
from setuptools import setup, find_packages
-VERSION = "0.0.4"
+VERSION = "0.0.1"
CLASSIFIERS = [
'Development Status :: 4 - Beta',
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..3bcfb63e59a
--- /dev/null
+++ b/src/servicebus/.idea/workspace.xml
@@ -0,0 +1,533 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ accessrights
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1513651875586
+
+
+ 1513651875586
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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..ed2dd2cdb35
--- /dev/null
+++ b/src/servicebus/azext_servicebus/__init__.py
@@ -0,0 +1,35 @@
+# --------------------------------------------------------------------------------------------
+# 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
+
+# pylint: disable=unused-import
+
+
+class ServicebusCommandsLoader(AzCommandsLoader):
+
+ def __init__(self, cli_ctx=None):
+ from azure.cli.core.commands import CliCommandType
+ servicebus_custom = CliCommandType(operations_tmpl='azext_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 azext_servicebus.commands import load_command_table
+ load_command_table(self, args)
+ return self.command_table
+
+ def load_arguments(self, command):
+ from azext_servicebus._params import load_arguments_namespace, load_arguments_queue, load_arguments_topic,\
+ load_arguments_subscription, load_arguments_rule, load_arguments_geodr
+ load_arguments_namespace(self, command)
+ load_arguments_queue(self, command)
+ load_arguments_topic(self, command)
+ load_arguments_subscription(self, command)
+ load_arguments_rule(self, command)
+ load_arguments_geodr(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..f6c7bc985f2
--- /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 azext_servicebus.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/_help.py b/src/servicebus/azext_servicebus/_help.py
new file mode 100644
index 00000000000..c98cc265b6c
--- /dev/null
+++ b/src/servicebus/azext_servicebus/_help.py
@@ -0,0 +1,497 @@
+# --------------------------------------------------------------------------------------------
+# 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['sb'] = """
+ type: group
+ short-summary: Manage Azure ServiceBus namespace, queue, topic, subscription, rule and alias (Disaster Recovery Configuration)
+
+ """
+
+helps['sb namespace'] = """
+ type: group
+ short-summary: Manage Azure ServiceBus namespace and authorization-rule
+
+ """
+
+helps['sb queue'] = """
+ type: group
+ short-summary: Manage Azure ServiceBus queue and authorization-rule
+
+ """
+
+helps['sb topic'] = """
+ type: group
+ short-summary: Manage Azure ServiceBus topic and authorization-rule
+
+ """
+
+helps['sb subscription'] = """
+ type: group
+ short-summary: Manage Azure ServiceBus Subscription
+
+ """
+
+helps['sb rule'] = """
+ type: group
+ short-summary: Manage Azure ServiceBus rule
+
+ """
+
+helps['sb alias'] = """
+ type: group
+ short-summary: Manage Azure ServiceBus Alias (Disaster Recovery Configuration)
+
+ """
+
+helps['sb namespace check-name-availability'] = """
+ type: command
+ short-summary: check for the availability of the given name for the Namespace
+ examples:
+ - name: Create a new topic.
+ text: az sb namespace check_name_availability --name mynamespace
+
+ """
+
+helps['sb namespace create'] = """
+ type: command
+ short-summary: Creates the ServiceBus Namespace
+ examples:
+ - name: Create a new namespace.
+ text: helps['az sb namespace create --resource-group myresourcegroup --name mynamespace --location westus
+ --tags ['tag1: value1', 'tag2: value2'] --sku-name Standard --sku-tier Standard']
+
+ """
+
+helps['sb namespace show'] = """
+ type: command
+ short-summary: shows the Namespace Details
+ examples:
+ - name: shows the Namespace details.
+ text: helps['az sb namespace show --resource-group myresourcegroup --name mynamespace']
+
+ """
+
+helps['sb namespace list'] = """
+ type: command
+ short-summary: List the Namespaces by ResourceGroup or By subscription
+ examples:
+ - name: Get the Namespaces by resource Group.
+ text: helps['az sb namespace list --resource-group myresourcegroup']
+ - name: Get the Namespaces by Subscription.
+ text: helps['az sb namespace list']
+
+ """
+
+helps['sb namespace delete'] = """
+ type: command
+ short-summary: Deletes the Namespaces
+ examples:
+ - name: Deletes the Namespace
+ text: helps['az sb namespace delete --resource-group myresourcegroup --name mynamespace']
+
+ """
+
+helps['sb namespace authorizationrule create'] = """
+ type: command
+ short-summary: Creates Authorization rule for the given Namespace
+ examples:
+ - name: Creates Authorization rules
+ text: helps['az sb namespace authorizationrule create --resource-group myresourcegroup --namespace-name mynamespace
+ --name myauthorule --access-rights [Send, Listen]']
+
+ """
+
+helps['sb namespace authorizationrule get'] = """
+ type: command
+ short-summary: Shows the details of AuthorizatioRule
+ examples:
+ - name: Shows the details of AuthorizatioRule
+ text: helps['az sb namespace authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace
+ --name myauthorule']
+
+ """
+
+helps['sb namespace authorizationrule list'] = """
+ type: command
+ short-summary: Shows the list of AuthorizatioRule by Namespace
+ examples:
+ - name: Shows the list of AuthorizatioRule by Namespace
+ text: helps['az sb namespace authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace']
+
+ """
+
+helps['sb namespace authorizationrule list-keys'] = """
+ type: command
+ short-summary: Shows the connectionstrings of AuthorizatioRule for the namespace
+ examples:
+ - name: Shows the connectionstrings of AuthorizatioRule for the namespace.
+ text: helps['az sb namespace authorizationrule list-keys --resource-group myresourcegroup --namespace-name mynamespace
+ --name myauthorule']
+
+ """
+
+helps['sb namespace authorizationrule regenerate-keys'] = """
+ type: command
+ short-summary: Regenerate the connectionstrings of AuthorizatioRule for the namespace.
+ examples:
+ - name: Regenerate the connectionstrings of AuthorizatioRule for the namespace.
+ text: helps['az sb namespace authorizationrule regenerate-keys --resource-group myresourcegroup
+ --namespace-name mynamespace --name myauthorule --key PrimaryKey']
+
+ """
+
+helps['sb namespace authorizationrule delete'] = """
+ type: command
+ short-summary: Deletes the AuthorizatioRule of the namespace.
+ examples:
+ - name: Deletes the AuthorizatioRule of the namespace.
+ text: helps['az sb namespace authorizationrule delete --resource-group myresourcegroup --namespace-name mynamespace
+ --name myauthorule']
+
+ """
+
+helps['sb queue create'] = """
+ type: command
+ short-summary: Creates the ServiceBus Queue
+ examples:
+ - name: Create a new queue.
+ text: helps['az sb queue create --resource-group myresourcegroup --namespace-name mynamespace --name myqueue']
+
+ """
+
+helps['sb queue show'] = """
+ type: command
+ short-summary: shows the Queue Details
+ examples:
+ - name: Shows the Queue details.
+ text: helps['az sb queue show --resource-group myresourcegroup --namespace-name mynamespace --name myqueue']
+
+ """
+
+helps['sb queue list'] = """
+ type: command
+ short-summary: List the Queueby Namepsace
+ examples:
+ - name: Get the Queues by Namespace.
+ text: helps['az sb queue list --resource-group myresourcegroup --namespace-name mynamespace']
+
+ """
+
+helps['sb queue delete'] = """
+ type: command
+ short-summary: Deletes the Queue
+ examples:
+ - name: Deletes the queue
+ text: helps['az sb queue delete --resource-group myresourcegroup --namespace-name mynamespace --name myqueue']
+
+ """
+
+helps['sb queue authorizationrule create'] = """
+ type: command
+ short-summary: Creates Authorization rule for the given Queue
+ examples:
+ - name: Creates Authorization rules
+ text: helps['az sb queue authorizationrule create --resource-group myresourcegroup --namespace-name mynamespace
+ --queue-name myqueue
+ --name myauthorule --access-rights [Listen]']
+
+ """
+
+helps['sb queue authorizationrule show'] = """
+ type: command
+ short-summary: shows the details of AuthorizatioRule
+ examples:
+ - name: shows the details of AuthorizatioRule
+ text: helps['az sb queue authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace
+ --queue-name myqueue
+ --name myauthorule']
+
+ """
+
+helps['sb queue authorizationrule list'] = """
+ type: command
+ short-summary: shows the list of AuthorizatioRule by Queue
+ examples:
+ - name: shows the list of AuthorizatioRule by Queue
+ text: helps['az sb queue authorizationrule show --resource-group myresourcegroup --namespace-name mynamespace
+ --queue-name myqueue']
+
+ """
+
+helps['sb queue authorizationrule list-keys'] = """
+ type: command
+ short-summary: Shows the connectionstrings of AuthorizatioRule for the Queue.
+ examples:
+ - name: Shows the connectionstrings of AuthorizatioRule for the queue.
+ text: helps['az sb queue authorizationrule list-keys --resource-group myresourcegroup --namespace-name mynamespace
+ --queue-name myqueue
+ --name myauthorule']
+
+ """
+
+helps['sb queue authorizationrule regenerate-keys'] = """
+ type: command
+ short-summary: Regenerate the connectionstrings of AuthorizatioRule for the namespace.
+ examples:
+ - name: Regenerate the connectionstrings of AuthorizatioRule for the namespace.
+ text: helps['az sb queue authorizationrule regenerate-keys --resource-group myresourcegroup --namespace-name mynamespace
+ --queue-name myqueue
+ --name myauthorule --key PrimaryKey']
+
+ """
+
+helps['sb queue authorizationrule delete'] = """
+ type: command
+ short-summary: Deletes the AuthorizatioRule of the Queue.
+ examples:
+ - name: Deletes the AuthorizatioRule of the queue.
+ text: helps['az sb queue authorizationrule delete --resource-group myresourcegroup --namespace-name mynamespace
+ --queue-name myqueue
+ --name myauthorule']
+
+ """
+
+helps['sb topic create'] = """
+ type: command
+ short-summary: Creates the ServiceBus Topic
+ examples:
+ - name: Create a new queue.
+ text: helps['az sb topic create --resource-group myresourcegroup --namespace-name mynamespace --name {topicname}']
+
+ """
+
+helps['sb topic show'] = """
+ type: command
+ short-summary: Shows the Topic Details
+ examples:
+ - name: Shows the Topic details.
+ text: helps['az sb topic get --resource-group myresourcegroup --namespace-name mynamespace --name {topicname}']
+
+ """
+
+helps['sb topic list'] = """
+ type: command
+ short-summary: List the Topic by Namepsace
+ examples:
+ - name: Get the Topics by Namespace.
+ text: helps['az sb topic list --resource-group myresourcegroup --namespace-name mynamespace']
+
+ """
+
+helps['sb topic delete'] = """
+ type: command
+ short-summary: Deletes the Topic
+ examples:
+ - name: Deletes the topic
+ text: helps['az sb topic delete --resource-group myresourcegroup --namespace-name mynamespace --name {topicname}']
+
+ """
+
+helps['sb topic authorizationrule create'] = """
+ type: command
+ short-summary: Creates Authorization rule for the given Topic
+ examples:
+ - name: Creates Authorization rules
+ text: helps['az sb topic authorizationrule create --resource-group myresourcegroup --namespace-name mynamespace
+ --topic-name {topicname} --name myauthorule --access-rights [Send, Listen]']
+
+ """
+
+helps['sb topic authorizationrule show'] = """
+ type: command
+ short-summary: Shows the details of AuthorizatioRule
+ examples:
+ - name: Shows the details of AuthorizatioRule
+ text: helps['az sb topic authorizationrule get --resource-group myresourcegroup --namespace-name mynamespace
+ --topic-name {topicname}
+ --name myauthorule']
+
+ """
+
+helps['sb topic authorizationrule list'] = """
+ type: command
+ short-summary: Gets the list of AuthorizatioRule by Topic
+ examples:
+ - name: Gets the list of AuthorizatioRule by Topic
+ text: helps['az sb topic authorizationrule get --resource-group myresourcegroup --namespace-name mynamespace
+ --topic-name {topicname}']
+
+ """
+
+helps['sb topic authorizationrule list-keys'] = """
+ type: command
+ short-summary: shows the connectionstrings of AuthorizatioRule for the Topic.
+ examples:
+ - name: Gets the connectionstrings of AuthorizatioRule for the topic.
+ text: helps['az sb topic authorizationrule listkeys --resource-group myresourcegroup --namespace-name mynamespace
+ --topic-name {topicname}
+ --name myauthorule']
+
+ """
+
+helps['sb topic authorizationrule regenerate-keys'] = """
+ type: command
+ short-summary: Regenerate the connectionstrings of AuthorizatioRule for the Topic.
+ examples:
+ - name: Regenerate the connectionstrings of AuthorizatioRule for the Topic.
+ text: helps['az sb topic authorizationrule regenerate_keys --resource-group myresourcegroup --namespace-name mynamespace
+ --topic-name {topicname}
+ --name myauthorule --regeneratekey PrimaryKey']
+
+ """
+
+helps['sb topic authorizationrule delete'] = """
+ type: command
+ short-summary: Deletes the AuthorizatioRule of the Topic.
+ examples:
+ - name: Deletes the AuthorizatioRule of the topic
+ text: helps['az sb topic authorizationrule delete --resource-group myresourcegroup --namespace-name mynamespace
+ --topic-name {topicname}
+ --name myauthorule']
+
+ """
+helps['sb subscription create'] = """
+ type: command
+ short-summary: Creates the ServiceBus Subscription
+ examples:
+ - name: Create a new Subscription.
+ text: helps['az sb subscription create --resource-group myresourcegroup --namespace-name mynamespace
+ --topic-name {topicname} --name {subscriptionname}']
+
+ """
+
+helps['sb subscription show'] = """
+ type: command
+ short-summary: Shows the Subscription Details
+ examples:
+ - name: Shows the Subscription details.
+ text: helps['az sb subscription get --resource-group myresourcegroup --namespace-name mynamespace
+ --topic-name {topicname} --name {subscriptionname}']
+
+ """
+
+helps['sb subscription list'] = """
+ type: command
+ short-summary: List the Subscription by Topic
+ examples:
+ - name: Shows the Subscription by Topic.
+ text: helps['az sb subscription list --resource-group myresourcegroup --namespace-name mynamespace']
+
+ """
+
+helps['sb subscription delete'] = """
+ type: command
+ short-summary: Deletes the Subscription
+ examples:
+ - name: Deletes the Subscription
+ text: helps['az sb subscription delete --resource-group myresourcegroup --namespace-name mynamespace
+ --topic-name {topicname} --name {subscriptionname}']
+
+ """
+
+helps['sb rule create'] = """
+ type: command
+ short-summary: Creates the ServiceBus Rule for Subscription
+ examples:
+ - name: Create a new Rule.
+ text: helps['az sb rule create --resource-group myresourcegroup --namespace-name mynamespace --topic-name {topicname}
+ --subscription-name {subscriptionname} --name {rulename} --filter-sql-expression {sqlexpression}']
+
+ """
+
+helps['sb rule show'] = """
+ type: command
+ short-summary: Shows the Rule Details
+ examples:
+ - name: Shows the Rule details.
+ text: helps['az sb rule show --resource-group myresourcegroup --namespace-name mynamespace --topic-name {topicname}
+ --subscription-name {subscriptionname} --name {rulename}']
+
+ """
+
+helps['sb rule list'] = """
+ type: command
+ short-summary: List the Rule by Subscription
+ examples:
+ - name: Shows the Rule by Subscription.
+ text: helps['az sb rule list --resource-group myresourcegroup --namespace-name mynamespace
+ --subscription-name {subscriptionname}']
+
+ """
+
+helps['sb rule delete'] = """
+ type: command
+ short-summary: Deletes the Rule
+ examples:
+ - name: Deletes the Rule
+ text: helps['az sb rule delete --resource-group myresourcegroup --namespace-name mynamespace --topic-name {topicname}
+ --subscription-name {subscriptionname} --name {rulename}']
+
+ """
+
+helps['sb alias check_name_availability'] = """
+ type: command
+ short-summary: Check the availability of the Alias (Geo DR Configuration) Name
+ examples:
+ - name: Check the availability of the Alias (Geo DR Configuration) Name
+ text: helps['az sb alias check_name_availability --resource-group myresourcegroup --namespace-name primarynamespace
+ --alias myaliasname']
+
+ """
+
+helps['sb alias create'] = """
+ type: command
+ short-summary: Creats Alias (Geo DR Configuration) for the give Namespace
+ examples:
+ - name: Creats Alias (Geo DR Configuration) for the give Namespace
+ text: helps['az sb alias create --resource-group myresourcegroup --namespace-name primarynamespace
+ --alias myaliasname --partner-namespace {id}']
+
+ """
+
+helps['sb alias show'] = """
+ type: command
+ short-summary: shows details of Alias (Geo DR Configuration) for Primay/Secondary Namespace
+ examples:
+ - name: show details of Alias (Geo DR Configuration) of the Primary Namespace
+ text: helps['az sb alias show --resource-group myresourcegroup --namespace-name primarynamespace
+ --alias myaliasname']
+ - name: Get details of Alias (Geo DR Configuration) of the Secondary Namespace
+ text: helps['az sb alias show --resource-group myresourcegroup --namespace-name secondarynamespace
+ --alias myaliasname']
+
+ """
+
+helps['sb alias break-pairing'] = """
+ type: command
+ short-summary: Disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces
+ examples:
+ - name: Disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces
+ text: helps['az sb alias break-pairing --resource-group myresourcegroup --namespace-name primarynamespace
+ --alias myaliasname']
+
+ """
+
+helps['sb alias fail-over'] = """
+ type: command
+ short-summary: Envokes GEO DR failover and reconfigure the alias to point to the secondary namespace
+ examples:
+ - name: Envokes GEO DR failover and reconfigure the alias to point to the secondary namespace
+ text: helps['az sb alias fail-over --resource-group myresourcegroup --namespace-name secondarynamespace
+ --alias myaliasname']
+
+ """
+
+helps['sb alias delete'] = """
+ type: command
+ short-summary: Delete Alias(Disaster Recovery configuration) request accepted
+ examples:
+ - name: Delete Alias(Disaster Recovery configuration) request accepted
+ text: helps['az sb alias delete --resource-group myresourcegroup --namespace-name secondarynamespace
+ --alias myaliasname']
+
+ """
diff --git a/src/servicebus/azext_servicebus/_params.py b/src/servicebus/azext_servicebus/_params.py
new file mode 100644
index 00000000000..06bbdea94b8
--- /dev/null
+++ b/src/servicebus/azext_servicebus/_params.py
@@ -0,0 +1,357 @@
+# --------------------------------------------------------------------------------------------
+# 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 (tags_type, get_enum_type, resource_group_name_type, name_type)
+
+from azext_servicebus._validators import _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_namespace(self, _):
+ with self.argument_context('sb namespace check-name-availability') as c:
+ c.argument('namespace_name', options_list=['--name'], 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)
+ c.argument('namespace_name', options_list=['--name'], 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']))
+ c.argument('location', options_list=['--location', '-l'], help='Location')
+ c.argument('skutier', options_list=['--sku-tier'], arg_type=get_enum_type(['Basic', 'Standard', 'Premium']))
+ c.argument('capacity', options_list=['--capacity'], help='Capacity for Sku')
+
+ # region Namespace Get
+ for scope in ['sb namespace show', 'sb namespace delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type)
+ c.argument('namespace_name', options_list=['--name', '-n'], 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)
+
+ # region Namespace Authorizationrule
+ with self.argument_context('sb namespace authorizationrule') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type,)
+ c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace')
+ c.argument('authorization_rule_name', options_list=['--name'], help='name of the Namespace AuthorizationRule')
+
+ with self.argument_context('sb namespace authorizationrule create') as c:
+ c.argument('accessrights', options_list=['--access-rights'],
+ help='Authorization rule rights of type list, allowed values are Send, Listen or Manage')
+
+ with self.argument_context('sb namespace authorizationrule regenerate-keys') as c:
+ c.argument('key_type', options_list=['--key-name'], arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey']))
+
+
+def load_arguments_queue(self, _):
+ # 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,
+ choices=[1024, 2048, 3072, 4096, 5120],
+ 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'], action='store_true',
+ help='A boolean value indicating if this queue requires duplicate detection.')
+ c.argument('requires_session', options_list=['--requires-session'], action='store_true',
+ 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'],
+ action='store_true',
+ 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'], type=int,
+ 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'],
+ action='store_true',
+ 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'], action='store_true',
+ 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 show', 'sb queue delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type)
+ c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace')
+ c.argument('queue_name', options_list=['--name', '-n'], 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)
+ c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace')
+
+ # region Queue Authorizationrule
+ with self.argument_context('sb queue authorizationrule') as c:
+ c.argument('authorization_rule_name', options_list=['--name'], help='name of the Queue AuthorizationRule')
+ c.argument('namespace', options_list=['--namespace-name'], help='name of the Namespace')
+ c.argument('queuename', options_list=['--queue-name'], help='name of the Queue')
+
+ with self.argument_context('sb queue authorizationrule create') as c:
+ c.argument('accessrights', options_list=['--access-rights'], help='Authorization rule rights of type list, allowed values are Send, Listen or Manage')
+
+ with self.argument_context('sb queue authorizationrule regenerate-keys') as c:
+ c.argument('key_type', options_list=['--key-name'], arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey']))
+
+
+# - Queue Region
+def load_arguments_topic(self, _):
+ # 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'],
+ choices=[1024, 2048, 3072, 4096, 5120],
+ 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'],
+ action='store_true', 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'], action='store_true',
+ 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'], action='store_true',
+ 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'],
+ action='store_true',
+ help='Value that indicates whether the topic to be partitioned across multiple message brokers is'
+ ' enabled.')
+ c.argument('enable_express', options_list=['--enable-express'],
+ action='store_true',
+ 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 show', 'sb topic delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type)
+ c.argument('namespace_name', options_list=['--namespace-name'],
+ 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)
+ c.argument('namespace_name', options_list=['--namespace-name', '-n'],
+ help='name of the Namespace')
+
+ # region Topic Authorizationrule
+ with self.argument_context('sb topic authorizationrule') as c:
+ c.argument('authorization_rule_name', options_list=['--name'], help='name of the Topic AuthorizationRule')
+ c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace')
+ c.argument('topic_name', options_list=['--topic-name'], help='name of the Topic')
+
+ with self.argument_context('sb topic authorizationrule create') as c:
+ c.argument('accessrights', options_list=['--access-rights'], help='Authorization rule rights of type list, allowed values are Send, Listen or Manage')
+
+ with self.argument_context('sb topic authorizationrule regenerate-keys') as c:
+ c.argument('key_type', options_list=['--key-name'], arg_type=get_enum_type(['PrimaryKey', 'SecondaryKey']))
+
+
+# Subscription Region
+def load_arguments_subscription(self, _):
+ # region - Subscription Create
+ with self.argument_context('sb subscription create') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type)
+ c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace')
+ c.argument('topic_name', options_list=['--topic-name'], help='Topic Name')
+ c.argument('subscription_name', options_list=['--name'], 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'], action='store_true',
+ 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'],
+ action='store_true',
+ 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'],
+ type=int, 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']))
+ c.argument('enable_batched_operations', action='store_true',
+ 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 show', 'sb subscription delete']:
+ with self.argument_context(scope) as c:
+ c.argument('namespacename', options_list=['--namespace-name'], 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'], help='name of the Namespace')
+ c.argument('topic_name', options_list=['--topic-name'], help='name of the Topic')
+
+
+# ### Region Subscription Rules
+
+
+# Rules Create
+
+def load_arguments_rule(self, _):
+ with self.argument_context('sb rule create') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type)
+ c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace')
+ c.argument('topic_name', options_list=['--topic-name'], help='Topic Name')
+ c.argument('subscription_name', options_list=['--subscription-name'], help='Subscription Name')
+ c.argument('rule_name', options_list=['--name', '-n'], 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', action='store_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', action='store_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='Session identifier')
+ 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', action='store_true',
+ options_list=['--requires-preprocessing'],
+ help='Value that indicates whether the rule action requires preprocessing.')
+
+ for scope in ['sb rule show', 'sb rule delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type)
+ c.argument('namespace_name', options_list=['--namespace-name'],
+ help='name of the Namespace')
+ c.argument('topic_name', options_list=['--topic-name'], help='Topic Name')
+ c.argument('subscription_name', options_list=['--subscription-name'],
+ help='Subscription Name')
+ c.argument('rule_name', options_list=['--name'], help='Rule Name')
+
+ with self.argument_context('sb rules list') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type)
+ c.argument('namespace_name', options_list=['--namespace-name'],
+ help='name of the Namespace')
+ c.argument('topic_name', options_list=['--topic-name'], help='Topic Name')
+ c.argument('subscription_name', options_list=['--subscription-name'],
+ help='Subscription Name')
+
+
+# # # # Geo DR - Disaster Recovery Configs - Alias : Region
+
+def load_arguments_geodr(self, _):
+ with self.argument_context('sb alias check-name-availability') as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type)
+ c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace')
+ c.argument('name', options_list=['--name'],
+ 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)
+ c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace')
+ c.argument('alias', options_list=['--alias'], help='Name of the Alias (Disaster Recovery)')
+ c.argument('partner_namespace', options_list=['--partner-namespace'],
+ help='ARM Id of the Primary/Secondary eventhub namespace name, which is part of'
+ ' GEO DR pairing')
+ c.argument('alternate_name', options_list=['--alternate-name'],
+ help='Alternate Name for the Alias, when the Namespace name and Alias name are same')
+
+ for scope in ['sb alias show', 'sb alias delete']:
+ with self.argument_context(scope) as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type)
+ c.argument('namespace_name', options_list=['--namespace-name'], help='name of the Namespace')
+ c.argument('alias', options_list=['--alias'], 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)
+ c.argument('namespace_name', options_list=['--namespace-name'], 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)
+ c.argument('namespace_name', options_list=['--namespace-name'],
+ help='name of the Namespace')
+ c.argument('alias', options_list=['--alias'],
+ help='Name of the Alias (Disaster Recovery)')
+
+ for scope in ['sb alias show-authorization-rule', 'sb alias list-keys']:
+ with self.argument_context(scope)as c:
+ c.argument('resource_group_name', arg_type=resource_group_name_type)
+ c.argument('namespace_name', options_list=['--namespace-name'],
+ help='name of the Namespace')
+ c.argument('alias', options_list=['--alias'],
+ help='Name of the Alias (Disaster Recovery)')
+ c.argument('authorization_rule_name', 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..f02f76bfa36
--- /dev/null
+++ b/src/servicebus/azext_servicebus/_utils.py
@@ -0,0 +1,18 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+from azext_servicebus.servicebus.models.service_bus_management_client_enums import AccessRights
+
+
+def accessrights_converter(accessrights):
+ accessrights_new = []
+ if accessrights == 'Send':
+ accessrights_new.append(AccessRights.send)
+ if accessrights == 'Manage':
+ accessrights_new.append(AccessRights.manage)
+ if accessrights == 'Listen':
+ accessrights_new.append(AccessRights.listen)
+
+ return accessrights_new
diff --git a/src/servicebus/azext_servicebus/_validators.py b/src/servicebus/azext_servicebus/_validators.py
new file mode 100644
index 00000000000..9aa958d78b2
--- /dev/null
+++ b/src/servicebus/azext_servicebus/_validators.py
@@ -0,0 +1,39 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+import re
+
+from knack.util import CLIError
+
+# PARAMETER VALIDATORS
+# 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 and 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 and 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 and 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 and 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..cd3a332b2ba
--- /dev/null
+++ b/src/servicebus/azext_servicebus/commands.py
@@ -0,0 +1,127 @@
+# --------------------------------------------------------------------------------------------
+# 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
+# pylint: disable=too-many-statements
+
+from azure.cli.core.commands import CliCommandType
+from azext_servicebus._client_factory import (namespaces_mgmt_client_factory,
+ queues_mgmt_client_factory,
+ topics_mgmt_client_factory,
+ subscriptions_mgmt_client_factory,
+ rules_mgmt_client_factory,
+ disaster_recovery_mgmt_client_factory,)
+
+
+def load_command_table(self, _):
+
+ sb_namespace_util = CliCommandType(
+ operations_tmpl='azext_servicebus.servicebus.operations.namespaces_operations#NamespacesOperations.{}',
+ client_factory=namespaces_mgmt_client_factory,
+ client_arg_name='self'
+ )
+
+ sb_queue_util = CliCommandType(
+ operations_tmpl='azext_servicebus.servicebus.operations.queues_operations#QueuesOperations.{}',
+ client_factory=queues_mgmt_client_factory,
+ client_arg_name='self'
+ )
+
+ sb_topic_util = CliCommandType(
+ operations_tmpl='azext_servicebus.servicebus.operations.topics_operations#TopicsOperations.{}',
+ client_factory=topics_mgmt_client_factory,
+ client_arg_name='self'
+ )
+
+ sb_subscriptions_util = CliCommandType(
+ operations_tmpl='azext_servicebus.servicebus.operations.subscriptions_operations#SubscriptionsOperations.{}',
+ client_factory=subscriptions_mgmt_client_factory,
+ client_arg_name='self'
+ )
+
+ sb_rule_util = CliCommandType(
+ operations_tmpl='azext_servicebus.servicebus.operations.rules_operations#RulesOperations.{}',
+ client_factory=rules_mgmt_client_factory,
+ client_arg_name='self'
+ )
+
+ sb_geodr_util = CliCommandType(
+ operations_tmpl='azext_servicebus.servicebus.operations.disaster_recovery_configs_operations#DisasterRecoveryConfigsOperations.{}',
+ client_factory=disaster_recovery_mgmt_client_factory,
+ client_arg_name='self'
+ )
+
+# Namespace Region
+ with self.command_group('sb namespace', sb_namespace_util, client_factory=namespaces_mgmt_client_factory) as g:
+ g.custom_command('create', 'cli_namespace_create')
+ g.command('show', '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, client_factory=namespaces_mgmt_client_factory) as g:
+ g.custom_command('create', 'cli_namespaceautho_create',)
+ g.command('show', 'get_authorization_rule')
+ g.command('list', 'list_authorization_rules')
+ g.command('list-keys', 'list_keys')
+ g.command('regenerate-keys', 'regenerate_keys')
+ g.command('delete', 'delete_authorization_rule')
+
+# Queue Region
+ with self.command_group('sb queue', sb_queue_util, client_factory=queues_mgmt_client_factory) as g:
+ g.custom_command('create', 'cli_sbqueue_create')
+ g.command('show', 'get')
+ g.command('list', 'list_by_namespace')
+ g.command('delete', 'delete')
+
+ with self.command_group('sb queue authorizationrule', sb_queue_util, client_factory=queues_mgmt_client_factory) as g:
+ g.custom_command('create', 'cli_sbqueueautho_create',)
+ g.command('show', 'get_authorization_rule')
+ g.command('list', 'list_authorization_rules')
+ g.command('list-keys', 'list_keys')
+ g.command('regenerate-keys', 'regenerate_keys')
+ g.command('delete', 'delete_authorization_rule')
+
+# Topic Region
+ with self.command_group('sb topic', sb_topic_util, client_factory=topics_mgmt_client_factory) as g:
+ g.custom_command('create', 'cli_sbtopic_create')
+ g.command('show', 'get')
+ g.command('list', 'list_by_namespace')
+ g.command('delete', 'delete')
+
+ with self.command_group('sb topic authorizationrule', sb_topic_util, client_factory=topics_mgmt_client_factory) as g:
+ g.custom_command('create', 'cli_sbtopicautho_create')
+ g.command('show', 'get_authorization_rule')
+ g.command('list', 'list_authorization_rules')
+ g.command('list-keys', 'list_keys')
+ g.command('regenerate-keys', 'regenerate_keys')
+ g.command('delete', 'delete_authorization_rule')
+
+# Subscription Region
+ with self.command_group('sb subscription', sb_subscriptions_util, client_factory=subscriptions_mgmt_client_factory) as g:
+ g.custom_command('create', 'cli_sbsubscription_create')
+ g.command('show', 'get')
+ g.command('list', 'list_by_topic')
+ g.command('delete', 'delete')
+
+# Rules Region
+ with self.command_group('sb rule', sb_rule_util, client_factory=rules_mgmt_client_factory) as g:
+ g.custom_command('create', 'cli_rules_create')
+ g.command('show', 'get')
+ g.command('list', 'list_by_subscriptions')
+ g.command('delete', 'delete')
+
+# DisasterRecoveryConfigs Region
+ with self.command_group('sb alias', sb_geodr_util, client_factory=disaster_recovery_mgmt_client_factory) as g:
+ g.command('create', 'create_or_update')
+ g.command('show', '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('show-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..c28c8788c37
--- /dev/null
+++ b/src/servicebus/azext_servicebus/custom.py
@@ -0,0 +1,166 @@
+# --------------------------------------------------------------------------------------------
+# 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
+# pylint: disable=too-many-lines
+
+from azext_servicebus._utils import accessrights_converter
+
+from azext_servicebus.servicebus.models import (SBNamespace, SBSku, SBQueue, SBTopic, SBSubscription, Rule, Action, SqlFilter, CorrelationFilter, ArmDisasterRecovery)
+
+from knack.util import CLIError
+
+
+# Namespace Region
+def cli_namespace_create(client, resource_group_name, namespace_name, location, tags=None, sku='Standard', skutier=None,
+ capacity=None):
+ return client.create_or_update(resource_group_name, namespace_name, SBNamespace(location, tags,
+ SBSku(sku,
+ skutier,
+ capacity)))
+
+
+def cli_namespace_list(client, resource_group_name=None, namespace_name=None):
+ cmd_result = None
+ if resource_group_name and namespace_name:
+ cmd_result = client.get(resource_group_name, namespace_name)
+
+ if resource_group_name and not namespace_name:
+ cmd_result = client.list_by_resource_group(resource_group_name, namespace_name)
+
+ if not resource_group_name and not namespace_name:
+ cmd_result = client.list(resource_group_name, namespace_name)
+
+ if not cmd_result:
+ raise CLIError('--resource-group name required when namespace name is provided')
+
+ return cmd_result
+
+
+# Namespace Authorization rule:
+def cli_namespaceautho_create(client, resource_group_name, namespace_name, name, accessrights=None):
+ return client.create_or_update_authorization_rule(resource_group_name, namespace_name, name,
+ accessrights_converter(accessrights))
+
+
+# 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
+ )
+ return client.create_or_update(resource_group_name, namespace_name, name, queue_params)
+
+
+def cli_sbqueueautho_create(client, resource_group_name, namespace_name, queue_name, name, accessrights=None):
+ return client.create_or_update_authorization_rule(resource_group_name, namespace_name, queue_name, name,
+ accessrights_converter(accessrights))
+
+
+# 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
+ )
+ return client.create_or_update(resource_group_name, namespace_name, name, topic_params)
+
+
+def cli_sbtopicautho_create(client, resource_group_name, namespace_name, topic_name, name, accessrights=None):
+ return client.create_or_update_authorization_rule(resource_group_name, namespace_name, topic_name, name,
+ accessrights_converter(accessrights))
+
+
+# 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
+ )
+
+ return client.create_or_update(resource_group_name, namespace_name, topic_name, name, subscription_params)
+
+
+# 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
+ )
+ return client.create_or_update(resource_group_name, namespace_name, topic_name, subscription_name, name,
+ rules_params)
+
+
+# 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,
+ alternate_name=alternate_name
+ )
+ return client.create_or_update(resource_group_name, namespace_name, alias, dr_params)
diff --git a/src/servicebus/azext_servicebus/servicebus/__init__.py b/src/servicebus/azext_servicebus/servicebus/__init__.py
new file mode 100644
index 00000000000..7e81ffce33f
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/__init__.py
@@ -0,0 +1,17 @@
+# 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..fb0159ed93d
--- /dev/null
+++ b/src/servicebus/azext_servicebus/servicebus/version.py
@@ -0,0 +1,12 @@
+# 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.1.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/latest/test_sb_alias.yaml b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_alias.yaml
new file mode 100644
index 00000000000..81140786a07
--- /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: [group create]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_alias000001?api-version=2017-05-10
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001","name":"cli_test_sb_alias000001","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: ['Thu, 21 Dec 2017 17:24:13 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: [sb namespace check-name-availability]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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: ['Thu, 21 Dec 2017 17:24:14 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: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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-21T17:24:19.56Z","updatedAt":"2017-12-21T17:24:19.56Z","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: ['Thu, 21 Dec 2017 17:24:20 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: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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-21T17:24:19.56Z","updatedAt":"2017-12-21T17:24:19.56Z","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: ['Thu, 21 Dec 2017 17:24: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: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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-21T17:24:19.56Z","updatedAt":"2017-12-21T17:25:07.13Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['710']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:25:20 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: [sb namespace show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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-21T17:24:19.56Z","updatedAt":"2017-12-21T17:25:07.13Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['710']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:25:26 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: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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-21T17:25:26.78Z","updatedAt":"2017-12-21T17:25:26.78Z","serviceBusEndpoint":"https://sb-nscli000003.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['712']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:25:26 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: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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-21T17:25:26.78Z","updatedAt":"2017-12-21T17:25:26.78Z","serviceBusEndpoint":"https://sb-nscli000003.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['712']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:25: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: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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-21T17:25:26.78Z","updatedAt":"2017-12-21T17:26:19.18Z","serviceBusEndpoint":"https://sb-nscli000003.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['710']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:26: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: [sb namespace show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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-21T17:25:26.78Z","updatedAt":"2017-12-21T17:26:19.18Z","serviceBusEndpoint":"https://sb-nscli000003.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['710']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:26: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]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"properties": {"rights": ["Send"]}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace authorizationrule create]
+ Connection: [keep-alive]
+ Content-Length: ['36']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/AuthorizationRules/cliAutho000004","name":"cliAutho000004","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"South
+ Central US","properties":{"rights":["Send"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['407']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:27: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace authorizationrule show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/AuthorizationRules/cliAutho000004","name":"cliAutho000004","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"South
+ Central US","properties":{"rights":["Send"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['407']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:27: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: 'b''{"name": "cliAlias000005"}'''
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb alias check-name-availability]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['Thu, 21 Dec 2017 17:27:08 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_alias000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003"}}\'''''
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb alias create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:27:42 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: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:27:44 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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:27:46 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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:27: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]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:28:21 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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:28:51 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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:29: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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:29: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: [sb alias break-pairing]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['Thu, 21 Dec 2017 17:29: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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:29: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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:30: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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:31: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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:31: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]
+ 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_alias000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003"}}\'''''
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb alias create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:31:51 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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:31: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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:32: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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:32:57 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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:33: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]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:34: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: [sb alias fail-over]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['Thu, 21 Dec 2017 17:34: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:34: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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:34:38 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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:35:08 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: [sb alias show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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_alias000001/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: ['Thu, 21 Dec 2017 17:35:39 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: [sb alias delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['Thu, 21 Dec 2017 17:35:42 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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:36:13 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['1198']
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['Thu, 21 Dec 2017 17:36:41 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['Thu, 21 Dec 2017 17:37:16 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['Thu, 21 Dec 2017 17:37:44 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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000003?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:37:49 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['Thu, 21 Dec 2017 17:38:20 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['Thu, 21 Dec 2017 17:38:53 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_alias000001/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: ['Thu, 21 Dec 2017 17:39:20 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: [group delete]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_alias000001?api-version=2017-05-10
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:39:23 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGU0I6NUZBTElBUzNPVktLNEZXTDVFSlJZQTJLUlo1NzRHMnw1ODMzNTM3QjMyNzAxOThGLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10']
+ pragma: [no-cache]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1197']
+ status: {code: 202, message: Accepted}
+version: 1
diff --git a/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_namespace.yaml b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_namespace.yaml
new file mode 100644
index 00000000000..96607795e4d
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_namespace.yaml
@@ -0,0 +1,513 @@
+interactions:
+- request:
+ body: '{"location": "westus", "tags": {"use": "az-test"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [group create]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ 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: ['Thu, 21 Dec 2017 17:39:25 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: [sb namespace check-name-availability]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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: ['Thu, 21 Dec 2017 17:39: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: '{"location": "westus2", "tags": {"{tag1: value1}": ""}, "sku": {"name":
+ "Standard", "tier": "Standard"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace create]
+ Connection: [keep-alive]
+ Content-Length: ['104']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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":"Standard","tier":"Standard"},"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":"West
+ US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:39:32.12Z","updatedAt":"2017-12-21T17:39:32.12Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['675']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:39:31 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: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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":"Standard","tier":"Standard"},"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":"West
+ US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:39:32.12Z","updatedAt":"2017-12-21T17:40:00.74Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:40: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: [sb namespace show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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":"Standard","tier":"Standard"},"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":"West
+ US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:39:32.12Z","updatedAt":"2017-12-21T17:40:00.74Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['673']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:40: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: [sb namespace list]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceBus/namespaces?api-version=2017-04-01
+ response:
+ body: {string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/eg-hitesh-perf/providers/Microsoft.ServiceBus/namespaces/eventgrid-messaging-ussc","name":"eventgrid-messaging-ussc","type":"Microsoft.ServiceBus/Namespaces","location":"South
+ Central US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:eventgrid-messaging-ussc","createdAt":"2017-05-25T20:37:22.027Z","updatedAt":"2017-05-25T20:37:43.163Z","serviceBusEndpoint":"https://eventgrid-messaging-ussc.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace2wikucfcmbvuggsc2ppty2dv2vwzscqbewalk7utdokze4oe4yko52/providers/Microsoft.ServiceBus/namespaces/sb-nscli2seqdw4o6cpq","name":"sb-nscli2seqdw4o6cpq","type":"Microsoft.ServiceBus/Namespaces","location":"North
+ Central US","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli2seqdw4o6cpq","createdAt":"2017-12-16T04:01:58.05Z","updatedAt":"2017-12-16T05:12:36.983Z","serviceBusEndpoint":"https://sb-nscli2seqdw4o6cpq.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.ServiceBus/namespaces/Test0192837","name":"Test0192837","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ Europe","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:test0192837","createdAt":"2017-05-04T18:53:05.943Z","updatedAt":"2017-08-09T22:00:20.873Z","serviceBusEndpoint":"https://Test0192837.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.ServiceBus/namespaces/TestLocationwithspace1","name":"TestLocationwithspace1","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ Europe","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testlocationwithspace1","createdAt":"2017-05-04T20:34:04.323Z","updatedAt":"2017-08-09T22:02:25.673Z","serviceBusEndpoint":"https://TestLocationwithspace1.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.ServiceBus/namespaces/TestLocationwithspace2","name":"TestLocationwithspace2","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ Europe","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testlocationwithspace2","createdAt":"2017-05-04T20:36:08.073Z","updatedAt":"2017-08-09T22:00:21.593Z","serviceBusEndpoint":"https://TestLocationwithspace2.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.ServiceBus/namespaces/TestLocationwithspace3","name":"TestLocationwithspace3","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ Europe","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testlocationwithspace3","createdAt":"2017-05-04T20:36:00.543Z","updatedAt":"2017-08-09T22:08:00.14Z","serviceBusEndpoint":"https://TestLocationwithspace3.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.ServiceBus/namespaces/TestLocationwithspace4","name":"TestLocationwithspace4","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ Europe","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testlocationwithspace4","createdAt":"2017-05-04T20:36:58.34Z","updatedAt":"2017-08-09T22:02:26.043Z","serviceBusEndpoint":"https://TestLocationwithspace4.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.ServiceBus/namespaces/TestLocationwithspace5","name":"TestLocationwithspace5","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ Europe","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testlocationwithspace5","createdAt":"2017-05-04T20:37:06.06Z","updatedAt":"2017-08-09T22:08:01.373Z","serviceBusEndpoint":"https://TestLocationwithspace5.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespace6n6pvsxu54odomkb2efb756nycx6jdcnw3cuhnqmght2fv4wa4apve/providers/Microsoft.ServiceBus/namespaces/sb-nsclinca5wcqqe6wa","name":"sb-nsclinca5wcqqe6wa","type":"Microsoft.ServiceBus/Namespaces","location":"South
+ Central US","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nsclinca5wcqqe6wa","createdAt":"2017-12-16T05:19:44.58Z","updatedAt":"2017-12-16T05:25:02.837Z","serviceBusEndpoint":"https://sb-nsclinca5wcqqe6wa.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.ServiceBus/namespaces/TestLocationwithspace","name":"TestLocationwithspace","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ Europe","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testlocationwithspace","createdAt":"2017-05-04T20:21:22.583Z","updatedAt":"2017-08-09T22:08:01.91Z","serviceBusEndpoint":"https://TestLocationwithspace.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespaceut5zqyzvptdw5hwkvesugbs6gyxh6ws5bsrmsbt7hee5khp2lgzlix/providers/Microsoft.ServiceBus/namespaces/sb-nsclisrwaze7yfrv3","name":"sb-nsclisrwaze7yfrv3","type":"Microsoft.ServiceBus/Namespaces","location":"North
+ Central US","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nsclisrwaze7yfrv3","createdAt":"2017-12-16T17:28:36.46Z","updatedAt":"2017-12-16T18:40:44.037Z","serviceBusEndpoint":"https://sb-nsclisrwaze7yfrv3.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespacecoxqc6ek6xgxrgdqkgp73ho6sorba6ljkz5mvntqxg2nsbo5pl2fic/providers/Microsoft.ServiceBus/namespaces/sb-nsclioz2khnxxmb4j","name":"sb-nsclioz2khnxxmb4j","type":"Microsoft.ServiceBus/Namespaces","location":"South
+ Central US","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nsclioz2khnxxmb4j","createdAt":"2017-12-16T03:43:43.44Z","updatedAt":"2017-12-16T05:05:22.213Z","serviceBusEndpoint":"https://sb-nsclioz2khnxxmb4j.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDKTests/providers/Microsoft.ServiceBus/namespaces/TestingIgniteNamespace","name":"TestingIgniteNamespace","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingignitenamespace","createdAt":"2017-09-22T22:20:28.183Z","updatedAt":"2017-09-22T22:21:09.17Z","serviceBusEndpoint":"https://TestingIgniteNamespace.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/GridToServiceBusTest/providers/Microsoft.ServiceBus/namespaces/GridToServiceBusTest","name":"GridToServiceBusTest","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:gridtoservicebustest","createdAt":"2017-07-11T00:54:07.86Z","updatedAt":"2017-07-11T00:54:34.707Z","serviceBusEndpoint":"https://GridToServiceBusTest.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespaceokquronxzujxantrhghxnhrv4354fym75veryp23fzp7pix7hba4ib/providers/Microsoft.ServiceBus/namespaces/sb-nscli76spyj2vzwvy","name":"sb-nscli76spyj2vzwvy","type":"Microsoft.ServiceBus/Namespaces","location":"North
+ Central US","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli76spyj2vzwvy","createdAt":"2017-12-16T17:09:08.33Z","updatedAt":"2017-12-16T17:21:20.247Z","serviceBusEndpoint":"https://sb-nscli76spyj2vzwvy.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespacegjlhejieresrpo6enemyd4ihktsmjhn4vofwwdkqjaxbro7ssr5qmp/providers/Microsoft.ServiceBus/namespaces/sb-nsclisooglao2gn6t","name":"sb-nsclisooglao2gn6t","type":"Microsoft.ServiceBus/Namespaces","location":"North
+ Central US","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nsclisooglao2gn6t","createdAt":"2017-12-16T16:43:16.283Z","updatedAt":"2017-12-16T16:57:00.17Z","serviceBusEndpoint":"https://sb-nsclisooglao2gn6t.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"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":"West
+ US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:39:32.12Z","updatedAt":"2017-12-21T17:40:00.74Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.ServiceBus/namespaces/TestingArmSBNamesapce","name":"TestingArmSBNamesapce","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testingarmsbnamesapce","createdAt":"2017-06-08T00:23:24.203Z","updatedAt":"2017-06-08T00:25:28.627Z","serviceBusEndpoint":"https://TestingArmSBNamesapce.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_namespacecoxqc6ek6xgxrgdqkgp73ho6sorba6ljkz5mvntqxg2nsbo5pl2fic/providers/Microsoft.ServiceBus/namespaces/sb-nscli37xlt4h435ro","name":"sb-nscli37xlt4h435ro","type":"Microsoft.ServiceBus/Namespaces","location":"North
+ Central US","tags":{"{tag2: value2,":"","tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli37xlt4h435ro","createdAt":"2017-12-16T03:53:33.89Z","updatedAt":"2017-12-16T05:05:28.283Z","serviceBusEndpoint":"https://sb-nscli37xlt4h435ro.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/EventGridResourceGroup/providers/Microsoft.ServiceBus/namespaces/eventgrid-messaging","name":"eventgrid-messaging","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:eventgrid-messaging","createdAt":"2017-04-26T16:53:28.42Z","updatedAt":"2017-08-25T02:08:28.097Z","serviceBusEndpoint":"https://eventgrid-messaging.servicebus.windows.net:443/","status":"Active"}},{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Storage-WestUS/providers/Microsoft.ServiceBus/namespaces/TestLocationwithoutspace","name":"TestLocationwithoutspace","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ Europe","tags":{},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:testlocationwithoutspace","createdAt":"2017-05-04T20:24:03.43Z","updatedAt":"2017-08-09T22:00:20.7Z","serviceBusEndpoint":"https://TestLocationwithoutspace.servicebus.windows.net:443/","status":"Active"}}]}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['13552']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:40: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: [sb namespace list]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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?api-version=2017-04-01
+ response:
+ body: {string: '{"value":[{"sku":{"name":"Standard","tier":"Standard"},"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":"West
+ US 2","tags":{"{tag1: value1}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:39:32.12Z","updatedAt":"2017-12-21T17:40:00.74Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}]}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['685']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:40:08 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"]}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace authorizationrule create]
+ Connection: [keep-alive]
+ Content-Length: ['36']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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/cliAutho000003?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/cliAutho000003","name":"cliAutho000003","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"West
+ US 2","properties":{"rights":["Send"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['400']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:40:40 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: [sb namespace authorizationrule show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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/cliAutho000003?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/cliAutho000003","name":"cliAutho000003","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"West
+ US 2","properties":{"rights":["Send"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['400']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:40:42 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: [sb namespace authorizationrule show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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/RootManageSharedAccessKey?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/RootManageSharedAccessKey","name":"RootManageSharedAccessKey","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"West
+ US 2","properties":{"rights":["Listen","Manage","Send"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['428']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:40: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: [sb namespace authorizationrule list-keys]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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/AuthorizationRules/cliAutho000003/listKeys?api-version=2017-04-01
+ response:
+ body: {string: '{"primaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=zbeVkY7OOZgW8b4K2rH3iRG5J9zk1i2QGLsUSayOY5Q=","secondaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=Lhy1KUoLpBHrCQzlYujOHT8QjnhJXSAFblL5MTVTGSQ=","primaryKey":"zbeVkY7OOZgW8b4K2rH3iRG5J9zk1i2QGLsUSayOY5Q=","secondaryKey":"Lhy1KUoLpBHrCQzlYujOHT8QjnhJXSAFblL5MTVTGSQ=","keyName":"cliAutho000003"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['536']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:40:44 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: '{"keyType": "PrimaryKey"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace authorizationrule regenerate-keys]
+ Connection: [keep-alive]
+ Content-Length: ['25']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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/AuthorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01
+ response:
+ body: {string: '{"primaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=iMGbbraWqEpghniYG+qkl5q4zrsMZmP3UDpszFbfz0s=","secondaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=Lhy1KUoLpBHrCQzlYujOHT8QjnhJXSAFblL5MTVTGSQ=","primaryKey":"iMGbbraWqEpghniYG+qkl5q4zrsMZmP3UDpszFbfz0s=","secondaryKey":"Lhy1KUoLpBHrCQzlYujOHT8QjnhJXSAFblL5MTVTGSQ=","keyName":"cliAutho000003"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['536']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:40: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: '{"keyType": "SecondaryKey"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace authorizationrule regenerate-keys]
+ Connection: [keep-alive]
+ Content-Length: ['27']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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/AuthorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01
+ response:
+ body: {string: '{"primaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=iMGbbraWqEpghniYG+qkl5q4zrsMZmP3UDpszFbfz0s=","secondaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=0iQ0Z8NtPVg2g2nY/j2JrZorQlWVCUmqpPrerXQABjw=","primaryKey":"iMGbbraWqEpghniYG+qkl5q4zrsMZmP3UDpszFbfz0s=","secondaryKey":"0iQ0Z8NtPVg2g2nY/j2JrZorQlWVCUmqpPrerXQABjw=","keyName":"cliAutho000003"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['536']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:41:22 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: [sb namespace authorizationrule delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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/AuthorizationRules/cliAutho000003?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:41:38 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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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: ['Thu, 21 Dec 2017 17:41:41 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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ 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: ['Thu, 21 Dec 2017 17:42:12 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: [group delete]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ 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: ['Thu, 21 Dec 2017 17:42:17 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGU0I6NUZOQU1FU1BBQ0VYV09JM1pGT0k2NDVLM1JDSUc0SnxBMjc0NkVCQUU2NEY3QjY3LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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/recordings/latest/test_sb_queue.yaml b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_queue.yaml
new file mode 100644
index 00000000000..f8740a98ca8
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_queue.yaml
@@ -0,0 +1,493 @@
+interactions:
+- request:
+ body: '{"location": "westus", "tags": {"use": "az-test"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [group create]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_queue000001?api-version=2017-05-10
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001","name":"cli_test_sb_queue000001","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: ['Thu, 21 Dec 2017 17:42:19 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: '{"location": "westus2", "tags": {"{tag1: value1,": "", "tag2: value2}":
+ ""}, "sku": {"name": "Standard", "tier": "Standard"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace create]
+ Connection: [keep-alive]
+ Content-Length: ['125']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:42:21.283Z","updatedAt":"2017-12-21T17:42:21.283Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['696']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:42:19 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: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:42:21.283Z","updatedAt":"2017-12-21T17:42:43.617Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['694']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:42: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: [sb namespace show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:42:21.283Z","updatedAt":"2017-12-21T17:42:43.617Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['694']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:42: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: '{"properties": {"autoDeleteOnIdle": "PT10M"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb queue create]
+ Connection: [keep-alive]
+ Content-Length: ['45']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004","name":"sb-queuecli000004","type":"Microsoft.ServiceBus/Namespaces/Queues","location":"West
+ US 2","properties":{"lockDuration":"PT1M","maxSizeInMegabytes":5120,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"PT10M","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2017-12-21T17:42:57.09Z","updatedAt":"2017-12-21T17:42:57.17Z","accessedAt":"0001-01-01T00:00:00"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['1031']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:42: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb queue show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004","name":"sb-queuecli000004","type":"Microsoft.ServiceBus/Namespaces/Queues","location":"West
+ US 2","properties":{"lockDuration":"PT1M","maxSizeInMegabytes":5120,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"PT10M","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2017-12-21T17:42:57.09Z","updatedAt":"2017-12-21T17:42:57.17Z","accessedAt":"0001-01-01T00:00:00Z"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['1032']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:42: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: [sb queue list]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues?api-version=2017-04-01
+ response:
+ body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004","name":"sb-queuecli000004","type":"Microsoft.ServiceBus/Namespaces/Queues","location":"West
+ US 2","properties":{"lockDuration":"PT1M","maxSizeInMegabytes":5120,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"PT10M","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2017-12-21T17:42:57.09Z","updatedAt":"2017-12-21T17:42:57.17Z","accessedAt":"0001-01-01T00:00:00Z"}}]}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['1044']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:43: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]
+ x-ms-inline-count: ['']
+ status: {code: 200, message: OK}
+- request:
+ body: '{"properties": {"rights": ["Listen"]}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb queue authorizationrule create]
+ Connection: [keep-alive]
+ Content-Length: ['38']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004/authorizationRules/cliAutho000003?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004/authorizationRules/cliAutho000003","name":"cliAutho000003","type":"Microsoft.ServiceBus/Namespaces/Queues/AuthorizationRules","location":"West
+ US 2","properties":{"rights":["Listen"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['442']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:43: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb queue authorizationrule show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004/authorizationRules/cliAutho000003?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004/authorizationRules/cliAutho000003","name":"cliAutho000003","type":"Microsoft.ServiceBus/Namespaces/Queues/AuthorizationRules","location":"West
+ US 2","properties":{"rights":["Listen"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['442']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:43: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: [sb queue authorizationrule list-keys]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004/authorizationRules/cliAutho000003/ListKeys?api-version=2017-04-01
+ response:
+ body: {string: '{"primaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=hqcNKyeiL2T8Vj/kObgPiXC/0/E8pDB89uDksacy9+s=;EntityPath=sb-queuecli000004","secondaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=CTtU19EMNMPdCJbPWF9FneZ35NWfBnXxQqL2Mpq3Aoc=;EntityPath=sb-queuecli000004","primaryKey":"hqcNKyeiL2T8Vj/kObgPiXC/0/E8pDB89uDksacy9+s=","secondaryKey":"CTtU19EMNMPdCJbPWF9FneZ35NWfBnXxQqL2Mpq3Aoc=","keyName":"cliAutho000003"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['610']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:43:08 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: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: '{"keyType": "PrimaryKey"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb queue authorizationrule regenerate-keys]
+ Connection: [keep-alive]
+ Content-Length: ['25']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004/authorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01
+ response:
+ body: {string: '{"primaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=XtLVU427mKKWt4KLHVd/qLMhwVVV0dpzx9Ni5gT6GlM=;EntityPath=sb-queuecli000004","secondaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=CTtU19EMNMPdCJbPWF9FneZ35NWfBnXxQqL2Mpq3Aoc=;EntityPath=sb-queuecli000004","primaryKey":"XtLVU427mKKWt4KLHVd/qLMhwVVV0dpzx9Ni5gT6GlM=","secondaryKey":"CTtU19EMNMPdCJbPWF9FneZ35NWfBnXxQqL2Mpq3Aoc=","keyName":"cliAutho000003"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['610']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:43:10 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: ['1197']
+ status: {code: 200, message: OK}
+- request:
+ body: '{"keyType": "SecondaryKey"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb queue authorizationrule regenerate-keys]
+ Connection: [keep-alive]
+ Content-Length: ['27']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004/authorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01
+ response:
+ body: {string: '{"primaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=XtLVU427mKKWt4KLHVd/qLMhwVVV0dpzx9Ni5gT6GlM=;EntityPath=sb-queuecli000004","secondaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=teSICT76A4vOj7/4mP2p2cnRjlJ7L27XEQpOCIKCp6o=;EntityPath=sb-queuecli000004","primaryKey":"XtLVU427mKKWt4KLHVd/qLMhwVVV0dpzx9Ni5gT6GlM=","secondaryKey":"teSICT76A4vOj7/4mP2p2cnRjlJ7L27XEQpOCIKCp6o=","keyName":"cliAutho000003"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['610']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:43:07 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: [sb queue authorizationrule delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004/authorizationRules/cliAutho000003?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:43:12 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: [sb queue delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/queues/sb-queuecli000004?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:43:17 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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:43:14 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/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: ['1198']
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_queue000001/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: ['Thu, 21 Dec 2017 17:43: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]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [group delete]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_queue000001?api-version=2017-05-10
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:43:49 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGU0I6NUZRVUVVRTdXUVVYT1JTSzJHTkJNS0xEWk42T1dGMnw2MkNBNTdDQUVDNDRCRjQ0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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/recordings/latest/test_sb_rules.yaml b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_rules.yaml
new file mode 100644
index 00000000000..10dee0a50b3
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_rules.yaml
@@ -0,0 +1,491 @@
+interactions:
+- request:
+ body: '{"location": "westus", "tags": {"use": "az-test"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [group create]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_rules000001?api-version=2017-05-10
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001","name":"cli_test_sb_rules000001","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: ['Thu, 21 Dec 2017 17:43:52 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: '{"location": "westus2", "tags": {"{tag1: value1,": "", "tag2: value2}":
+ ""}, "sku": {"name": "Standard", "tier": "Standard"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace create]
+ Connection: [keep-alive]
+ Content-Length: ['125']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:44:00.083Z","updatedAt":"2017-12-21T17:44:00.083Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['696']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:43: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: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:44:00.083Z","updatedAt":"2017-12-21T17:44:22.877Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['694']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:44: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: [sb namespace show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:44:00.083Z","updatedAt":"2017-12-21T17:44:22.877Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['694']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:44: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: '{}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic create]
+ Connection: [keep-alive]
+ Content-Length: ['2']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004","name":"sb-topiccli000004","type":"Microsoft.ServiceBus/Namespaces/Topics","location":"West
+ US 2","properties":{"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":5120,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2017-12-21T17:44:35.543Z","updatedAt":"2017-12-21T17:44:35.683Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['1004']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:44: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]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004","name":"sb-topiccli000004","type":"Microsoft.ServiceBus/Namespaces/Topics","location":"West
+ US 2","properties":{"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":5120,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2017-12-21T17:44:35.543Z","updatedAt":"2017-12-21T17:44:35.683Z","accessedAt":"0001-01-01T00:00:00Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['1005']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:44:36 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: '{}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb subscription create]
+ Connection: [keep-alive]
+ Content-Length: ['2']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006","name":"sb-subscli000006","type":"Microsoft.ServiceBus/Namespaces/Topics/Subscriptions","location":"West
+ US 2","properties":{"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2017-12-21T17:44:41.1783334Z","updatedAt":"2017-12-21T17:44:41.1783334Z","accessedAt":"0001-01-01T00:00:00","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['975']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:44:40 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: ['1197']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb subscription show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006","name":"sb-subscli000006","type":"Microsoft.ServiceBus/Namespaces/Topics/Subscriptions","location":"West
+ US 2","properties":{"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2017-12-21T17:44:40.7341376Z","updatedAt":"2017-12-21T17:44:40.7341376Z","accessedAt":"2017-12-21T17:44:40.7341376Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['984']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:44:40 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": {"action": {}, "sqlFilter": {"sqlExpression": "test=test"},
+ "correlationFilter": {}}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb rule create]
+ Connection: [keep-alive]
+ Content-Length: ['100']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006/rules/sb-rulecli000007?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006/rules/sb-rulecli000007","name":"sb-rulecli000007","type":"Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules","location":"West
+ US 2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"test=test","compatibilityLevel":20}}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['563']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:44: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: [sb rule show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006/rules/sb-rulecli000007?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006/rules/sb-rulecli000007","name":"sb-rulecli000007","type":"Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules","location":"West
+ US 2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"test=test","compatibilityLevel":20,"parameters":{}}}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['579']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:44: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]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb rule list]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006/rules?api-version=2017-04-01
+ response:
+ body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006/rules/sb-rulecli000007","name":"sb-rulecli000007","type":"Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules","location":"West
+ US 2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"test=test","compatibilityLevel":20,"parameters":{}}}}]}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['591']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:44: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]
+ x-ms-inline-count: ['']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb rule delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006/rules/sb-rulecli000007?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:44:51 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: ['1197']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb subscription delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:44: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:44: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1197']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:44:54 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/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: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_rules000001/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: ['Thu, 21 Dec 2017 17:45: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]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [group delete]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_rules000001?api-version=2017-05-10
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:45:30 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGU0I6NUZSVUxFU1FKRlEzTkxEQUdTVDJZS1hSUk0yUkZDNnwyNkMxODY2MjhBNEI4ODI0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10']
+ pragma: [no-cache]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ status: {code: 202, message: Accepted}
+version: 1
diff --git a/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_subscription.yaml b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_subscription.yaml
new file mode 100644
index 00000000000..90d87352834
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_subscription.yaml
@@ -0,0 +1,403 @@
+interactions:
+- request:
+ body: '{"location": "westus", "tags": {"use": "az-test"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [group create]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_subscription000001?api-version=2017-05-10
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001","name":"cli_test_sb_subscription000001","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: ['Thu, 21 Dec 2017 17:45:29 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1197']
+ status: {code: 201, message: Created}
+- request:
+ body: '{"location": "westus2", "tags": {"{tag1: value1,": "", "tag2: value2}":
+ ""}, "sku": {"name": "Standard", "tier": "Standard"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace create]
+ Connection: [keep-alive]
+ Content-Length: ['125']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:45:36.693Z","updatedAt":"2017-12-21T17:45:36.693Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['696']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:45:36 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: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:45:36.693Z","updatedAt":"2017-12-21T17:46:00.36Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['693']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:46:06 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: [sb namespace show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:45:36.693Z","updatedAt":"2017-12-21T17:46:00.36Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['693']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:46:07 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: '{}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic create]
+ Connection: [keep-alive]
+ Content-Length: ['2']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004","name":"sb-topiccli000004","type":"Microsoft.ServiceBus/Namespaces/Topics","location":"West
+ US 2","properties":{"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":5120,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2017-12-21T17:46:11.81Z","updatedAt":"2017-12-21T17:46:11.92Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['1002']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:46:10 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: [sb topic show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004","name":"sb-topiccli000004","type":"Microsoft.ServiceBus/Namespaces/Topics","location":"West
+ US 2","properties":{"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":5120,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2017-12-21T17:46:11.81Z","updatedAt":"2017-12-21T17:46:11.92Z","accessedAt":"0001-01-01T00:00:00Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['1003']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:46:16 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: '{}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb subscription create]
+ Connection: [keep-alive]
+ Content-Length: ['2']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006","name":"sb-subscli000006","type":"Microsoft.ServiceBus/Namespaces/Topics/Subscriptions","location":"West
+ US 2","properties":{"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2017-12-21T17:46:18.2007097Z","updatedAt":"2017-12-21T17:46:18.2007097Z","accessedAt":"0001-01-01T00:00:00","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['975']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:46:16 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: [sb subscription show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006","name":"sb-subscli000006","type":"Microsoft.ServiceBus/Namespaces/Topics/Subscriptions","location":"West
+ US 2","properties":{"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2017-12-21T17:46:18.3150261Z","updatedAt":"2017-12-21T17:46:18.3150261Z","accessedAt":"2017-12-21T17:46:18.317Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['980']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:46:17 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: [sb subscription list]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions?api-version=2017-04-01
+ response:
+ body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006","name":"sb-subscli000006","type":"Microsoft.ServiceBus/Namespaces/Topics/Subscriptions","location":"West
+ US 2","properties":{"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2017-12-21T17:46:18.3150261Z","updatedAt":"2017-12-21T17:46:18.3150261Z","accessedAt":"2017-12-21T17:46:18.317Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}]}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['992']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:46: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]
+ x-ms-inline-count: ['']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb subscription delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/subscriptions/sb-subscli000006?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:46: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:46: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:46:25 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/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: ['1198']
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_subscription000001/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: ['Thu, 21 Dec 2017 17:47: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]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [group delete]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_subscription000001?api-version=2017-05-10
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:47:00 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGU0I6NUZTVUJTQ1JJUFRJT05VSkxFNFlYTk01MlBHSjQ1WXwyMURFMTZEQkJCRjk0NDJFLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10']
+ pragma: [no-cache]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1197']
+ status: {code: 202, message: Accepted}
+version: 1
diff --git a/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_topic.yaml b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_topic.yaml
new file mode 100644
index 00000000000..f9221464a4c
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/recordings/latest/test_sb_topic.yaml
@@ -0,0 +1,440 @@
+interactions:
+- request:
+ body: '{"location": "westus", "tags": {"use": "az-test"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [group create]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_topic000001?api-version=2017-05-10
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001","name":"cli_test_sb_topic000001","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: ['Thu, 21 Dec 2017 17:47:01 GMT']
+ expires: ['-1']
+ pragma: [no-cache]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1196']
+ status: {code: 201, message: Created}
+- request:
+ body: '{"location": "westus2", "tags": {"{tag1: value1,": "", "tag2: value2}":
+ ""}, "sku": {"name": "Standard", "tier": "Standard"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace create]
+ Connection: [keep-alive]
+ Content-Length: ['125']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Created","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:47:06.573Z","updatedAt":"2017-12-21T17:47:06.573Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Activating"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['696']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb namespace create]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:47:06.573Z","updatedAt":"2017-12-21T17:47:28.143Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['694']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47:37 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: [sb namespace show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002?api-version=2017-04-01
+ response:
+ body: {string: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002","name":"sb-nscli000002","type":"Microsoft.ServiceBus/Namespaces","location":"West
+ US 2","tags":{"{tag1: value1,":"","tag2: value2}":""},"properties":{"provisioningState":"Succeeded","metricId":"55f3dcd4-cac7-43b4-990b-a139d62a1eb2:sb-nscli000002","createdAt":"2017-12-21T17:47:06.573Z","updatedAt":"2017-12-21T17:47:28.143Z","serviceBusEndpoint":"https://sb-nscli000002.servicebus.windows.net:443/","status":"Active"}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['694']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47:37 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: '{}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic create]
+ Connection: [keep-alive]
+ Content-Length: ['2']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004","name":"sb-topiccli000004","type":"Microsoft.ServiceBus/Namespaces/Topics","location":"West
+ US 2","properties":{"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":5120,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2017-12-21T17:47:42.137Z","updatedAt":"2017-12-21T17:47:42.183Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['1004']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47:42 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: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004","name":"sb-topiccli000004","type":"Microsoft.ServiceBus/Namespaces/Topics","location":"West
+ US 2","properties":{"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":5120,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2017-12-21T17:47:42.137Z","updatedAt":"2017-12-21T17:47:42.183Z","accessedAt":"0001-01-01T00:00:00Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['1005']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47: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]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic list]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics?api-version=2017-04-01
+ response:
+ body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004","name":"sb-topiccli000004","type":"Microsoft.ServiceBus/Namespaces/Topics","location":"West
+ US 2","properties":{"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":5120,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2017-12-21T17:47:42.137Z","updatedAt":"2017-12-21T17:47:42.183Z","accessedAt":"0001-01-01T00:00:00Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}]}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['1017']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47: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-inline-count: ['']
+ status: {code: 200, message: OK}
+- request:
+ body: '{"properties": {"rights": ["Send"]}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic authorizationrule create]
+ Connection: [keep-alive]
+ Content-Length: ['36']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: PUT
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/authorizationRules/cliAutho000003?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/authorizationRules/cliAutho000003","name":"cliAutho000003","type":"Microsoft.ServiceBus/Namespaces/Topics/AuthorizationRules","location":"West
+ US 2","properties":{"rights":["Send"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['440']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47: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: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic authorizationrule show]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/authorizationRules/cliAutho000003?api-version=2017-04-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/authorizationRules/cliAutho000003","name":"cliAutho000003","type":"Microsoft.ServiceBus/Namespaces/Topics/AuthorizationRules","location":"West
+ US 2","properties":{"rights":["Send"]}}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['440']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47:51 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: [sb topic authorizationrule list-keys]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/authorizationRules/cliAutho000003/ListKeys?api-version=2017-04-01
+ response:
+ body: {string: '{"primaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=vsDUvrpgssEzWOxGWrTN6xqZrBJmOn2emzUrNO7qacc=;EntityPath=sb-topiccli000004","secondaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=53ErnYyXZDbptWk/W6+Ev1t+3RY23ACXP/wSsEET+BM=;EntityPath=sb-topiccli000004","primaryKey":"vsDUvrpgssEzWOxGWrTN6xqZrBJmOn2emzUrNO7qacc=","secondaryKey":"53ErnYyXZDbptWk/W6+Ev1t+3RY23ACXP/wSsEET+BM=","keyName":"cliAutho000003"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['610']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47: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: '{"keyType": "PrimaryKey"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic authorizationrule regenerate-keys]
+ Connection: [keep-alive]
+ Content-Length: ['25']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/authorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01
+ response:
+ body: {string: '{"primaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=+epLd2VCRyhxdF2f+oCCL+0fj970zxi61nSx7h6vtrg=;EntityPath=sb-topiccli000004","secondaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=53ErnYyXZDbptWk/W6+Ev1t+3RY23ACXP/wSsEET+BM=;EntityPath=sb-topiccli000004","primaryKey":"+epLd2VCRyhxdF2f+oCCL+0fj970zxi61nSx7h6vtrg=","secondaryKey":"53ErnYyXZDbptWk/W6+Ev1t+3RY23ACXP/wSsEET+BM=","keyName":"cliAutho000003"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['610']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: '{"keyType": "SecondaryKey"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic authorizationrule regenerate-keys]
+ Connection: [keep-alive]
+ Content-Length: ['27']
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/authorizationRules/cliAutho000003/regenerateKeys?api-version=2017-04-01
+ response:
+ body: {string: '{"primaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=+epLd2VCRyhxdF2f+oCCL+0fj970zxi61nSx7h6vtrg=;EntityPath=sb-topiccli000004","secondaryConnectionString":"Endpoint=sb://sb-nscli000002.servicebus.windows.net/;SharedAccessKeyName=cliAutho000003;SharedAccessKey=ZSommXHC70Z1QiUqFLZ3K0nNN744mw1OvKVpOIa+s0s=;EntityPath=sb-topiccli000004","primaryKey":"+epLd2VCRyhxdF2f+oCCL+0fj970zxi61nSx7h6vtrg=","secondaryKey":"ZSommXHC70Z1QiUqFLZ3K0nNN744mw1OvKVpOIa+s0s=","keyName":"cliAutho000003"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['610']
+ content-type: [application/json; charset=utf-8]
+ date: ['Thu, 21 Dec 2017 17:47: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic authorizationrule delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004/authorizationRules/cliAutho000003?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:47: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [sb topic delete]
+ 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.22
+ msrest_azure/0.4.19 azure-mgmt-servicebus/0.1.0 Azure-SDK-For-Python AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_sb_topic000001/providers/Microsoft.ServiceBus/namespaces/sb-nscli000002/topics/sb-topiccli000004?api-version=2017-04-01
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:47: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]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ CommandName: [group delete]
+ 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.22
+ msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python
+ AZURECLI/2.0.24]
+ accept-language: [en-US]
+ method: DELETE
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_sb_topic000001?api-version=2017-05-10
+ response:
+ body: {string: ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Thu, 21 Dec 2017 17:47:58 GMT']
+ expires: ['-1']
+ location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGU0I6NUZUT1BJQ1o0REkyRk82SVlVR1RQTlBRVllCREw3VnwwNzg2NUE0NDYxQjFFRDJELVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?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_servicebus_commands.py b/src/servicebus/azext_servicebus/tests/test_servicebus_commands.py
new file mode 100644
index 00000000000..14f6fa207c6
--- /dev/null
+++ b/src/servicebus/azext_servicebus/tests/test_servicebus_commands.py
@@ -0,0 +1,495 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+# AZURE CLI SERVICEBUS - NAMESAPCE TEST DEFINITIONS
+
+import json
+import time
+from azext_servicebus.servicebus.models import ProvisioningStateDR
+
+from azure.cli.testsdk import (
+ ScenarioTest, ResourceGroupPreparer)
+
+# 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',
+ 'rg': resource_group,
+ 'namespacename': self.create_random_name(prefix='sb-nscli', length=20),
+ 'tags': {'tag1: value1'},
+ 'sku': 'Standard',
+ 'tier': 'Standard',
+ 'authoname': self.create_random_name(prefix='cliAutho', length=20),
+ 'defaultauthorizationrule': 'RootManageSharedAccessKey',
+ 'accessrights': 'Send',
+ 'primary': 'PrimaryKey',
+ 'secondary': 'SecondaryKey'
+ })
+
+ # Check for the NameSpace name Availability
+
+ self.cmd('sb namespace check-name-availability --name {namespacename}',
+ checks=[self.check('nameAvailable', True)])
+
+ # Create Namespace
+ self.cmd('sb namespace create --resource-group {rg} --name {namespacename} '
+ '--location {loc} --tags {tags} --sku-name {sku} --sku-tier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Get Created Namespace
+ self.cmd('sb namespace show --resource-group {rg} --name {namespacename}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # 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
+ self.cmd('sb namespace authorizationrule create --resource-group {rg}'
+ ' --namespace-name {namespacename} --name {authoname} --access-rights {accessrights}',
+ checks=[self.check('name', self.kwargs['authoname'])])
+
+ # Get Authorization Rule
+ self.cmd('sb namespace authorizationrule show --resource-group {rg} --namespace-name {namespacename}'
+ ' --name {authoname}', checks=[self.check('name', self.kwargs['authoname'])])
+
+ # Get Default Authorization Rule
+ self.cmd('sb namespace authorizationrule show --resource-group {rg} --namespace-name {namespacename}'
+ ' --name {defaultauthorizationrule}',
+ checks=[self.check('name', self.kwargs['defaultauthorizationrule'])])
+
+ # Get Authorization Rule Listkeys
+ self.cmd('sb namespace authorizationrule list-keys --resource-group {rg} --namespace-name {namespacename}'
+ ' --name {authoname}')
+
+ # Regeneratekeys - Primary
+ self.cmd(
+ 'sb namespace authorizationrule regenerate-keys --resource-group {rg} --namespace-name {namespacename} --name {authoname} --key-name {primary}')
+
+ # Regeneratekeys - Secondary
+ self.cmd('sb namespace authorizationrule regenerate-keys --resource-group {rg}'
+ ' --namespace-name {namespacename} --name {authoname} --key-name {secondary}')
+
+ # Delete AuthorizationRule
+ self.cmd('sb namespace authorizationrule delete --resource-group {rg} --namespace-name {namespacename}'
+ ' --name {authoname}')
+
+ # Delete Namespace list by ResourceGroup
+ self.cmd('sb namespace delete --resource-group {rg} --name {namespacename}')
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_queue')
+ def test_sb_queue(self, resource_group):
+ self.kwargs.update({
+ 'loc': 'westus2',
+ 'rg': resource_group,
+ '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': 'Listen',
+ 'primary': 'PrimaryKey',
+ 'secondary': 'SecondaryKey',
+ 'queuename': self.create_random_name(prefix='sb-queuecli', length=25),
+ 'queueauthoname': self.create_random_name(prefix='cliQueueAutho', length=25),
+ 'lockduration': 'PT10M'
+
+ })
+
+ # Create Namespace
+ self.cmd('sb namespace create --resource-group {rg} --name {namespacename} --location {loc} --tags {tags}'
+ ' --sku-name {sku} --sku-tier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Get Created Namespace
+ self.cmd('sb namespace show --resource-group {rg} --name {namespacename}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Create Queue
+ self.cmd('sb queue create --resource-group {rg} --namespace-name {namespacename} --name {queuename}'
+ ' --auto-delete-on-idle {lockduration} ', checks=[self.check('name', self.kwargs['queuename'])])
+
+ # Get Queue
+ self.cmd('sb queue show --resource-group {rg} --namespace-name {namespacename} --name {queuename}',
+ checks=[self.check('name', self.kwargs['queuename'])])
+
+ # Queue List
+ self.cmd('sb queue list --resource-group {rg} --namespace-name {namespacename}')
+
+ # Create Authoriazation Rule
+ self.cmd('sb queue authorizationrule create --resource-group {rg} --namespace-name {namespacename}'
+ ' --queue-name {queuename} --name {authoname} --access-rights {accessrights}',
+ checks=[self.check('name', self.kwargs['authoname'])])
+
+ # Get Create Authorization Rule
+ self.cmd('sb queue authorizationrule show --resource-group {rg} --namespace-name {namespacename}'
+ ' --queue-name {queuename} --name {authoname}',
+ checks=[self.check('name', self.kwargs['authoname'])])
+
+ # Get Authorization Rule Listkeys
+ self.cmd('sb queue authorizationrule list-keys --resource-group {rg} --namespace-name {namespacename}'
+ ' --queue-name {queuename} --name {authoname}')
+
+ # Regeneratekeys - Primary
+ regenrateprimarykeyresult = self.cmd(
+ 'sb queue authorizationrule regenerate-keys --resource-group {rg} --namespace-name {namespacename} --queue-name {queuename} --name {authoname} --key-name {primary}')
+ self.assertIsNotNone(regenrateprimarykeyresult)
+
+ # Regeneratekeys - Secondary
+ regenratesecondarykeyresult = self.cmd(
+ 'sb queue authorizationrule regenerate-keys --resource-group {rg} --namespace-name {namespacename}'
+ ' --queue-name {queuename} --name {authoname} --key-name {secondary}')
+ self.assertIsNotNone(regenratesecondarykeyresult)
+
+ # Delete Queue AuthorizationRule
+ self.cmd('sb queue authorizationrule delete --resource-group {rg} --namespace-name {namespacename}'
+ ' --queue-name {queuename} --name {authoname}')
+
+ # 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}')
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_topic')
+ def test_sb_topic(self, resource_group):
+ self.kwargs.update({
+ 'loc': 'westus2',
+ 'rg': resource_group,
+ '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',
+ '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
+ self.cmd(
+ 'sb namespace create --resource-group {rg} --name {namespacename} '
+ '--location {loc} --tags {tags} --sku-name {sku} --sku-tier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Get Created Namespace
+ self.cmd('sb namespace show --resource-group {rg} --name {namespacename}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Create Topic
+ self.cmd(
+ 'sb topic create --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])])
+
+ # Get Topic
+ self.cmd(
+ 'sb topic show --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])])
+
+ # Topic List
+ self.cmd('sb topic list --resource-group {rg} --namespace-name {namespacename}')
+
+ # Create Authoriazation Rule
+ self.cmd('sb topic authorizationrule create --resource-group {rg} --namespace-name {namespacename}'
+ ' --topic-name {topicname} --name {authoname} --access-rights {accessrights}',
+ checks=[self.check('name', self.kwargs['authoname'])])
+
+ # Get Create Authorization Rule
+ self.cmd(
+ 'sb topic authorizationrule show --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {authoname}',
+ checks=[self.check('name', self.kwargs['authoname'])])
+
+ # Get Authorization Rule Listkeys
+ self.cmd(
+ 'sb topic authorizationrule list-keys --resource-group {rg} --namespace-name {namespacename}'
+ ' --topic-name {topicname} --name {authoname}')
+
+ # Regeneratekeys - Primary
+ self.cmd(
+ 'sb topic authorizationrule regenerate-keys --resource-group {rg} --namespace-name {namespacename}'
+ ' --topic-name {topicname} --name {authoname} --key-name {primary}')
+
+ # Regeneratekeys - Secondary
+ self.cmd(
+ 'sb topic authorizationrule regenerate-keys --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname} --name {authoname} --key-name {secondary}')
+
+ # Delete Topic AuthorizationRule
+ self.cmd(
+ 'sb topic authorizationrule delete --resource-group {rg} --namespace-name {namespacename}'
+ ' --topic-name {topicname} --name {authoname}')
+
+ # Delete Topic
+ self.cmd('sb topic delete --resource-group {rg} --namespace-name {namespacename} --name {topicname}')
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_subscription')
+ def test_sb_subscription(self, resource_group):
+ self.kwargs.update({
+ 'loc': 'westus2',
+ 'rg': resource_group,
+ '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
+ self.cmd('sb namespace create --resource-group {rg} --name {namespacename} '
+ '--location {loc} --tags {tags} --sku-name {sku} --sku-tier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Get Created Namespace
+ self.cmd('sb namespace show --resource-group {rg} --name {namespacename}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Create Topic
+ self.cmd('sb topic create --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])])
+
+ # Get Topic
+ self.cmd('sb topic show --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])])
+
+ # Create Subscription
+ self.cmd('sb subscription create --resource-group {rg} --namespace-name {namespacename}'
+ ' --topic-name {topicname} --name {subscriptionname}',
+ checks=[self.check('name', self.kwargs['subscriptionname'])])
+
+ # Get Create Subscription
+ self.cmd('sb subscription show --resource-group {rg} --namespace-name {namespacename}'
+ ' --topic-name {topicname} --name {subscriptionname}',
+ checks=[self.check('name', self.kwargs['subscriptionname'])])
+
+ # Get list of Subscription+
+ self.cmd('sb subscription list --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname}')
+
+ # Delete 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}')
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_rules')
+ def test_sb_rules(self, resource_group):
+ self.kwargs.update({
+ 'loc': 'westus2',
+ 'rg': resource_group,
+ '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': '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
+ self.cmd('sb namespace create --resource-group {rg} --name {namespacename} '
+ '--location {loc} --tags {tags} --sku-name {sku} --sku-tier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Get Created Namespace
+ self.cmd('sb namespace show --resource-group {rg} --name {namespacename}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Create Topic
+ self.cmd('sb topic create --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])])
+
+ # Get Topic
+ self.cmd('sb topic show --resource-group {rg} --namespace-name {namespacename} --name {topicname} ',
+ checks=[self.check('name', self.kwargs['topicname'])])
+
+ # Create Subscription
+ self.cmd('sb subscription create --resource-group {rg} --namespace-name {namespacename}'
+ ' --topic-name {topicname} --name {subscriptionname}',
+ checks=[self.check('name', self.kwargs['subscriptionname'])])
+
+ # Get Create Subscription
+ self.cmd('sb subscription show --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname}'
+ ' --name {subscriptionname}', checks=[self.check('name', self.kwargs['subscriptionname'])])
+
+ # Create Rules
+ 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'])])
+
+ # Get Created Rules
+ self.cmd('sb rule show --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname}'
+ ' --subscription-name {subscriptionname} --name {rulename}',
+ checks=[self.check('name', self.kwargs['rulename'])])
+
+ # Get Rules List By Subscription
+ self.cmd('sb rule list --resource-group {rg} --namespace-name {namespacename} --topic-name {topicname}'
+ ' --subscription-name {subscriptionname}')
+
+ # Delete create rule
+ 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}')
+
+ @ResourceGroupPreparer(name_prefix='cli_test_sb_alias')
+ def test_sb_alias(self, resource_group):
+
+ self.kwargs.update({
+ 'loc_south': 'SouthCentralUS',
+ 'loc_north': 'NorthCentralUS',
+ 'rg': resource_group,
+ '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',
+ 'primary': 'PrimaryKey',
+ 'secondary': 'SecondaryKey',
+ 'aliasname': self.create_random_name(prefix='cliAlias', length=20),
+ 'alternatename': self.create_random_name(prefix='cliAlter', length=20),
+ 'id': '',
+ 'test': ''
+ })
+
+ self.cmd('sb namespace check-name-availability --name {namespacenameprimary}',
+ checks=[self.check('nameAvailable', True)])
+
+ # Create Namespace - Primary
+ self.cmd('sb namespace create --resource-group {rg} --name {namespacenameprimary} --location {loc_south} --tags {tags} --sku-name {sku} --sku-tier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Get Created Namespace - Primary
+ self.cmd('sb namespace show --resource-group {rg} --name {namespacenameprimary}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Create Namespace - Secondary
+ self.cmd('sb namespace create --resource-group {rg} --name {namespacenamesecondary}'
+ ' --location {loc_north} --tags {tags} --sku-name {sku} --sku-tier {tier}',
+ checks=[self.check('sku.name', self.kwargs['sku'])])
+
+ # Get Created Namespace - Secondary
+ getnamespace2result = self.cmd('sb namespace show --resource-group {rg} --name {namespacenamesecondary}',
+ checks=[self.check('sku.name', self.kwargs['sku'])]).output
+
+ # Create Authoriazation Rule
+ self.cmd('sb namespace authorizationrule create --resource-group {rg} --namespace-name {namespacenameprimary} --name {authoname} --access-rights {accessrights}', checks=[self.check('name', self.kwargs['authoname'])])
+
+ partnernamespaceid = json.loads(getnamespace2result)['id']
+ self.kwargs.update({'id': partnernamespaceid})
+ # Get Create Authorization Rule
+ self.cmd('sb namespace authorizationrule show --resource-group {rg} --namespace-name {namespacenameprimary}'
+ ' --name {authoname}', checks=[self.check('name', self.kwargs['authoname'])])
+
+ # CheckNameAvailability - Alias
+
+ self.cmd('sb alias check-name-availability --resource-group {rg} --namespace-name {namespacenameprimary} --name {aliasname}', checks=[self.check('nameAvailable', True)])
+
+ # Create alias
+ self.cmd('sb alias create --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname} --partner-namespace {id}')
+
+ # get alias - Primary
+ self.cmd('sb alias show --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}')
+
+ # get alias - Secondary
+ self.cmd('sb alias show --resource-group {rg} --namespace-name {namespacenamesecondary} --alias {aliasname}')
+
+ getaliasprimarynamespace = self.cmd(
+ 'sb alias show --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 show --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+ # Break Pairing
+ self.cmd('sb alias break-pairing --resource-group {rg} --namespace-name {namespacenameprimary}'
+ ' --alias {aliasname}')
+
+ getaliasafterbreak = self.cmd(
+ 'sb alias show --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 show --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+ # Create alias
+ self.cmd('sb alias create --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}'
+ ' --partner-namespace {id}')
+
+ getaliasaftercreate = self.cmd(
+ 'sb alias show --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 show --resource-group {rg} --namespace-name {namespacenameprimary} --alias {aliasname}').output
+
+ # FailOver
+ self.cmd('sb alias fail-over --resource-group {rg} --namespace-name {namespacenamesecondary}'
+ ' --alias {aliasname}')
+
+ getaliasafterfail = self.cmd(
+ 'sb alias show --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 show --resource-group {rg} --namespace-name {namespacenamesecondary} --alias {aliasname}').output
+
+ # Delete Alias
+ self.cmd('sb alias delete --resource-group {rg} --namespace-name {namespacenamesecondary} --alias {aliasname}')
+
+ time.sleep(30)
+
+ # 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/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..dce565f2e08
--- /dev/null
+++ b/src/servicebus/setup.py
@@ -0,0 +1,41 @@
+#!/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.1"
+
+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 = []
+
+setup(
+ name='servicebus',
+ version=VERSION,
+ description='An Azure CLI Extension to manage servicebus resources',
+ long_description='An Azure CLI Extension to manage servicebus resources',
+ 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
+)