azure.servicebus.aio.management package¶
-
class
azure.servicebus.aio.management.
ServiceBusManagementClient
(fully_qualified_namespace: str, credential: Union[AsyncTokenCredential, azure.servicebus.aio._base_handler_async.ServiceBusSharedKeyCredential], **kwargs)[source]¶ Use this client to create, update, list, and delete resources of a ServiceBus namespace.
- Parameters
fully_qualified_namespace (str) – The fully qualified host name for the Service Bus namespace.
credential (Union[AsyncTokenCredential, ServiceBusSharedKeyCredential]) – To authenticate to manage the entities of the ServiceBus namespace.
-
async
create_queue
(queue: Union[str, azure.servicebus.management._models.QueueDescription], **kwargs) → azure.servicebus.management._models.QueueDescription[source]¶ Create a queue.
- Parameters
queue (Union[str, QueueDescription]) – The queue name or a QueueDescription instance. When it’s a str, it will be the name of the created queue. Other properties of the created queue will have default values as defined by the service. Use a QueueDescription if you want to set queue properties other than the queue name.
- Return type
-
async
create_rule
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], rule: azure.servicebus.management._models.RuleDescription, **kwargs) → azure.servicebus.management._models.RuleDescription[source]¶ Create a rule for a topic subscription.
- Parameters
TopicDescription] topic (Union[str,) – The topic that will own the to-be-created subscription rule.
SubscriptionDescription] subscription (Union[str,) – The subscription that will own the to-be-created rule.
rule (RuleDescription) – The rule to be created. Other properties of the created rule will have default values as defined by the service.
- Return type
-
async
create_subscription
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], **kwargs) → azure.servicebus.management._models.SubscriptionDescription[source]¶ Create a topic subscription.
- Parameters
- SubscriptionDescription instance. When it’s a str, it will be the name of the created subscription.
Other properties of the created subscription will have default values as defined by the service.
- Return type
-
async
create_topic
(topic: Union[str, azure.servicebus.management._models.TopicDescription], **kwargs) → azure.servicebus.management._models.TopicDescription[source]¶ Create a topic.
- Parameters
TopicDescription] topic (Union[str,) – The topic name or a TopicDescription instance. When it’s a str, it will be the name of the created topic. Other properties of the created topic will have default values as defined by the service. Use a TopicDescription if you want to set queue properties other than the queue name.
- Return type
-
async
delete_queue
(queue: Union[str, azure.servicebus.management._models.QueueDescription], **kwargs) → None[source]¶ Delete a queue.
-
async
delete_rule
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], rule: Union[str, azure.servicebus.management._models.RuleDescription], **kwargs) → None[source]¶ Delete a topic subscription rule.
-
async
delete_subscription
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], **kwargs) → None[source]¶ Delete a topic subscription.
-
async
delete_topic
(topic: Union[str, azure.servicebus.management._models.TopicDescription], **kwargs) → None[source]¶ Delete a topic.
-
classmethod
from_connection_string
(conn_str: str, **kwargs) → azure.servicebus.aio.management._management_client_async.ServiceBusManagementClient[source]¶ Create a client from connection string.
- Parameters
conn_str (str) – The connection string of the Service Bus Namespace.
- Return type
ServiceBusManagementClient
-
async
get_namespace_properties
(**kwargs) → azure.servicebus.management._generated.models._models_py3.NamespaceProperties[source]¶ Get the namespace properties
- Return type
-
async
get_queue
(queue_name: str, **kwargs) → azure.servicebus.management._models.QueueDescription[source]¶ Get the properties of a queue.
- Parameters
queue_name (str) – The name of the queue.
- Return type
-
async
get_queue_runtime_info
(queue_name: str, **kwargs) → azure.servicebus.management._models.QueueRuntimeInfo[source]¶ Get the runtime information of a queue.
- Parameters
queue_name (str) – The name of the queue.
- Return type
-
async
get_rule
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], rule_name: str, **kwargs) → azure.servicebus.management._models.RuleDescription[source]¶ Get the properties of a topic subscription rule.
- Parameters
- Return type
-
async
get_subscription
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription_name: str, **kwargs) → azure.servicebus.management._models.SubscriptionDescription[source]¶ Get the properties of a topic subscription.
- Parameters
- Return type
-
async
get_subscription_runtime_info
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription_name: str, **kwargs) → azure.servicebus.management._models.SubscriptionRuntimeInfo[source]¶ Get a topic subscription runtime info.
- Parameters
- Return type
-
async
get_topic
(topic_name: str, **kwargs) → azure.servicebus.management._models.TopicDescription[source]¶ Get the properties of a topic.
- Parameters
topic_name (str) – The name of the topic.
- Return type
-
async
get_topic_runtime_info
(topic_name: str, **kwargs) → azure.servicebus.management._models.TopicRuntimeInfo[source]¶ Get the runtime information of a topic.
- Parameters
topic_name (str) – The name of the topic.
- Return type
-
list_queues
(**kwargs) → azure.core.async_paging.AsyncItemPaged[azure.servicebus.management._models.QueueDescription][source]¶ List the queues of a ServiceBus namespace.
- Returns
An iterable (auto-paging) response of QueueDescription.
- Return type
-
list_queues_runtime_info
(**kwargs) → azure.core.async_paging.AsyncItemPaged[azure.servicebus.management._models.QueueRuntimeInfo][source]¶ List the runtime information of the queues in a ServiceBus namespace.
- Returns
An iterable (auto-paging) response of QueueRuntimeInfo.
- Return type
-
list_rules
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], **kwargs) → azure.core.async_paging.AsyncItemPaged[azure.servicebus.management._models.RuleDescription][source]¶ List the rules of a topic subscription.
- Parameters
- Returns
An iterable (auto-paging) response of RuleDescription.
- Return type
-
list_subscriptions
(topic: Union[str, azure.servicebus.management._models.TopicDescription], **kwargs) → azure.core.async_paging.AsyncItemPaged[azure.servicebus.management._models.SubscriptionDescription][source]¶ List the subscriptions of a ServiceBus Topic.
- Parameters
TopicDescription] topic (Union[str,) – The topic that owns the subscription.
- Returns
An iterable (auto-paging) response of SubscriptionDescription.
- Return type
-
list_subscriptions_runtime_info
(topic: Union[str, azure.servicebus.management._models.TopicDescription], **kwargs) → azure.core.async_paging.AsyncItemPaged[azure.servicebus.management._models.SubscriptionRuntimeInfo][source]¶ List the subscriptions runtime information of a ServiceBus.
- Parameters
TopicDescription] topic (Union[str,) – The topic that owns the subscription.
- Returns
An iterable (auto-paging) response of SubscriptionRuntimeInfo.
- Return type
-
list_topics
(**kwargs) → azure.core.async_paging.AsyncItemPaged[azure.servicebus.management._models.TopicDescription][source]¶ List the topics of a ServiceBus namespace.
- Returns
An iterable (auto-paging) response of TopicDescription.
- Return type
-
list_topics_runtime_info
(**kwargs) → azure.core.async_paging.AsyncItemPaged[azure.servicebus.management._models.TopicRuntimeInfo][source]¶ List the topics runtime information of a ServiceBus namespace.
- Returns
An iterable (auto-paging) response of TopicRuntimeInfo.
- Return type
-
async
update_queue
(queue: azure.servicebus.management._models.QueueDescription, *, default_message_time_to_live: datetime.timedelta = None, lock_duration: datetime.timedelta = None, dead_lettering_on_message_expiration: bool = None, duplicate_detection_history_time_window: datetime.timedelta = None, max_delivery_count: int = None, **kwargs) → None[source]¶ Update a queue.
- Parameters
queue (QueueDescription) – The properties of this QueueDescription will be applied to the queue in ServiceBus. Only a portion of properties can be updated. Refer to https://docs.microsoft.com/en-us/rest/api/servicebus/update-queue.
- Keyword Arguments
default_message_time_to_live (timedelta) – The value you want to update to.
lock_duration (timedelta) – The value you want to update to.
dead_lettering_on_message_expiration (bool) – The value you want to update to.
duplicate_detection_history_time_window (timedelta) – The value you want to update to.
max_delivery_count (int) – The value you want to update to.
- Return type
-
async
update_rule
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], rule: azure.servicebus.management._models.RuleDescription, **kwargs) → None[source]¶ Update a rule.
Before calling this method, you should use get_rule to get a RuleDescription instance, then update the related attributes and call this method. Only a portion of properties can be updated.
- Parameters
TopicDescription] topic (Union[str,) – The topic that owns the subscription.
SubscriptionDescription] subscription (Union[str,) – The subscription that owns this rule.
rule (RuleDescription) – The rule to be updated.
- Return type
-
async
update_subscription
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: azure.servicebus.management._models.SubscriptionDescription, **kwargs) → None[source]¶ Update a subscription.
Before calling this method, you should use get_subscription to get a SubscriptionDescription instance, then update the related attributes and call this method. Only a portion of properties can be updated.
- Parameters
TopicDescription] topic (Union[str,) – The topic that owns the subscription.
subscription (SubscriptionDescription) – The subscription to be updated.
- Return type
-
async
update_topic
(topic: azure.servicebus.management._models.TopicDescription, *, default_message_time_to_live: datetime.timedelta = None, duplicate_detection_history_time_window: datetime.timedelta = None, **kwargs) → None[source]¶ Update a topic.
Before calling this method, you should use get_topic to get a TopicDescription instance, then use the keyword arguments to update the properties you want to update. Only a portion of properties can be updated. Refer to https://docs.microsoft.com/en-us/rest/api/servicebus/update-topic.
- Parameters
topic (TopicDescription) – The topic to be updated.
- Keyword Arguments
default_message_time_to_live (timedelta) – The value you want to update to.
duplicate_detection_history_time_window (timedelta) – The value you want to update to.
- Return type