diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index f1b832deb546..374bf7624843 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -11,6 +11,7 @@ * Sending a message twice will no longer result in a MessageAlreadySettled exception. * `ServiceBusClient.close()` now closes spawned senders and receivers. * Attempting to initialize a sender or receiver with a different connection string entity and specified entity (e.g. `queue_name`) will result in an AuthenticationError +* Rename `entity_availability_status` to `availability_status` ## 7.0.0b5 (2020-08-10) diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py index 33aba6288654..a59a390ad82a 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py @@ -238,7 +238,7 @@ async def create_queue(self, name: str, **kwargs) -> QueueProperties: dead_lettering_on_message_expiration=kwargs.pop("dead_lettering_on_message_expiration", None), default_message_time_to_live=kwargs.pop("default_message_time_to_live", None), duplicate_detection_history_time_window=kwargs.pop("duplicate_detection_history_time_window", None), - entity_availability_status=kwargs.pop("entity_availability_status", None), + availability_status=None, enable_batched_operations=kwargs.pop("enable_batched_operations", None), enable_express=kwargs.pop("enable_express", None), enable_partitioning=kwargs.pop("enable_partitioning", None), @@ -453,7 +453,7 @@ async def create_topic(self, name: str, **kwargs) -> TopicProperties: support_ordering=kwargs.pop("support_ordering", None), auto_delete_on_idle=kwargs.pop("auto_delete_on_idle", None), enable_partitioning=kwargs.pop("enable_partitioning", None), - entity_availability_status=kwargs.pop("entity_availability_status", None), + availability_status=None, enable_subscription_partitioning=kwargs.pop("enable_subscription_partitioning", None), enable_express=kwargs.pop("enable_express", None), user_metadata=kwargs.pop("user_metadata", None) @@ -669,7 +669,7 @@ async def create_subscription( user_metadata=kwargs.pop("user_metadata", None), forward_dead_lettered_messages_to=kwargs.pop("forward_dead_lettered_messages_to", None), auto_delete_on_idle=kwargs.pop("auto_delete_on_idle", None), - entity_availability_status=kwargs.pop("entity_availability_status", None), + availability_status=None, ) to_create = subscription._to_internal_entity() # type: ignore # pylint:disable=protected-access diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py index 9c326af09dd6..2cf7bede5ce0 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py @@ -233,7 +233,7 @@ def create_queue(self, name, **kwargs): dead_lettering_on_message_expiration=kwargs.pop("dead_lettering_on_message_expiration", None), default_message_time_to_live=kwargs.pop("default_message_time_to_live", None), duplicate_detection_history_time_window=kwargs.pop("duplicate_detection_history_time_window", None), - entity_availability_status=kwargs.pop("entity_availability_status", None), + availability_status=None, enable_batched_operations=kwargs.pop("enable_batched_operations", None), enable_express=kwargs.pop("enable_express", None), enable_partitioning=kwargs.pop("enable_partitioning", None), @@ -456,7 +456,7 @@ def create_topic(self, name, **kwargs): support_ordering=kwargs.pop("support_ordering", None), auto_delete_on_idle=kwargs.pop("auto_delete_on_idle", None), enable_partitioning=kwargs.pop("enable_partitioning", None), - entity_availability_status=kwargs.pop("entity_availability_status", None), + availability_status=None, enable_subscription_partitioning=kwargs.pop("enable_subscription_partitioning", None), enable_express=kwargs.pop("enable_express", None), user_metadata=kwargs.pop("user_metadata", None) @@ -678,7 +678,7 @@ def create_subscription(self, topic, name, **kwargs): user_metadata=kwargs.pop("user_metadata", None), forward_dead_lettered_messages_to=kwargs.pop("forward_dead_lettered_messages_to", None), auto_delete_on_idle=kwargs.pop("auto_delete_on_idle", None), - entity_availability_status=kwargs.pop("entity_availability_status", None), + availability_status=None, ) to_create = subscription._to_internal_entity() # type: ignore # pylint:disable=protected-access diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py index 1bf01ae807a5..2a3c73c6fc52 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py @@ -112,9 +112,9 @@ class QueueProperties(DictMixin): # pylint:disable=too-many-instance-attributes :ivar 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: ~datetime.timedelta - :ivar entity_availability_status: Availibility status of the entity. Possible values include: + :ivar availability_status: Availibility status of the entity. Possible values include: "Available", "Limited", "Renaming", "Restoring", "Unknown". - :type entity_availability_status: str or + :type availability_status: str or ~azure.servicebus.management.EntityAvailabilityStatus :ivar enable_batched_operations: Value that indicates whether server-side batched operations are enabled. @@ -177,7 +177,7 @@ def __init__( self.dead_lettering_on_message_expiration = extract_kwarg('dead_lettering_on_message_expiration') self.default_message_time_to_live = extract_kwarg('default_message_time_to_live') self.duplicate_detection_history_time_window = extract_kwarg('duplicate_detection_history_time_window') - self.entity_availability_status = extract_kwarg('entity_availability_status') + self.availability_status = extract_kwarg('availability_status') self.enable_batched_operations = extract_kwarg('enable_batched_operations') self.enable_express = extract_kwarg('enable_express') self.enable_partitioning = extract_kwarg('enable_partitioning') @@ -206,7 +206,7 @@ def _from_internal_entity(cls, name, internal_qd): dead_lettering_on_message_expiration=internal_qd.dead_lettering_on_message_expiration, default_message_time_to_live=internal_qd.default_message_time_to_live, duplicate_detection_history_time_window=internal_qd.duplicate_detection_history_time_window, - entity_availability_status=internal_qd.entity_availability_status, + availability_status=internal_qd.entity_availability_status, enable_batched_operations=internal_qd.enable_batched_operations, enable_express=internal_qd.enable_express, enable_partitioning=internal_qd.enable_partitioning, @@ -235,7 +235,7 @@ def _to_internal_entity(self): self._internal_qd.dead_lettering_on_message_expiration = self.dead_lettering_on_message_expiration self._internal_qd.default_message_time_to_live = self.default_message_time_to_live self._internal_qd.duplicate_detection_history_time_window = self.duplicate_detection_history_time_window - self._internal_qd.entity_availability_status = self.entity_availability_status + self._internal_qd.entity_availability_status = self.availability_status self._internal_qd.enable_batched_operations = self.enable_batched_operations self._internal_qd.enable_express = self.enable_express self._internal_qd.enable_partitioning = self.enable_partitioning @@ -403,9 +403,9 @@ class TopicProperties(DictMixin): # pylint:disable=too-many-instance-attributes :ivar enable_partitioning: A value that indicates whether the topic is to be partitioned across multiple message brokers. :type enable_partitioning: bool - :ivar entity_availability_status: Availability status of the entity. Possible values include: + :ivar availability_status: Availability status of the entity. Possible values include: "Available", "Limited", "Renaming", "Restoring", "Unknown". - :type entity_availability_status: str or + :type availability_status: str or ~azure.servicebus.management.EntityAvailabilityStatus :ivar enable_subscription_partitioning: A value that indicates whether the topic's subscription is to be partitioned. @@ -440,7 +440,7 @@ def __init__( self.support_ordering = extract_kwarg('support_ordering') self.auto_delete_on_idle = extract_kwarg('auto_delete_on_idle') self.enable_partitioning = extract_kwarg('enable_partitioning') - self.entity_availability_status = extract_kwarg('entity_availability_status') + self.availability_status = extract_kwarg('availability_status') self.enable_subscription_partitioning = extract_kwarg('enable_subscription_partitioning') self.enable_express = extract_kwarg('enable_express') self.user_metadata = extract_kwarg('user_metadata') @@ -464,7 +464,7 @@ def _from_internal_entity(cls, name, internal_td): support_ordering=internal_td.support_ordering, auto_delete_on_idle=internal_td.auto_delete_on_idle, enable_partitioning=internal_td.enable_partitioning, - entity_availability_status=internal_td.entity_availability_status, + availability_status=internal_td.entity_availability_status, enable_subscription_partitioning=internal_td.enable_subscription_partitioning, enable_express=internal_td.enable_express, user_metadata=internal_td.user_metadata @@ -488,7 +488,7 @@ def _to_internal_entity(self): self._internal_td.support_ordering = self.support_ordering self._internal_td.auto_delete_on_idle = self.auto_delete_on_idle self._internal_td.enable_partitioning = self.enable_partitioning - self._internal_td.entity_availability_status = self.entity_availability_status + self._internal_td.entity_availability_status = self.availability_status self._internal_td.enable_subscription_partitioning = self.enable_subscription_partitioning self._internal_td.enable_express = self.enable_express self._internal_td.user_metadata = self.user_metadata @@ -614,9 +614,9 @@ class SubscriptionProperties(DictMixin): # pylint:disable=too-many-instance-att :ivar auto_delete_on_idle: ISO 8601 timeSpan idle interval after which the subscription is automatically deleted. The minimum duration is 5 minutes. :type auto_delete_on_idle: ~datetime.timedelta - :ivar entity_availability_status: Availability status of the entity. Possible values include: + :ivar availability_status: Availability status of the entity. Possible values include: "Available", "Limited", "Renaming", "Restoring", "Unknown". - :type entity_availability_status: str or + :type availability_status: str or ~azure.servicebus.management.EntityAvailabilityStatus """ def __init__(self, name, **kwargs): @@ -640,7 +640,7 @@ def __init__(self, name, **kwargs): self.user_metadata = extract_kwarg('user_metadata') self.forward_dead_lettered_messages_to = extract_kwarg('forward_dead_lettered_messages_to') self.auto_delete_on_idle = extract_kwarg('auto_delete_on_idle') - self.entity_availability_status = extract_kwarg('entity_availability_status') + self.availability_status = extract_kwarg('availability_status') validate_extraction_missing_args(extraction_missing_args) @@ -662,7 +662,7 @@ def _from_internal_entity(cls, name, internal_subscription): user_metadata=internal_subscription.user_metadata, forward_dead_lettered_messages_to=internal_subscription.forward_dead_lettered_messages_to, auto_delete_on_idle=internal_subscription.auto_delete_on_idle, - entity_availability_status=internal_subscription.entity_availability_status + availability_status=internal_subscription.entity_availability_status ) subscription._internal_sd = deepcopy(internal_subscription) return subscription @@ -684,7 +684,7 @@ def _to_internal_entity(self): self._internal_sd.user_metadata = self.user_metadata self._internal_sd.forward_dead_lettered_messages_to = self.forward_dead_lettered_messages_to self._internal_sd.auto_delete_on_idle = self.auto_delete_on_idle - self._internal_sd.entity_availability_status = self.entity_availability_status + self._internal_sd.entity_availability_status = self.availability_status return self._internal_sd diff --git a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_queues_async.py b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_queues_async.py index c5cff6fa891d..aea0e13a2d82 100644 --- a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_queues_async.py +++ b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_queues_async.py @@ -199,7 +199,7 @@ async def test_async_mgmt_queue_create_by_name(self, servicebus_namespace_connec try: queue = await mgmt_service.get_queue(queue_name) assert queue.name == queue_name - assert queue.entity_availability_status == 'Available' + assert queue.availability_status == 'Available' assert queue.status == 'Active' # assert created_at < queue.created_at < utc_now() + datetime.timedelta(minutes=10) # TODO: Should be created_at_utc for consistency with dataplane. finally: diff --git a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_subscriptions_async.py b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_subscriptions_async.py index 50425f6b6048..d2696242e8fd 100644 --- a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_subscriptions_async.py +++ b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_subscriptions_async.py @@ -38,7 +38,7 @@ async def test_async_mgmt_subscription_create_by_name(self, servicebus_namespace await mgmt_service.create_subscription(topic_name, subscription_name) subscription = await mgmt_service.get_subscription(topic_name, subscription_name) assert subscription.name == subscription_name - assert subscription.entity_availability_status == 'Available' + assert subscription.availability_status == 'Available' assert subscription.status == 'Active' finally: await mgmt_service.delete_subscription(topic_name, subscription_name) diff --git a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_topics_async.py b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_topics_async.py index 868c7c50ec27..3f9c16aaaa49 100644 --- a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_topics_async.py +++ b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_topics_async.py @@ -36,7 +36,7 @@ async def test_async_mgmt_topic_create_by_name(self, servicebus_namespace_connec await mgmt_service.create_topic(topic_name) topic = await mgmt_service.get_topic(topic_name) assert topic.name == topic_name - assert topic.entity_availability_status == 'Available' + assert topic.availability_status == 'Available' assert topic.status == 'Active' finally: await mgmt_service.delete_topic(topic_name) diff --git a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_queues.py b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_queues.py index 7b4bbd133b9e..ac327be3a632 100644 --- a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_queues.py +++ b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_queues.py @@ -206,7 +206,7 @@ def test_mgmt_queue_create_by_name(self, servicebus_namespace_connection_string, try: queue = mgmt_service.get_queue(queue_name) assert queue.name == queue_name - assert queue.entity_availability_status == 'Available' + assert queue.availability_status == 'Available' assert queue.status == 'Active' # assert created_at < queue.created_at < utc_now() + datetime.timedelta(minutes=10) # TODO: Should be created_at_utc for consistency with dataplane. finally: diff --git a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_subscriptions.py b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_subscriptions.py index a545702d9158..932af7996fe3 100644 --- a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_subscriptions.py +++ b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_subscriptions.py @@ -37,7 +37,7 @@ def test_mgmt_subscription_create_by_name(self, servicebus_namespace_connection_ mgmt_service.create_subscription(topic_name, subscription_name) subscription = mgmt_service.get_subscription(topic_name, subscription_name) assert subscription.name == subscription_name - assert subscription.entity_availability_status == 'Available' + assert subscription.availability_status == 'Available' assert subscription.status == 'Active' finally: mgmt_service.delete_subscription(topic_name, subscription_name) diff --git a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_topics.py b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_topics.py index 30135906288f..aa0b63007a74 100644 --- a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_topics.py +++ b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_topics.py @@ -35,7 +35,7 @@ def test_mgmt_topic_create_by_name(self, servicebus_namespace_connection_string, mgmt_service.create_topic(topic_name) topic = mgmt_service.get_topic(topic_name) assert topic.name == topic_name - assert topic.entity_availability_status == 'Available' + assert topic.availability_status == 'Available' assert topic.status == 'Active' finally: mgmt_service.delete_topic(topic_name)