From a0d8c2ffaf0796251909571d89dbe6b2958a5125 Mon Sep 17 00:00:00 2001 From: KieranBrantnerMagee Date: Tue, 8 Sep 2020 09:34:57 -0700 Subject: [PATCH 01/16] [ServiceBus] Expose internal amqp message properties via AMQPMessage wrapper object on Message (#13564) * Expose internal amqp message properties via AMQPMessage wrapper object on Message. Add test, changelog notes and docstring. (Note: Cannot rename old message as uamqp relies on the internal property name. Should likely be adapted.) Co-authored-by: Adam Ling (MSFT) --- sdk/servicebus/azure-servicebus/CHANGELOG.md | 1 + .../azure/servicebus/_common/message.py | 79 +++++++++++++++++++ .../azure-servicebus/tests/test_queues.py | 39 +++++++++ 3 files changed, 119 insertions(+) diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index f1b832deb546..b80ba58c5888 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -4,6 +4,7 @@ **New Features** * Messages can now be sent twice in succession. +* Internal AMQP message properties (header, footer, annotations, properties, etc) are now exposed via `Message.amqp_message` **Breaking Changes** diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_common/message.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_common/message.py index 77871922401a..050828f2bb06 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_common/message.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_common/message.py @@ -85,6 +85,8 @@ class Message(object): # pylint: disable=too-many-public-methods,too-many-insta :keyword str reply_to_session_id: The session identifier augmenting the `reply_to` address. :keyword str encoding: The encoding for string data. Default is UTF-8. + :ivar AMQPMessage amqp_message: Advanced use only. The internal AMQP message payload that is sent or received. + .. admonition:: Example: .. literalinclude:: ../samples/sync_samples/sample_code_servicebus.py @@ -105,6 +107,7 @@ def __init__(self, body, **kwargs): self._amqp_header = uamqp.message.MessageHeader() if 'message' in kwargs: + # Note: This cannot be renamed until UAMQP no longer relies on this specific name. self.message = kwargs['message'] self._amqp_properties = self.message.properties self._amqp_header = self.message.header @@ -123,6 +126,8 @@ def __init__(self, body, **kwargs): self.time_to_live = kwargs.pop("time_to_live", None) self.partition_key = kwargs.pop("partition_key", None) self.via_partition_key = kwargs.pop("via_partition_key", None) + # If message is the full message, amqp_message is the "public facing interface" for what we expose. + self.amqp_message = AMQPMessage(self.message) def __str__(self): return str(self.message) @@ -1069,3 +1074,77 @@ def renew_lock(self): expiry = self._receiver._renew_locks(token) # type: ignore self._expiry = utc_from_timestamp(expiry[MGMT_RESPONSE_MESSAGE_EXPIRATION][0]/1000.0) + + +class AMQPMessage(object): + """ + The internal AMQP message that this ServiceBusMessage represents. + + :param properties: Properties to add to the message. + :type properties: ~uamqp.message.MessageProperties + :param application_properties: Service specific application properties. + :type application_properties: dict + :param annotations: Service specific message annotations. Keys in the dictionary + must be `uamqp.types.AMQPSymbol` or `uamqp.types.AMQPuLong`. + :type annotations: dict + :param delivery_annotations: Delivery-specific non-standard properties at the head of the message. + Delivery annotations convey information from the sending peer to the receiving peer. + Keys in the dictionary must be `uamqp.types.AMQPSymbol` or `uamqp.types.AMQPuLong`. + :type delivery_annotations: dict + :param header: The message header. + :type header: ~uamqp.message.MessageHeader + :param footer: The message footer. + :type footer: dict + + """ + def __init__(self, message): + # type: (uamqp.Message) -> None + self._message = message + + @property + def properties(self): + return self._message.properties + + @properties.setter + def properties(self, value): + self._message.properties = value + + @property + def application_properties(self): + return self._message.application_properties + + @application_properties.setter + def application_properties(self, value): + self._message.application_properties = value + + @property + def annotations(self): + return self._message.annotations + + @annotations.setter + def annotations(self, value): + self._message.annotations = value + + @property + def delivery_annotations(self): + return self._message.delivery_annotations + + @delivery_annotations.setter + def delivery_annotations(self, value): + self._message.delivery_annotations = value + + @property + def header(self): + return self._message.header + + @header.setter + def header(self, value): + self._message.header = value + + @property + def footer(self): + return self._message.footer + + @footer.setter + def footer(self, value): + self._message.footer = value diff --git a/sdk/servicebus/azure-servicebus/tests/test_queues.py b/sdk/servicebus/azure-servicebus/tests/test_queues.py index c17e4e9b00a9..64412ddce7c7 100644 --- a/sdk/servicebus/azure-servicebus/tests/test_queues.py +++ b/sdk/servicebus/azure-servicebus/tests/test_queues.py @@ -1857,3 +1857,42 @@ def test_queue_receiver_invalid_mode(self, servicebus_namespace_connection_strin max_wait_time="oij") as receiver: assert receiver + + @pytest.mark.liveTest + @pytest.mark.live_test_only + @CachedResourceGroupPreparer(name_prefix='servicebustest') + @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') + @ServiceBusQueuePreparer(name_prefix='servicebustest') + def test_message_inner_amqp_properties(self, servicebus_namespace_connection_string, servicebus_queue, **kwargs): + + message = Message("body") + + with pytest.raises(TypeError): + message.amqp_message.properties = {"properties":1} + message.amqp_message.properties.subject = "subject" + + message.amqp_message.application_properties = {b"application_properties":1} + + message.amqp_message.annotations = {b"annotations":2} + message.amqp_message.delivery_annotations = {b"delivery_annotations":3} + + with pytest.raises(TypeError): + message.amqp_message.header = {"header":4} + message.amqp_message.header.priority = 5 + + message.amqp_message.footer = {b"footer":6} + + with ServiceBusClient.from_connection_string( + servicebus_namespace_connection_string, logging_enable=False) as sb_client: + + with sb_client.get_queue_sender(servicebus_queue.name) as sender: + sender.send_messages(message) + with sb_client.get_queue_receiver(servicebus_queue.name, max_wait_time=5) as receiver: + message = receiver.receive_messages()[0] + assert message.amqp_message.properties.subject == b"subject" + assert message.amqp_message.application_properties[b"application_properties"] == 1 + assert message.amqp_message.annotations[b"annotations"] == 2 + # delivery_annotations and footer disabled pending uamqp bug https://github.com/Azure/azure-uamqp-python/issues/169 + #assert message.amqp_message.delivery_annotations[b"delivery_annotations"] == 3 + assert message.amqp_message.header.priority == 5 + #assert message.amqp_message.footer[b"footer"] == 6 \ No newline at end of file From f69e8c7170f90bc9e5376c0e6bcf34ac7b9890f9 Mon Sep 17 00:00:00 2001 From: Yijun Xie <48257664+YijunXieMS@users.noreply.github.com> Date: Tue, 8 Sep 2020 09:37:10 -0700 Subject: [PATCH 02/16] Update doc link in README.md (#13618) --- .../azure-eventhub-checkpointstoreblob-aio/README.md | 4 ++-- .../samples/README.md | 2 +- sdk/eventhub/azure-eventhub-checkpointstoreblob/README.md | 4 ++-- .../azure-eventhub-checkpointstoreblob/samples/README.md | 2 +- sdk/eventhub/azure-eventhub/README.md | 4 ++-- sdk/eventhub/azure-eventhub/migration_guide.md | 8 ++++---- sdk/eventhub/azure-eventhub/samples/README.md | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/README.md b/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/README.md index 7a0f80babfc2..326ffa1d824d 100644 --- a/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/README.md +++ b/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/README.md @@ -5,7 +5,7 @@ This Checkpoint Store package works as a plug-in package to `EventHubConsumerCli Please note that this is an async library, for sync version of the Azure EventHubs Checkpoint Store client library, please refer to [azure-eventhub-checkpointstoreblob](../azure-eventhub-checkpointstoreblob). -[Source code](./) | [Package (PyPi)](https://pypi.org/project/azure-eventhub-checkpointstoreblob-aio/) | [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.0.1/azure.eventhub.aio.html#azure.eventhub.aio.CheckpointStore) | [Azure Eventhubs documentation](https://docs.microsoft.com/azure/event-hubs/) | [Azure Storage documentation](https://docs.microsoft.com/azure/storage/) +[Source code](./) | [Package (PyPi)](https://pypi.org/project/azure-eventhub-checkpointstoreblob-aio/) | [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.aio.html#azure.eventhub.aio.CheckpointStore) | [Azure Eventhubs documentation](https://docs.microsoft.com/azure/event-hubs/) | [Azure Storage documentation](https://docs.microsoft.com/azure/storage/) ## Getting started @@ -124,7 +124,7 @@ Enabling logging will be helpful to do trouble shooting. ### Documentation -Reference documentation is available [here](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.0.1/azure.eventhub.aio.html#azure.eventhub.aio.CheckpointStore) +Reference documentation is available [here](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.aio.html#azure.eventhub.aio.CheckpointStore) ### Provide Feedback diff --git a/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/samples/README.md b/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/samples/README.md index ee5fd05996cc..910db1ebd5e2 100644 --- a/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/samples/README.md +++ b/sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/samples/README.md @@ -42,5 +42,5 @@ pip install azure-eventhub-checkpointstoreblob-aio ## Next steps -Check out the [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.0.1/azure.eventhub.aio.html) to learn more about +Check out the [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.aio.html) to learn more about what you can do with the Azure Event Hubs client library. diff --git a/sdk/eventhub/azure-eventhub-checkpointstoreblob/README.md b/sdk/eventhub/azure-eventhub-checkpointstoreblob/README.md index e91b77ddcdae..55a283b38be1 100644 --- a/sdk/eventhub/azure-eventhub-checkpointstoreblob/README.md +++ b/sdk/eventhub/azure-eventhub-checkpointstoreblob/README.md @@ -5,7 +5,7 @@ This Checkpoint Store package works as a plug-in package to `EventHubConsumerCli Please note that this is a sync library, for async version of the Azure EventHubs Checkpoint Store client library, please refer to [azure-eventhub-checkpointstoreblob-aio](../azure-eventhub-checkpointstoreblob-aio). -[Source code](./) | [Package (PyPi)](https://pypi.org/project/azure-eventhub-checkpointstoreblob) | [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.0.1/azure.eventhub.html#azure.eventhub.CheckpointStore) | [Azure Eventhubs documentation](https://docs.microsoft.com/azure/event-hubs/) | [Azure Storage documentation](https://docs.microsoft.com/azure/storage/) +[Source code](./) | [Package (PyPi)](https://pypi.org/project/azure-eventhub-checkpointstoreblob) | [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.html#azure.eventhub.CheckpointStore) | [Azure Eventhubs documentation](https://docs.microsoft.com/azure/event-hubs/) | [Azure Storage documentation](https://docs.microsoft.com/azure/storage/) ## Getting started @@ -122,7 +122,7 @@ Enabling logging will be helpful to do trouble shooting. ### Documentation -Reference documentation is available [here](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.0.1/azure.eventhub.html#azure.eventhub.CheckpointStore) +Reference documentation is available [here](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.html#azure.eventhub.CheckpointStore) ### Provide Feedback diff --git a/sdk/eventhub/azure-eventhub-checkpointstoreblob/samples/README.md b/sdk/eventhub/azure-eventhub-checkpointstoreblob/samples/README.md index f68cee06440d..4d0083dfb776 100644 --- a/sdk/eventhub/azure-eventhub-checkpointstoreblob/samples/README.md +++ b/sdk/eventhub/azure-eventhub-checkpointstoreblob/samples/README.md @@ -42,5 +42,5 @@ pip install azure-eventhub-checkpointstoreblob ## Next steps -Check out the [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.0.1/azure.eventhub.html) to learn more about +Check out the [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.html) to learn more about what you can do with the Azure Event Hubs client library. diff --git a/sdk/eventhub/azure-eventhub/README.md b/sdk/eventhub/azure-eventhub/README.md index 7b5e59df699d..60a4f4184862 100644 --- a/sdk/eventhub/azure-eventhub/README.md +++ b/sdk/eventhub/azure-eventhub/README.md @@ -13,7 +13,7 @@ The Azure Event Hubs client library allows for publishing and consuming of Azure - Observe interesting operations and interactions happening within your business or other ecosystem, allowing loosely coupled systems to interact without the need to bind them together. - Receive events from one or more publishers, transform them to better meet the needs of your ecosystem, then publish the transformed events to a new stream for consumers to observe. -[Source code](./) | [Package (PyPi)](https://pypi.org/project/azure-eventhub/) | [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.2.0b1/azure.eventhub.html) | [Product documentation](https://docs.microsoft.com/azure/event-hubs/) | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/eventhub/azure-eventhub/samples) +[Source code](./) | [Package (PyPi)](https://pypi.org/project/azure-eventhub/) | [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.html) | [Product documentation](https://docs.microsoft.com/azure/event-hubs/) | [Samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/eventhub/azure-eventhub/samples) ## Getting started ### Prerequisites @@ -412,7 +412,7 @@ Please take a look at the [samples](./samples) directory for detailed examples o ### Documentation -Reference documentation is available [here](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.2.0b1/azure.eventhub.html). +Reference documentation is available [here](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.html). ### Provide Feedback diff --git a/sdk/eventhub/azure-eventhub/migration_guide.md b/sdk/eventhub/azure-eventhub/migration_guide.md index 9dd1de19560b..0c2b40b5302e 100644 --- a/sdk/eventhub/azure-eventhub/migration_guide.md +++ b/sdk/eventhub/azure-eventhub/migration_guide.md @@ -12,10 +12,10 @@ the latest version improves on several areas from V1. ### Specific clients for sending and receiving In V5 we've simplified the API surface, making two distinct clients, rather than having a single `EventHubClient`: -* `EventHubProducerClient` for sending messages. [Sync API](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.1.0/azure.eventhub.html#azure.eventhub.EventHubProducerClient) -and [Async API](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.1.0/azure.eventhub.aio.html#azure.eventhub.aio.EventHubProducerClient) -* `EventHubConsumerClient` for receiving messages. [Sync API](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.1.0/azure.eventhub.html#azure.eventhub.EventHubConsumerClient) -and [Async API](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.1.0/azure.eventhub.aio.html#azure.eventhub.aio.EventHubConsumerClient) +* `EventHubProducerClient` for sending messages. [Sync API](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.html#azure.eventhub.EventHubProducerClient) +and [Async API](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.aio.html#azure.eventhub.aio.EventHubProducerClient) +* `EventHubConsumerClient` for receiving messages. [Sync API](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.html#azure.eventhub.EventHubConsumerClient) +and [Async API](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.aio.html#azure.eventhub.aio.EventHubConsumerClient) We've also merged the functionality from `EventProcessorHost` into `EventHubConsumerClient`, allowing `EventHubConsumerClient` to be the single diff --git a/sdk/eventhub/azure-eventhub/samples/README.md b/sdk/eventhub/azure-eventhub/samples/README.md index ac68f9b0ac71..05c8297dd3c9 100644 --- a/sdk/eventhub/azure-eventhub/samples/README.md +++ b/sdk/eventhub/azure-eventhub/samples/README.md @@ -107,5 +107,5 @@ pip install azure-eventhub-checkpointstoreblob-aio # async version ## Next steps -Check out the [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/5.2.0b1/azure.eventhub.html) to learn more about +Check out the [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/python/azure-eventhub/latest/azure.eventhub.html) to learn more about what you can do with the Azure Event Hubs client library. From df15945356eb26920f49b4ed42a18acd3e1e42f2 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:36:51 -0700 Subject: [PATCH 03/16] Bump template version (#13580) --- sdk/template/azure-template/CHANGELOG.md | 6 ++++++ sdk/template/azure-template/azure/template/_version.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sdk/template/azure-template/CHANGELOG.md b/sdk/template/azure-template/CHANGELOG.md index d20ffa8ebae5..999dfa7dc075 100644 --- a/sdk/template/azure-template/CHANGELOG.md +++ b/sdk/template/azure-template/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 0.0.18b3 (Unreleased) + + +## 0.0.18b2 (2020-09-04) +- Testing release tag version + ## 0.0.13b1 (2020-08-27) - Testing out some alpha and beta versioning diff --git a/sdk/template/azure-template/azure/template/_version.py b/sdk/template/azure-template/azure/template/_version.py index 4a01be0b8d95..29c58807e47e 100644 --- a/sdk/template/azure-template/azure/template/_version.py +++ b/sdk/template/azure-template/azure/template/_version.py @@ -1,2 +1,2 @@ # matches SEMVER -VERSION = "0.0.13b1" \ No newline at end of file +VERSION = "0.0.18b3" \ No newline at end of file From 71ec9a4f338cf811cc9a62a8b5bd3b98532a37fa Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:41:12 -0700 Subject: [PATCH 04/16] Increment package version after release of azure_appconfiguration (#13620) --- sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md | 3 +++ .../azure-appconfiguration/azure/appconfiguration/_version.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md index ce14f7db001f..d9f5862f8ea7 100644 --- a/sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md @@ -3,6 +3,9 @@ ------------------- +## 1.1.1 (Unreleased) + + ## 1.1.0 (2020-09-08) ### Features diff --git a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_version.py b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_version.py index 315754a5f1c3..373777a19de0 100644 --- a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_version.py +++ b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. # ------------------------------------ -VERSION = "1.1.0" +VERSION = "1.1.1" From df7c757c535e7348a0f5183be0b24581103f07a2 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:42:25 -0700 Subject: [PATCH 05/16] Increment package version after release of azure_search_documents (#13622) --- sdk/search/azure-search-documents/CHANGELOG.md | 3 +++ .../azure-search-documents/azure/search/documents/_version.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 303e8492ec52..6d973c008075 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 11.1.0b3 (Unreleased) + + ## 11.1.0b2 (2020-09-08) **Features** diff --git a/sdk/search/azure-search-documents/azure/search/documents/_version.py b/sdk/search/azure-search-documents/azure/search/documents/_version.py index b03133e2adec..30883e81c16d 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_version.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_version.py @@ -3,6 +3,6 @@ # Licensed under the MIT License. # ------------------------------------ -VERSION = "11.1.0b2" # type: str +VERSION = "11.1.0b3" # type: str SDK_MONIKER = "search-documents/{}".format(VERSION) # type: str From 609619b9ffa4f745839d06c44fc89fcf6d03f0fa Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:45:50 -0700 Subject: [PATCH 06/16] Increment package version after release of azure_core (#13621) --- sdk/core/azure-core/CHANGELOG.md | 3 +++ sdk/core/azure-core/azure/core/_version.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 0e0ffcba1434..c1e079d9993a 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -1,6 +1,9 @@ # Release History +## 1.8.2 (Unreleased) + + ## 1.8.1 (2020-09-08) ### Bug fixes diff --git a/sdk/core/azure-core/azure/core/_version.py b/sdk/core/azure-core/azure/core/_version.py index dbc573f39734..ecead3787978 100644 --- a/sdk/core/azure-core/azure/core/_version.py +++ b/sdk/core/azure-core/azure/core/_version.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.8.1" +VERSION = "1.8.2" From 88f67c800bc0410c8a4e3d05a323bb61af308b93 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 8 Sep 2020 10:54:50 -0700 Subject: [PATCH 07/16] Fix data nspkg (#13623) --- sdk/tables/azure-data-nspkg/setup.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sdk/tables/azure-data-nspkg/setup.py b/sdk/tables/azure-data-nspkg/setup.py index 8d9a5455678d..22d5ce226445 100644 --- a/sdk/tables/azure-data-nspkg/setup.py +++ b/sdk/tables/azure-data-nspkg/setup.py @@ -8,13 +8,6 @@ import sys from setuptools import setup -PACKAGES = [] -# Do an empty package on Python 3 and not python_requires, since not everybody is ready -# https://github.com/Azure/azure-sdk-for-python/issues/3447 -# https://github.com/Azure/azure-sdk-for-python/issues/3481 -if sys.version_info[0] < 3: - PACKAGES = ['azure.data'] - setup( name='azure-data-nspkg', version='1.0.0', @@ -38,7 +31,7 @@ "License :: OSI Approved :: MIT License", ], zip_safe=False, - packages=PACKAGES, + packages=['azure.data'], install_requires=[ 'azure-nspkg>=3.0.0', ] From e400440b2608537d78faad12544782381cca18f8 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 8 Sep 2020 11:26:36 -0700 Subject: [PATCH 08/16] Add data nspkg to CI (#13626) --- sdk/tables/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/tables/ci.yml b/sdk/tables/ci.yml index 08864275e05f..31a4be496cac 100644 --- a/sdk/tables/ci.yml +++ b/sdk/tables/ci.yml @@ -37,4 +37,6 @@ extends: Artifacts: - name: azure_data_tables safeName: azuredatatables + - name: azure_data_nspkg + safeName: azuredatanspkg From 7e4571c80bb72a12024a4645ca28f788cbd3af1c Mon Sep 17 00:00:00 2001 From: Yijun Xie <48257664+YijunXieMS@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:03:01 -0700 Subject: [PATCH 09/16] Update EH and SB code owner (#13633) --- .github/CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1822a5b802b5..38d07437c981 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -20,7 +20,7 @@ /sdk/identity/ @chlowell @schaabs # PRLabel: %Event Hubs -/sdk/eventhub/ @annatisch @yunhaoling @YijunXieMS +/sdk/eventhub/ @annatisch @yunhaoling @KieranBrantnerMagee # PRLabel: %Storage /sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft @tasherif-msft @kasobol-msft @@ -77,7 +77,7 @@ /sql/sql/ @jaredmoo # PRLabel: %Service Bus -/sdk/servicebus/ @annatisch @yunhaoling @YijunXieMS @KieranBrantnerMagee +/sdk/servicebus/ @annatisch @yunhaoling @KieranBrantnerMagee # PRLabel: %Synapse /sdk/synapse/ @aim-for-better @idear1203 From 6e6040adb92bbcc1c1f2fb4ee3da18fa0f080241 Mon Sep 17 00:00:00 2001 From: KieranBrantnerMagee Date: Tue, 8 Sep 2020 12:10:47 -0700 Subject: [PATCH 10/16] Rename ServiceBusManagementClient to ServiceBusAdministrationClient (#13597) * Rename ServiceBusManagementClient to ServiceBusAdministrationClient --- sdk/servicebus/azure-servicebus/CHANGELOG.md | 1 + .../servicebus/aio/management/__init__.py | 4 +- .../management/_management_client_async.py | 8 +-- .../azure/servicebus/management/__init__.py | 4 +- .../management/_management_client.py | 6 +-- .../azure-servicebus/migration_guide.md | 4 +- .../samples/async_samples/mgmt_queue_async.py | 4 +- .../samples/sync_samples/mgmt_queue.py | 4 +- .../mgmt_tests/test_mgmt_queues_async.py | 50 +++++++++---------- .../mgmt_tests/test_mgmt_rules_async.py | 14 +++--- .../test_mgmt_subscriptions_async.py | 22 ++++---- .../mgmt_tests/test_mgmt_topics_async.py | 22 ++++---- .../tests/mgmt_tests/test_mgmt_queues.py | 50 +++++++++---------- .../tests/mgmt_tests/test_mgmt_rules.py | 14 +++--- .../mgmt_tests/test_mgmt_subscriptions.py | 22 ++++---- .../tests/mgmt_tests/test_mgmt_topics.py | 22 ++++---- 16 files changed, 126 insertions(+), 125 deletions(-) diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index b80ba58c5888..6d9966e32314 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -8,6 +8,7 @@ **Breaking Changes** +* Rename `ServiceBusManagementClient` to `ServiceBusAdministrationClient` * Attempting to call `send_messages` on something not a `Message`, `BatchMessage`, or list of `Message`s, will now throw a `TypeError` instead of `ValueError` * Sending a message twice will no longer result in a MessageAlreadySettled exception. * `ServiceBusClient.close()` now closes spawned senders and receivers. diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/__init__.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/__init__.py index 5bdc30d9c9ab..5e0d0ee92e0e 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/__init__.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/__init__.py @@ -3,8 +3,8 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from ._management_client_async import ServiceBusManagementClient +from ._management_client_async import ServiceBusAdministrationClient __all__ = [ - "ServiceBusManagementClient", + "ServiceBusAdministrationClient", ] 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..304d04d46d76 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 @@ -44,7 +44,7 @@ from azure.core.credentials_async import AsyncTokenCredential # pylint:disable=ungrouped-imports -class ServiceBusManagementClient: #pylint:disable=too-many-public-methods +class ServiceBusAdministrationClient: #pylint:disable=too-many-public-methods """Use this client to create, update, list, and delete resources of a ServiceBus namespace. :param str fully_qualified_namespace: The fully qualified host name for the Service Bus namespace. @@ -64,7 +64,7 @@ def __init__( self._pipeline = self._build_pipeline() self._impl = ServiceBusManagementClientImpl(endpoint=fully_qualified_namespace, pipeline=self._pipeline) - async def __aenter__(self) -> "ServiceBusManagementClient": + async def __aenter__(self) -> "ServiceBusAdministrationClient": await self._impl.__aenter__() return self @@ -130,11 +130,11 @@ async def _get_rule_element(self, topic_name, subscription_name, rule_name, **kw return element @classmethod - def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "ServiceBusManagementClient": + def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "ServiceBusAdministrationClient": """Create a client from connection string. :param str conn_str: The connection string of the Service Bus Namespace. - :rtype: ~azure.servicebus.management.aio.ServiceBusManagementClient + :rtype: ~azure.servicebus.management.aio.ServiceBusAdministrationClient """ endpoint, shared_access_key_name, shared_access_key, _ = parse_conn_str(conn_str) if "//" in endpoint: diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/__init__.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/__init__.py index 41f9230c874e..79d44d630e69 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/__init__.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/__init__.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from ._management_client import ServiceBusManagementClient +from ._management_client import ServiceBusAdministrationClient from ._generated.models import AuthorizationRule, MessageCountDetails, \ AccessRights, EntityAvailabilityStatus, EntityStatus, \ NamespaceProperties, MessagingSku, NamespaceType @@ -14,7 +14,7 @@ SqlRuleAction __all__ = [ - 'ServiceBusManagementClient', + 'ServiceBusAdministrationClient', 'AuthorizationRule', 'MessageCountDetails', 'QueueProperties', 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..d0238b70f8a3 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py @@ -41,7 +41,7 @@ from azure.core.credentials import TokenCredential # pylint:disable=ungrouped-imports -class ServiceBusManagementClient: # pylint:disable=too-many-public-methods +class ServiceBusAdministrationClient: # pylint:disable=too-many-public-methods """Use this client to create, update, list, and delete resources of a ServiceBus namespace. :param str fully_qualified_namespace: The fully qualified host name for the Service Bus namespace. @@ -124,11 +124,11 @@ def _get_rule_element(self, topic_name, subscription_name, rule_name, **kwargs): @classmethod def from_connection_string(cls, conn_str, **kwargs): - # type: (str, Any) -> ServiceBusManagementClient + # type: (str, Any) -> ServiceBusAdministrationClient """Create a client from connection string. :param str conn_str: The connection string of the Service Bus Namespace. - :rtype: ~azure.servicebus.management.ServiceBusManagementClient + :rtype: ~azure.servicebus.management.ServiceBusAdministrationClient """ endpoint, shared_access_key_name, shared_access_key, _ = parse_conn_str(conn_str) if "//" in endpoint: diff --git a/sdk/servicebus/azure-servicebus/migration_guide.md b/sdk/servicebus/azure-servicebus/migration_guide.md index 8cc0aefd8c8e..deb41d4e6262 100644 --- a/sdk/servicebus/azure-servicebus/migration_guide.md +++ b/sdk/servicebus/azure-servicebus/migration_guide.md @@ -75,8 +75,8 @@ semantics with the sender or receiver lifetime. ### Managing queues | In v0.50 | Equivalent in v7 | Sample | |---|---|---| -| `azure.servicebus.control_client.ServiceBusService().create_queue(queue_name)` | `azure.servicebus.management.ServiceBusManagementClient().create_queue(queue_name)` | [Create a queue](./samples/sync_samples/mgmt_queue.py) | -| `azure.servicebus.ServiceBusClient().list_queues()` | `azure.servicebus.management.ServiceBusManagementClient().list_queues()` | [List queues](./samples/sync_samples/mgmt_queue.py ) | +| `azure.servicebus.control_client.ServiceBusService().create_queue(queue_name)` | `azure.servicebus.management.ServiceBusAdministrationClient().create_queue(queue_name)` | [Create a queue](./samples/sync_samples/mgmt_queue.py) | +| `azure.servicebus.ServiceBusClient().list_queues()` | `azure.servicebus.management.ServiceBusAdministrationClient().list_queues()` | [List queues](./samples/sync_samples/mgmt_queue.py ) | ### Working with AutoLockRenew | In v0.50 | Equivalent in v7 | Sample | diff --git a/sdk/servicebus/azure-servicebus/samples/async_samples/mgmt_queue_async.py b/sdk/servicebus/azure-servicebus/samples/async_samples/mgmt_queue_async.py index becc4afe7f20..e73707ed60d6 100644 --- a/sdk/servicebus/azure-servicebus/samples/async_samples/mgmt_queue_async.py +++ b/sdk/servicebus/azure-servicebus/samples/async_samples/mgmt_queue_async.py @@ -18,7 +18,7 @@ import os import asyncio -from azure.servicebus.aio.management import ServiceBusManagementClient +from azure.servicebus.aio.management import ServiceBusAdministrationClient CONNECTION_STR = os.environ['SERVICE_BUS_CONNECTION_STR'] QUEUE_NAME = "sb_mgmt_demo_queue" @@ -72,7 +72,7 @@ async def get_queue_runtime_info(servicebus_mgmt_client): async def main(): - async with ServiceBusManagementClient.from_connection_string(CONNECTION_STR) as servicebus_mgmt_client: + async with ServiceBusAdministrationClient.from_connection_string(CONNECTION_STR) as servicebus_mgmt_client: await create_queue(servicebus_mgmt_client) await list_queues(servicebus_mgmt_client) await get_and_update_queue(servicebus_mgmt_client) diff --git a/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py b/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py index f9a834e008bf..2302bd71b045 100644 --- a/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py +++ b/sdk/servicebus/azure-servicebus/samples/sync_samples/mgmt_queue.py @@ -17,7 +17,7 @@ # pylint: disable=C0111 import os -from azure.servicebus.management import ServiceBusManagementClient +from azure.servicebus.management import ServiceBusAdministrationClient CONNECTION_STR = os.environ['SERVICE_BUS_CONNECTION_STR'] QUEUE_NAME = "sb_mgmt_demo_queue" @@ -70,7 +70,7 @@ def get_queue_runtime_info(servicebus_mgmt_client): print("") -with ServiceBusManagementClient.from_connection_string(CONNECTION_STR) as servicebus_mgmt_client: +with ServiceBusAdministrationClient.from_connection_string(CONNECTION_STR) as servicebus_mgmt_client: create_queue(servicebus_mgmt_client) list_queues(servicebus_mgmt_client) get_and_update_queue(servicebus_mgmt_client) 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..261ac2f694a3 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 @@ -8,7 +8,7 @@ import msrest from azure.core.exceptions import HttpResponseError, ResourceNotFoundError, ResourceExistsError -from azure.servicebus.aio.management import ServiceBusManagementClient +from azure.servicebus.aio.management import ServiceBusAdministrationClient from azure.servicebus.management import QueueProperties from azure.servicebus.aio import ServiceBusSharedKeyCredential from azure.servicebus._common.utils import utc_now @@ -29,13 +29,13 @@ ) -class ServiceBusManagementClientQueueAsyncTests(AzureMgmtTestCase): +class ServiceBusAdministrationClientQueueAsyncTests(AzureMgmtTestCase): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_list_basic(self, servicebus_namespace_connection_string, servicebus_namespace, servicebus_namespace_key_name, servicebus_namespace_primary_key): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) queues = await async_pageable_to_list(mgmt_service.list_queues()) assert len(queues) == 0 @@ -47,7 +47,7 @@ async def test_async_mgmt_queue_list_basic(self, servicebus_namespace_connection assert len(queues) == 0 fully_qualified_namespace = servicebus_namespace.name + '.servicebus.windows.net' - mgmt_service = ServiceBusManagementClient( + mgmt_service = ServiceBusAdministrationClient( fully_qualified_namespace, credential=ServiceBusSharedKeyCredential(servicebus_namespace_key_name, servicebus_namespace_primary_key) ) @@ -65,7 +65,7 @@ async def test_async_mgmt_queue_list_basic(self, servicebus_namespace_connection async def test_async_mgmt_queue_list_with_special_chars(self, servicebus_namespace_connection_string): # Queue names can contain letters, numbers, periods (.), hyphens (-), underscores (_), and slashes (/), up to 260 characters. Queue names are also case-insensitive. queue_name = 'txt/.-_123' - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) queues = await async_pageable_to_list(mgmt_service.list_queues()) assert len(queues) == 0 @@ -80,7 +80,7 @@ async def test_async_mgmt_queue_list_with_special_chars(self, servicebus_namespa @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_list_with_parameters(self, servicebus_namespace_connection_string): pytest.skip("start_idx and max_count are currently removed, they might come back in the future.") - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await run_test_async_mgmt_list_with_parameters(AsyncMgmtQueueListTestHelper(mgmt_service)) @CachedResourceGroupPreparer(name_prefix='servicebustest') @@ -88,17 +88,17 @@ async def test_async_mgmt_queue_list_with_parameters(self, servicebus_namespace_ async def test_async_mgmt_queue_list_with_negative_credential(self, servicebus_namespace, servicebus_namespace_key_name, servicebus_namespace_primary_key): # invalid_conn_str = 'Endpoint=sb://invalid.servicebus.windows.net/;SharedAccessKeyName=invalid;SharedAccessKey=invalid' - # mgmt_service = ServiceBusManagementClient.from_connection_string(invalid_conn_str) + # mgmt_service = ServiceBusAdministrationClient.from_connection_string(invalid_conn_str) # with pytest.raises(ServiceRequestError): # await async_pageable_to_list(mgmt_service.list_queues()) invalid_conn_str = 'Endpoint=sb://{}.servicebus.windows.net/;SharedAccessKeyName=invalid;SharedAccessKey=invalid'.format(servicebus_namespace.name) - mgmt_service = ServiceBusManagementClient.from_connection_string(invalid_conn_str) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(invalid_conn_str) with pytest.raises(HttpResponseError): await async_pageable_to_list(mgmt_service.list_queues()) # fully_qualified_namespace = 'invalid.servicebus.windows.net' - # mgmt_service = ServiceBusManagementClient( + # mgmt_service = ServiceBusAdministrationClient( # fully_qualified_namespace, # credential=ServiceBusSharedKeyCredential(servicebus_namespace_key_name, servicebus_namespace_primary_key) # ) @@ -106,7 +106,7 @@ async def test_async_mgmt_queue_list_with_negative_credential(self, servicebus_n # await async_pageable_to_list(mgmt_service.list_queues()) fully_qualified_namespace = servicebus_namespace.name + '.servicebus.windows.net' - mgmt_service = ServiceBusManagementClient( + mgmt_service = ServiceBusAdministrationClient( fully_qualified_namespace, credential=ServiceBusSharedKeyCredential("invalid", "invalid") ) @@ -117,13 +117,13 @@ async def test_async_mgmt_queue_list_with_negative_credential(self, servicebus_n @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_list_with_negative_parameters(self, servicebus_namespace_connection_string): pytest.skip("start_idx and max_count are currently removed, they might come back in the future.") - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await run_test_async_mgmt_list_with_negative_parameters(AsyncMgmtQueueListTestHelper(mgmt_service)) @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_delete_basic(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) await mgmt_service.create_queue("test_queue") queues = await async_pageable_to_list(mgmt_service.list_queues()) @@ -146,7 +146,7 @@ async def test_async_mgmt_queue_delete_basic(self, servicebus_namespace_connecti @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_delete_one_and_check_not_existing(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) for i in range(10): await mgmt_service.create_queue("queue{}".format(i)) @@ -166,7 +166,7 @@ async def test_async_mgmt_queue_delete_one_and_check_not_existing(self, serviceb @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_delete_negtive(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) await mgmt_service.create_queue("test_queue") queues = await async_pageable_to_list(mgmt_service.list_queues()) @@ -191,7 +191,7 @@ async def test_async_mgmt_queue_delete_negtive(self, servicebus_namespace_connec @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_create_by_name(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) queue_name = "eidk" created_at = utc_now() @@ -208,7 +208,7 @@ async def test_async_mgmt_queue_create_by_name(self, servicebus_namespace_connec @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_create_with_invalid_name(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) with pytest.raises(msrest.exceptions.ValidationError): await mgmt_service.create_queue(Exception()) @@ -220,7 +220,7 @@ async def test_async_mgmt_queue_create_with_invalid_name(self, servicebus_namesp @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_create_with_queue_description(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) queue_name = "dkldf" await mgmt_service.create_queue(queue_name, @@ -262,7 +262,7 @@ async def test_async_mgmt_queue_create_with_queue_description(self, servicebus_n @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_create_duplicate(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) queue_name = "eriodk" await mgmt_service.create_queue(queue_name) @@ -275,7 +275,7 @@ async def test_async_mgmt_queue_create_duplicate(self, servicebus_namespace_conn @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_update_success(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) queue_name = "ewuidfj" queue_description = await mgmt_service.create_queue(queue_name) @@ -326,7 +326,7 @@ async def test_async_mgmt_queue_update_success(self, servicebus_namespace_connec @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_update_invalid(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) queue_name = "vbmfm" queue_description = await mgmt_service.create_queue(queue_name) @@ -368,7 +368,7 @@ async def test_async_mgmt_queue_update_invalid(self, servicebus_namespace_connec @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_list_runtime_info_basic(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) queues = await async_pageable_to_list(mgmt_service.list_queues()) queues_infos = await async_pageable_to_list(mgmt_service.list_queues_runtime_info()) @@ -405,20 +405,20 @@ async def test_async_mgmt_queue_list_runtime_info_basic(self, servicebus_namespa @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_list_runtime_info_with_negative_parameters(self, servicebus_namespace_connection_string): pytest.skip("start_idx and max_count are currently removed, they might come back in the future.") - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await run_test_async_mgmt_list_with_negative_parameters(AsyncMgmtQueueListRuntimeInfoTestHelper(mgmt_service)) @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_list_runtime_info_with_parameters(self, servicebus_namespace_connection_string): pytest.skip("start_idx and max_count are currently removed, they might come back in the future.") - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await run_test_async_mgmt_list_with_parameters(AsyncMgmtQueueListRuntimeInfoTestHelper(mgmt_service)) @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_get_runtime_info_basic(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_queues(mgmt_service) await mgmt_service.create_queue("test_queue") queue_runtime_info = await mgmt_service.get_queue_runtime_info("test_queue") @@ -440,7 +440,7 @@ async def test_async_mgmt_queue_get_runtime_info_basic(self, servicebus_namespac @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_queue_get_runtime_info_negative(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) with pytest.raises(msrest.exceptions.ValidationError): await mgmt_service.get_queue_runtime_info(None) diff --git a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_rules_async.py b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_rules_async.py index dc91b2ce9cf3..4ef9ef6d8ef3 100644 --- a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_rules_async.py +++ b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_rules_async.py @@ -9,7 +9,7 @@ import pytest import msrest -from azure.servicebus.aio.management import ServiceBusManagementClient +from azure.servicebus.aio.management import ServiceBusAdministrationClient from azure.servicebus.management import RuleProperties, CorrelationRuleFilter, SqlRuleFilter, TrueRuleFilter, SqlRuleAction from azure.servicebus.management._constants import INT32_MAX_VALUE from utilities import get_logger @@ -25,11 +25,11 @@ _logger = get_logger(logging.DEBUG) -class ServiceBusManagementClientRuleAsyncTests(AzureMgmtTestCase): +class ServiceBusAdministrationClientRuleAsyncTests(AzureMgmtTestCase): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_rule_create(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "topic_testaddf" subscription_name = "sub_testkkk" @@ -93,7 +93,7 @@ async def test_async_mgmt_rule_create(self, servicebus_namespace_connection_stri @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_rule_create_duplicate(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "dqkodq" subscription_name = 'kkaqo' @@ -113,7 +113,7 @@ async def test_async_mgmt_rule_create_duplicate(self, servicebus_namespace_conne @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_rule_update_success(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "fjrui" subscription_name = "eqkovc" @@ -150,7 +150,7 @@ async def test_async_mgmt_rule_update_success(self, servicebus_namespace_connect @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_rule_update_invalid(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "fjrui" subscription_name = "eqkovc" @@ -192,7 +192,7 @@ async def test_async_mgmt_rule_update_invalid(self, servicebus_namespace_connect @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_rule_list_and_delete(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "topic_testaddf" subscription_name = "sub_testkkk" 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..8b74b970e2c5 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 @@ -8,7 +8,7 @@ import datetime import msrest -from azure.servicebus.aio.management import ServiceBusManagementClient +from azure.servicebus.aio.management import ServiceBusAdministrationClient from azure.servicebus.management import SubscriptionProperties from utilities import get_logger from azure.core.exceptions import HttpResponseError, ResourceExistsError @@ -24,11 +24,11 @@ _logger = get_logger(logging.DEBUG) -class ServiceBusManagementClientSubscriptionAsyncTests(AzureMgmtTestCase): +class ServiceBusAdministrationClientSubscriptionAsyncTests(AzureMgmtTestCase): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_subscription_create_by_name(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "topic_testaddf" subscription_name = "sub_testkkk" @@ -47,7 +47,7 @@ async def test_async_mgmt_subscription_create_by_name(self, servicebus_namespace @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_subscription_create_with_subscription_description(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "iweidk" subscription_name = "kdosako" @@ -80,7 +80,7 @@ async def test_async_mgmt_subscription_create_with_subscription_description(self @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_subscription_create_duplicate(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "dqkodq" subscription_name = 'kkaqo' @@ -96,7 +96,7 @@ async def test_async_mgmt_subscription_create_duplicate(self, servicebus_namespa @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_subscription_update_success(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "fjrui" subscription_name = "eqkovc" @@ -137,7 +137,7 @@ async def test_async_mgmt_subscription_update_success(self, servicebus_namespace @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_subscription_update_invalid(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "dfjfj" subscription_name = "kwqxc" @@ -177,7 +177,7 @@ async def test_async_mgmt_subscription_update_invalid(self, servicebus_namespace @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_subscription_delete(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = 'test_topicgda' subscription_name_1 = 'test_sub1da' @@ -207,7 +207,7 @@ async def test_async_mgmt_subscription_delete(self, servicebus_namespace_connect @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_subscription_list(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = 'lkoqxc' subscription_name_1 = 'testsub1' @@ -231,7 +231,7 @@ async def test_async_mgmt_subscription_list(self, servicebus_namespace_connectio @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_subscription_list_runtime_info(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = 'dkoamv' subscription_name = 'cxqplc' @@ -271,7 +271,7 @@ async def test_async_mgmt_subscription_list_runtime_info(self, servicebus_namesp @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_subscription_get_runtime_info_basic(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = 'dcvxqa' subscription_name = 'xvazzag' 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..39a2c2388f43 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 @@ -8,7 +8,7 @@ import datetime import msrest -from azure.servicebus.aio.management import ServiceBusManagementClient +from azure.servicebus.aio.management import ServiceBusAdministrationClient from azure.servicebus.management import TopicProperties from utilities import get_logger from azure.core.exceptions import HttpResponseError, ResourceExistsError @@ -24,11 +24,11 @@ _logger = get_logger(logging.DEBUG) -class ServiceBusManagementClientTopicAsyncTests(AzureMgmtTestCase): +class ServiceBusAdministrationClientTopicAsyncTests(AzureMgmtTestCase): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_topic_create_by_name(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "topic_testaddf" @@ -44,7 +44,7 @@ async def test_async_mgmt_topic_create_by_name(self, servicebus_namespace_connec @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_topic_create_with_topic_description(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "iweidk" try: @@ -77,7 +77,7 @@ async def test_async_mgmt_topic_create_with_topic_description(self, servicebus_n @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_topic_create_duplicate(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "dqkodq" try: @@ -90,7 +90,7 @@ async def test_async_mgmt_topic_create_duplicate(self, servicebus_namespace_conn @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_topic_update_success(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "fjrui" try: @@ -135,7 +135,7 @@ async def test_async_mgmt_topic_update_success(self, servicebus_namespace_connec @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_topic_update_invalid(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topic_name = "dfjfj" try: @@ -172,7 +172,7 @@ async def test_async_mgmt_topic_update_invalid(self, servicebus_namespace_connec @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_topic_delete(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) await mgmt_service.create_topic('test_topic') topics = await async_pageable_to_list(mgmt_service.list_topics()) @@ -197,7 +197,7 @@ async def test_async_mgmt_topic_delete(self, servicebus_namespace_connection_str @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_topic_list(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topics = await async_pageable_to_list(mgmt_service.list_topics()) assert len(topics) == 0 @@ -215,7 +215,7 @@ async def test_async_mgmt_topic_list(self, servicebus_namespace_connection_strin @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_topic_list_runtime_info(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) topics = await async_pageable_to_list(mgmt_service.list_topics()) topics_infos = await async_pageable_to_list(mgmt_service.list_topics_runtime_info()) @@ -246,7 +246,7 @@ async def test_async_mgmt_topic_list_runtime_info(self, servicebus_namespace_con @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') async def test_async_mgmt_topic_get_runtime_info_basic(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) await clear_topics(mgmt_service) await mgmt_service.create_topic("test_topic") try: 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..36c2bf390451 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 @@ -11,7 +11,7 @@ import functools import msrest -from azure.servicebus.management import ServiceBusManagementClient, QueueProperties +from azure.servicebus.management import ServiceBusAdministrationClient, QueueProperties from azure.servicebus._common.utils import utc_now from utilities import get_logger from azure.core.exceptions import HttpResponseError, ServiceRequestError, ResourceNotFoundError, ResourceExistsError @@ -33,12 +33,12 @@ _logger = get_logger(logging.DEBUG) -class ServiceBusManagementClientQueueTests(AzureMgmtTestCase): +class ServiceBusAdministrationClientQueueTests(AzureMgmtTestCase): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_list_basic(self, servicebus_namespace_connection_string, servicebus_namespace, servicebus_namespace_key_name, servicebus_namespace_primary_key): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) @@ -52,7 +52,7 @@ def test_mgmt_queue_list_basic(self, servicebus_namespace_connection_string, ser assert len(queues) == 0 fully_qualified_namespace = servicebus_namespace.name + '.servicebus.windows.net' - mgmt_service = ServiceBusManagementClient( + mgmt_service = ServiceBusAdministrationClient( fully_qualified_namespace, credential=ServiceBusSharedKeyCredential(servicebus_namespace_key_name, servicebus_namespace_primary_key) ) @@ -70,7 +70,7 @@ def test_mgmt_queue_list_basic(self, servicebus_namespace_connection_string, ser def test_mgmt_queue_list_with_special_chars(self, servicebus_namespace_connection_string): # Queue names can contain letters, numbers, periods (.), hyphens (-), underscores (_), and slashes (/), up to 260 characters. Queue names are also case-insensitive. queue_name = 'txt/.-_123' - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) queues = list(mgmt_service.list_queues()) assert len(queues) == 0 @@ -85,7 +85,7 @@ def test_mgmt_queue_list_with_special_chars(self, servicebus_namespace_connectio @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_list_with_parameters(self, servicebus_namespace_connection_string): pytest.skip("start_idx and max_count are currently removed, they might come back in the future.") - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) run_test_mgmt_list_with_parameters(MgmtQueueListTestHelper(mgmt_service)) @CachedResourceGroupPreparer(name_prefix='servicebustest') @@ -93,18 +93,18 @@ def test_mgmt_queue_list_with_parameters(self, servicebus_namespace_connection_s def test_mgmt_queue_list_with_negative_credential(self, servicebus_namespace, servicebus_namespace_key_name, servicebus_namespace_primary_key): # invalid_conn_str = 'Endpoint=sb://invalid.servicebus.windows.net/;SharedAccessKeyName=invalid;SharedAccessKey=invalid' - # mgmt_service = ServiceBusManagementClient.from_connection_string(invalid_conn_str) + # mgmt_service = ServiceBusAdministrationClient.from_connection_string(invalid_conn_str) # with pytest.raises(ServiceRequestError): # list(mgmt_service.list_queues()) # TODO: This negative test makes replay test fail. Need more investigation. Live test has no problem. invalid_conn_str = 'Endpoint=sb://{}.servicebus.windows.net/;SharedAccessKeyName=invalid;SharedAccessKey=invalid'.format(servicebus_namespace.name) - mgmt_service = ServiceBusManagementClient.from_connection_string(invalid_conn_str) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(invalid_conn_str) with pytest.raises(HttpResponseError): list(mgmt_service.list_queues()) # fully_qualified_namespace = 'invalid.servicebus.windows.net' - # mgmt_service = ServiceBusManagementClient( + # mgmt_service = ServiceBusAdministrationClient( # fully_qualified_namespace, # credential=ServiceBusSharedKeyCredential(servicebus_namespace_key_name, servicebus_namespace_primary_key) # ) @@ -112,7 +112,7 @@ def test_mgmt_queue_list_with_negative_credential(self, servicebus_namespace, se # list(mgmt_service.list_queues()) fully_qualified_namespace = servicebus_namespace.name + '.servicebus.windows.net' - mgmt_service = ServiceBusManagementClient( + mgmt_service = ServiceBusAdministrationClient( fully_qualified_namespace, credential=ServiceBusSharedKeyCredential("invalid", "invalid") ) @@ -123,13 +123,13 @@ def test_mgmt_queue_list_with_negative_credential(self, servicebus_namespace, se @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_list_with_negative_parameters(self, servicebus_namespace_connection_string): pytest.skip("start_idx and max_count are currently removed, they might come back in the future.") - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) run_test_mgmt_list_with_negative_parameters(MgmtQueueListTestHelper(mgmt_service)) @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_delete_basic(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) mgmt_service.create_queue("test_queue") queues = list(mgmt_service.list_queues()) @@ -152,7 +152,7 @@ def test_mgmt_queue_delete_basic(self, servicebus_namespace_connection_string): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_delete_one_and_check_not_existing(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) for i in range(10): mgmt_service.create_queue("queue{}".format(i)) @@ -172,7 +172,7 @@ def test_mgmt_queue_delete_one_and_check_not_existing(self, servicebus_namespace @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_delete_negtive(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) mgmt_service.create_queue("test_queue") queues = list(mgmt_service.list_queues()) @@ -198,7 +198,7 @@ def test_mgmt_queue_delete_negtive(self, servicebus_namespace_connection_string) @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_create_by_name(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) queue_name = "queue_testaddf" mgmt_service.create_queue(queue_name) @@ -216,7 +216,7 @@ def test_mgmt_queue_create_by_name(self, servicebus_namespace_connection_string, @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_create_with_invalid_name(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) with pytest.raises(msrest.exceptions.ValidationError): mgmt_service.create_queue(Exception()) @@ -230,7 +230,7 @@ def test_mgmt_queue_create_with_invalid_name(self, servicebus_namespace_connecti @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_create_with_queue_description(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) queue_name = "iweidk" @@ -280,7 +280,7 @@ def test_mgmt_queue_create_with_queue_description(self, servicebus_namespace_con @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_create_duplicate(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) queue_name = "rtofdk" mgmt_service.create_queue(queue_name) @@ -294,7 +294,7 @@ def test_mgmt_queue_create_duplicate(self, servicebus_namespace_connection_strin @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_update_success(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) queue_name = "fjrui" queue_description = mgmt_service.create_queue(queue_name) @@ -346,7 +346,7 @@ def test_mgmt_queue_update_success(self, servicebus_namespace_connection_string, @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_update_invalid(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) queue_name = "dfjfj" queue_description = mgmt_service.create_queue(queue_name) @@ -388,7 +388,7 @@ def test_mgmt_queue_update_invalid(self, servicebus_namespace_connection_string, @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_list_runtime_info_basic(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) queues = list(mgmt_service.list_queues()) queues_infos = list(mgmt_service.list_queues_runtime_info()) @@ -425,20 +425,20 @@ def test_mgmt_queue_list_runtime_info_basic(self, servicebus_namespace_connectio @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_list_runtime_info_with_negative_parameters(self, servicebus_namespace_connection_string): pytest.skip("start_idx and max_count are currently removed, they might come back in the future.") - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) run_test_mgmt_list_with_negative_parameters(MgmtQueueListRuntimeInfoTestHelper(mgmt_service)) @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_list_runtime_info_with_parameters(self, servicebus_namespace_connection_string): pytest.skip("start_idx and max_count are currently removed, they might come back in the future.") - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) run_test_mgmt_list_with_parameters(MgmtQueueListRuntimeInfoTestHelper(mgmt_service)) @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_get_runtime_info_basic(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_queues(mgmt_service) mgmt_service.create_queue("test_queue") try: @@ -463,7 +463,7 @@ def test_mgmt_queue_get_runtime_info_basic(self, servicebus_namespace_connection @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_queue_get_runtime_info_negative(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) with pytest.raises(msrest.exceptions.ValidationError): mgmt_service.get_queue_runtime_info(None) diff --git a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_rules.py b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_rules.py index 7c87fb983564..20b0baf75e0c 100644 --- a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_rules.py +++ b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_rules.py @@ -8,7 +8,7 @@ from datetime import datetime, timedelta import msrest -from azure.servicebus.management import ServiceBusManagementClient, RuleProperties, CorrelationRuleFilter, SqlRuleFilter, TrueRuleFilter, FalseRuleFilter, SqlRuleAction +from azure.servicebus.management import ServiceBusAdministrationClient, RuleProperties, CorrelationRuleFilter, SqlRuleFilter, TrueRuleFilter, FalseRuleFilter, SqlRuleAction from azure.servicebus.management._constants import INT32_MAX_VALUE from utilities import get_logger from azure.core.exceptions import HttpResponseError, ResourceExistsError @@ -23,11 +23,11 @@ _logger = get_logger(logging.DEBUG) -class ServiceBusManagementClientRuleTests(AzureMgmtTestCase): +class ServiceBusAdministrationClientRuleTests(AzureMgmtTestCase): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_rule_create(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "topic_testaddf" subscription_name = "sub_testkkk" @@ -108,7 +108,7 @@ def test_mgmt_rule_create(self, servicebus_namespace_connection_string, **kwargs @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_rule_create_duplicate(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "dqkodq" subscription_name = 'kkaqo' @@ -128,7 +128,7 @@ def test_mgmt_rule_create_duplicate(self, servicebus_namespace_connection_string @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_rule_update_success(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "fjrui" subscription_name = "eqkovc" @@ -165,7 +165,7 @@ def test_mgmt_rule_update_success(self, servicebus_namespace_connection_string, @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_rule_update_invalid(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "fjrui" subscription_name = "eqkovc" @@ -207,7 +207,7 @@ def test_mgmt_rule_update_invalid(self, servicebus_namespace_connection_string, @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_rule_list_and_delete(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "topic_testaddf" subscription_name = "sub_testkkk" 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..ae19f04d25b9 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 @@ -8,7 +8,7 @@ import datetime import msrest -from azure.servicebus.management import ServiceBusManagementClient, SubscriptionProperties +from azure.servicebus.management import ServiceBusAdministrationClient, SubscriptionProperties from utilities import get_logger from azure.core.exceptions import HttpResponseError, ResourceExistsError @@ -23,11 +23,11 @@ _logger = get_logger(logging.DEBUG) -class ServiceBusManagementClientSubscriptionTests(AzureMgmtTestCase): +class ServiceBusAdministrationClientSubscriptionTests(AzureMgmtTestCase): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_subscription_create_by_name(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "topic_testaddf" subscription_name = "sub_testkkk" @@ -46,7 +46,7 @@ def test_mgmt_subscription_create_by_name(self, servicebus_namespace_connection_ @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_subscription_create_with_subscription_description(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "iweidk" subscription_name = "kdosako" @@ -79,7 +79,7 @@ def test_mgmt_subscription_create_with_subscription_description(self, servicebus @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_subscription_create_duplicate(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "dqkodq" subscription_name = 'kkaqo' @@ -95,7 +95,7 @@ def test_mgmt_subscription_create_duplicate(self, servicebus_namespace_connectio @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_subscription_update_success(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "fjrui" subscription_name = "eqkovc" @@ -136,7 +136,7 @@ def test_mgmt_subscription_update_success(self, servicebus_namespace_connection_ @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_subscription_update_invalid(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "dfjfj" subscription_name = "kwqxc" @@ -176,7 +176,7 @@ def test_mgmt_subscription_update_invalid(self, servicebus_namespace_connection_ @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_subscription_delete(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = 'test_topicgda' subscription_name_1 = 'test_sub1da' @@ -206,7 +206,7 @@ def test_mgmt_subscription_delete(self, servicebus_namespace_connection_string): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_subscription_list(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = 'lkoqxc' subscription_name_1 = 'testsub1' @@ -230,7 +230,7 @@ def test_mgmt_subscription_list(self, servicebus_namespace_connection_string, ** @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_subscription_list_runtime_info(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = 'dkoamv' subscription_name = 'cxqplc' @@ -269,7 +269,7 @@ def test_mgmt_subscription_list_runtime_info(self, servicebus_namespace_connecti @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_subscription_get_runtime_info_basic(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = 'dcvxqa' subscription_name = 'xvazzag' 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..c85ee6f36861 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 @@ -8,7 +8,7 @@ import datetime import msrest -from azure.servicebus.management import ServiceBusManagementClient, TopicProperties +from azure.servicebus.management import ServiceBusAdministrationClient, TopicProperties from utilities import get_logger from azure.core.exceptions import HttpResponseError, ResourceExistsError @@ -23,11 +23,11 @@ _logger = get_logger(logging.DEBUG) -class ServiceBusManagementClientTopicTests(AzureMgmtTestCase): +class ServiceBusAdministrationClientTopicTests(AzureMgmtTestCase): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_topic_create_by_name(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "topic_testaddf" @@ -43,7 +43,7 @@ def test_mgmt_topic_create_by_name(self, servicebus_namespace_connection_string, @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_topic_create_with_topic_description(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "iweidk" try: @@ -76,7 +76,7 @@ def test_mgmt_topic_create_with_topic_description(self, servicebus_namespace_con @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_topic_create_duplicate(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "dqkodq" try: @@ -89,7 +89,7 @@ def test_mgmt_topic_create_duplicate(self, servicebus_namespace_connection_strin @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_topic_update_success(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "fjrui" @@ -135,7 +135,7 @@ def test_mgmt_topic_update_success(self, servicebus_namespace_connection_string, @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_topic_update_invalid(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topic_name = "dfjfj" try: @@ -172,7 +172,7 @@ def test_mgmt_topic_update_invalid(self, servicebus_namespace_connection_string, @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_topic_delete(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) mgmt_service.create_topic('test_topic') topics = list(mgmt_service.list_topics()) @@ -197,7 +197,7 @@ def test_mgmt_topic_delete(self, servicebus_namespace_connection_string): @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_topic_list(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topics = list(mgmt_service.list_topics()) assert len(topics) == 0 @@ -215,7 +215,7 @@ def test_mgmt_topic_list(self, servicebus_namespace_connection_string, **kwargs) @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_topic_list_runtime_info(self, servicebus_namespace_connection_string, **kwargs): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) topics = list(mgmt_service.list_topics()) topics_infos = list(mgmt_service.list_topics_runtime_info()) @@ -247,7 +247,7 @@ def test_mgmt_topic_list_runtime_info(self, servicebus_namespace_connection_stri @CachedResourceGroupPreparer(name_prefix='servicebustest') @CachedServiceBusNamespacePreparer(name_prefix='servicebustest') def test_mgmt_topic_get_runtime_info_basic(self, servicebus_namespace_connection_string): - mgmt_service = ServiceBusManagementClient.from_connection_string(servicebus_namespace_connection_string) + mgmt_service = ServiceBusAdministrationClient.from_connection_string(servicebus_namespace_connection_string) clear_topics(mgmt_service) mgmt_service.create_topic("test_topic") topic_runtime_info = mgmt_service.get_topic_runtime_info("test_topic") From 49026681df85f52c6428660697c1fb0ba3b2bfad Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:38:20 -0700 Subject: [PATCH 11/16] Increment package version after release of azure_keyvault_certificates (#13630) --- sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md | 3 +++ .../azure/keyvault/certificates/_version.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md b/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md index b32d6c294fd0..03a64a577896 100644 --- a/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md +++ b/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 4.2.2 (Unreleased) + + ## 4.2.1 (2020-09-08) ### Fixed - Correct typing for paging methods diff --git a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_version.py b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_version.py index 6ef4ec041a90..fe2542838b00 100644 --- a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_version.py +++ b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. # ------------------------------------ -VERSION = "4.2.1" +VERSION = "4.2.2" From f27b0bb5821e43082bd09ac672950d9ea53da2cc Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Tue, 8 Sep 2020 13:48:04 -0700 Subject: [PATCH 12/16] Add administration package to Key Vault pipeline (#13631) --- sdk/keyvault/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/keyvault/ci.yml b/sdk/keyvault/ci.yml index d7221d1f1503..e1c1f3b392eb 100644 --- a/sdk/keyvault/ci.yml +++ b/sdk/keyvault/ci.yml @@ -34,6 +34,8 @@ extends: parameters: ServiceDirectory: keyvault Artifacts: + - name: azure_keyvault_administration + safename: azurekeyvaultadministration - name: azure_keyvault_certificates safeName: azurekeyvaultcertificates - name: azure_keyvault_keys From c799a11b877e9b1ea8244b797a9b4a317df063b3 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Tue, 8 Sep 2020 14:14:13 -0700 Subject: [PATCH 13/16] fixed the long description, addition to changelog (#13637) * fixed the long description, addition to changelog * addresssing izzy's comments --- sdk/tables/azure-data-tables/CHANGELOG.md | 3 ++- sdk/tables/azure-data-tables/setup.py | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index 53f73cf90855..d754be8bc8af 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -1,6 +1,7 @@ # Release History -## 12.0.0b1 (Unreleased) +## 12.0.0b1 (2020-09-08) +This is the first beta of the `azure-data-tables` client library. The Azure Tables client library can seamlessly target either Azure Table storage or Azure Cosmos DB table service endpoints with no code changes. diff --git a/sdk/tables/azure-data-tables/setup.py b/sdk/tables/azure-data-tables/setup.py index 1651b14ff4cc..95c120a47dd1 100644 --- a/sdk/tables/azure-data-tables/setup.py +++ b/sdk/tables/azure-data-tables/setup.py @@ -43,11 +43,16 @@ if not version: raise RuntimeError('Cannot find version information') +with open("README.md", encoding="utf-8") as f: + readme = f.read() +with open("CHANGELOG.md", encoding="utf-8") as f: + changelog = f.read() + setup( name=PACKAGE_NAME, version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), - long_description='\n\n', + long_description=readme + '\n\n' + changelog, long_description_content_type='text/markdown', license='MIT License', author='Microsoft Corporation', From 9d12dcfb425f7d1faa2ac23d72e6e44360e48523 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 8 Sep 2020 15:23:23 -0700 Subject: [PATCH 14/16] [EventGrid] Fix lint errors (#13640) * Fix lint errors * comments --- eng/tox/allowed_pylint_failures.py | 1 - .../azure-eventgrid/azure/__init__.py | 2 +- .../azure/eventgrid/__init__.py | 6 +-- .../azure/eventgrid/_consumer.py | 43 +++++++++---------- .../azure/eventgrid/_event_mappings.py | 14 +++--- .../azure/eventgrid/_helpers.py | 23 +++++++--- .../azure/eventgrid/_models.py | 21 ++++----- .../azure/eventgrid/_publisher_client.py | 23 +++++----- .../azure/eventgrid/_shared/mixins.py | 10 ++--- .../_shared_access_signature_credential.py | 2 +- .../eventgrid/_signature_credential_policy.py | 6 +++ .../eventgrid/aio/_publisher_client_async.py | 20 ++++----- .../azure-eventgrid/tests/test_eg_consumer.py | 3 +- 13 files changed, 91 insertions(+), 83 deletions(-) diff --git a/eng/tox/allowed_pylint_failures.py b/eng/tox/allowed_pylint_failures.py index 1adcea8fcdad..e9505fee9cf9 100644 --- a/eng/tox/allowed_pylint_failures.py +++ b/eng/tox/allowed_pylint_failures.py @@ -36,7 +36,6 @@ "azure-common", "azure-nspkg", "azure-servicemanagement-legacy", - "azure-eventgrid", "azure-graphrbac", "azure-loganalytics", "azure-servicefabric", diff --git a/sdk/eventgrid/azure-eventgrid/azure/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/__init__.py index 0260537a02bb..69e3be50dac4 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/__init__.py +++ b/sdk/eventgrid/azure-eventgrid/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py index 0b0357a1f50d..3c4ee3a3aa72 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/__init__.py @@ -7,11 +7,11 @@ from ._publisher_client import EventGridPublisherClient from ._consumer import EventGridConsumer from ._helpers import generate_shared_access_signature -from ._models import CloudEvent, CustomEvent, EventGridEvent, StorageBlobCreatedEventData +from ._models import CloudEvent, CustomEvent, EventGridEvent from ._shared_access_signature_credential import EventGridSharedAccessSignatureCredential from ._version import VERSION __all__ = ['EventGridPublisherClient', 'EventGridConsumer', - 'CloudEvent', 'CustomEvent', 'EventGridEvent', 'StorageBlobCreatedEventData', - 'generate_shared_access_signature', 'EventGridSharedAccessSignatureCredential'] + 'CloudEvent', 'CustomEvent', 'EventGridEvent', 'generate_shared_access_signature', + 'EventGridSharedAccessSignatureCredential'] __version__ = VERSION diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_consumer.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_consumer.py index ae2d8a2aa9d9..acc80d774810 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_consumer.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_consumer.py @@ -7,12 +7,8 @@ # -------------------------------------------------------------------------- from typing import TYPE_CHECKING -import json -import six import logging - -from azure.core import PipelineClient -from msrest import Deserializer, Serializer +from ._models import CloudEvent, EventGridEvent if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -20,13 +16,12 @@ _LOGGER = logging.getLogger(__name__) -from ._models import CloudEvent, EventGridEvent - class EventGridConsumer(object): """ - A consumer responsible for deserializing event handler messages, to allow for access to strongly typed Event objects. + A consumer responsible for deserializing event handler messages, to allow for + access to strongly typed Event objects. """ - def decode_cloud_event(self, cloud_event, **kwargs): + def decode_cloud_event(self, cloud_event, **kwargs): # pylint: disable=no-self-use # type: (Union[str, dict, bytes], Any) -> CloudEvent """Single event following CloudEvent schema will be parsed and returned as Deserialized Event. :param cloud_event: The event to be deserialized. @@ -37,17 +32,19 @@ def decode_cloud_event(self, cloud_event, **kwargs): """ encode = kwargs.pop('encoding', 'utf-8') try: - cloud_event = CloudEvent._from_json(cloud_event, encode) - deserialized_event = CloudEvent._from_generated(cloud_event) - CloudEvent._deserialize_data(deserialized_event, deserialized_event.type) - return deserialized_event + cloud_event = CloudEvent._from_json(cloud_event, encode) # pylint: disable=protected-access + deserialized_event = CloudEvent._from_generated(cloud_event) # pylint: disable=protected-access + CloudEvent._deserialize_data(deserialized_event, deserialized_event.type) # pylint: disable=protected-access + return deserialized_event except Exception as err: - _LOGGER.error('Error: cannot deserialize event. Event does not have a valid format. Event must be a string, dict, or bytes following the CloudEvent schema.') - _LOGGER.error('Your event: {}'.format(cloud_event)) + _LOGGER.error('Error: cannot deserialize event. Event does not have a valid format. \ + Event must be a string, dict, or bytes following the CloudEvent schema.') + _LOGGER.error('Your event: %s', cloud_event) _LOGGER.error(err) - raise ValueError('Error: cannot deserialize event. Event does not have a valid format. Event must be a string, dict, or bytes following the CloudEvent schema.') + raise ValueError('Error: cannot deserialize event. Event does not have a valid format. \ + Event must be a string, dict, or bytes following the CloudEvent schema.') - def decode_eventgrid_event(self, eventgrid_event, **kwargs): + def decode_eventgrid_event(self, eventgrid_event, **kwargs): # pylint: disable=no-self-use # type: (Union[str, dict, bytes], Any) -> EventGridEvent """Single event following EventGridEvent schema will be parsed and returned as Deserialized Event. :param eventgrid_event: The event to be deserialized. @@ -58,12 +55,14 @@ def decode_eventgrid_event(self, eventgrid_event, **kwargs): """ encode = kwargs.pop('encoding', 'utf-8') try: - eventgrid_event = EventGridEvent._from_json(eventgrid_event, encode) + eventgrid_event = EventGridEvent._from_json(eventgrid_event, encode) # pylint: disable=protected-access deserialized_event = EventGridEvent.deserialize(eventgrid_event) - EventGridEvent._deserialize_data(deserialized_event, deserialized_event.event_type) + EventGridEvent._deserialize_data(deserialized_event, deserialized_event.event_type) # pylint: disable=protected-access return deserialized_event except Exception as err: - _LOGGER.error('Error: cannot deserialize event. Event does not have a valid format. Event must be a string, dict, or bytes following the CloudEvent schema.') - _LOGGER.error('Your event: {}'.format(eventgrid_event)) + _LOGGER.error('Error: cannot deserialize event. Event does not have a valid format. \ + Event must be a string, dict, or bytes following the CloudEvent schema.') + _LOGGER.error('Your event: %s', eventgrid_event) _LOGGER.error(err) - raise ValueError('Error: cannot deserialize event. Event does not have a valid format. Event must be a string, dict, or bytes following the CloudEvent schema.') + raise ValueError('Error: cannot deserialize event. Event does not have a valid format. \ + Event must be a string, dict, or bytes following the CloudEvent schema.') diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py index dc14a40bfacc..55412f815a13 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py @@ -19,7 +19,8 @@ "Microsoft.EventGrid.SubscriptionValidationEvent": models.SubscriptionValidationEventData, "Microsoft.EventGrid.SubscriptionDeletedEvent": models.SubscriptionDeletedEventData, "Microsoft.EventHub.CaptureFileCreated": models.EventHubCaptureFileCreatedEventData, - "Microsoft.MachineLearningServices.DatasetDriftDetected": models.MachineLearningServicesDatasetDriftDetectedEventData, + "Microsoft.MachineLearningServices.DatasetDriftDetected": + models.MachineLearningServicesDatasetDriftDetectedEventData, "Microsoft.MachineLearningServices.ModelDeployed": models.MachineLearningServicesModelDeployedEventData, "Microsoft.MachineLearningServices.ModelRegistered": models.MachineLearningServicesModelRegisteredEventData, "Microsoft.MachineLearningServices.RunCompleted": models.MachineLearningServicesRunCompletedEventData, @@ -47,7 +48,8 @@ "Microsoft.Media.LiveEventEncoderDisconnected": models.MediaLiveEventEncoderDisconnectedEventData, "Microsoft.Media.LiveEventIncomingStreamReceived": models.MediaLiveEventIncomingStreamReceivedEventData, "Microsoft.Media.LiveEventIncomingStreamsOutOfSync": models.MediaLiveEventIncomingStreamsOutOfSyncEventData, - "Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync": models.MediaLiveEventIncomingVideoStreamsOutOfSyncEventData, + "Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync": + models.MediaLiveEventIncomingVideoStreamsOutOfSyncEventData, "Microsoft.Media.LiveEventIncomingDataChunkDropped": models.MediaLiveEventIncomingDataChunkDroppedEventData, "Microsoft.Media.LiveEventIngestHeartbeat": models.MediaLiveEventIngestHeartbeatEventData, "Microsoft.Media.LiveEventTrackDiscontinuityDetected": models.MediaLiveEventTrackDiscontinuityDetectedEventData, @@ -60,8 +62,10 @@ "Microsoft.Resources.ResourceActionSuccess": models.ResourceActionSuccessData, "Microsoft.Resources.ResourceActionFailure": models.ResourceActionFailureData, "Microsoft.Resources.ResourceActionCancel": models.ResourceActionCancelData, - "Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners": models.ServiceBusActiveMessagesAvailableWithNoListenersEventData, - "Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener": models.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData, + "Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners": + models.ServiceBusActiveMessagesAvailableWithNoListenersEventData, + "Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener": + models.ServiceBusDeadletterMessagesAvailableWithNoListenersEventData, "Microsoft.Storage.BlobCreated": models.StorageBlobCreatedEventData, "Microsoft.Storage.BlobDeleted": models.StorageBlobDeletedEventData, "Microsoft.Storage.BlobRenamed": models.StorageBlobRenamedEventData, @@ -82,4 +86,4 @@ "Microsoft.Web.SlotSwapWithPreviewStarted": models.WebSlotSwapWithPreviewStartedEventData, "Microsoft.Web.SlotSwapWithPreviewCancelled": models.WebSlotSwapWithPreviewCancelledEventData, "Microsoft.Web.AppServicePlanUpdated": models.WebAppServicePlanUpdatedEventData, -} \ No newline at end of file +} diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py index 9443f7e3f698..2bd67abd56e3 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_helpers.py @@ -1,3 +1,7 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- import hashlib import hmac import base64 @@ -5,14 +9,12 @@ from urllib.parse import quote except ImportError: from urllib2 import quote # type: ignore -import datetime from azure.core.pipeline.policies import AzureKeyCredentialPolicy from azure.core.credentials import AzureKeyCredential from ._shared_access_signature_credential import EventGridSharedAccessSignatureCredential from ._signature_credential_policy import EventGridSharedAccessSignatureCredentialPolicy from . import _constants as constants -from ._event_mappings import _event_mappings def generate_shared_access_signature(topic_hostname, shared_access_key, expiration_date_utc, **kwargs): # type: (str, str, datetime.Datetime, Any) -> str @@ -21,13 +23,17 @@ def generate_shared_access_signature(topic_hostname, shared_access_key, expirati Similar to .-1.eventgrid.azure.net :param str shared_access_key: The shared access key to be used for generating the token :param datetime.datetime expiration_date_utc: The expiration datetime in UTC for the signature. - :param str api_version: The API Version to include in the signature. If not provided, the default API version will be used. + :param str api_version: The API Version to include in the signature. + If not provided, the default API version will be used. :rtype: str """ full_topic_hostname = _get_full_topic_hostname(topic_hostname) - full_topic_hostname = "{}?apiVersion={}".format(full_topic_hostname, kwargs.get('api_version', None) or constants.DEFAULT_API_VERSION) + full_topic_hostname = "{}?apiVersion={}".format( + full_topic_hostname, + kwargs.get('api_version', None) or constants.DEFAULT_API_VERSION + ) encoded_resource = quote(full_topic_hostname, safe=constants.SAFE_ENCODE) encoded_expiration_utc = quote(str(expiration_date_utc), safe=constants.SAFE_ENCODE) @@ -43,7 +49,7 @@ def _get_topic_hostname_only_fqdn(topic_hostname): topic_hostname = topic_hostname.replace("https://", "") if topic_hostname.endswith("/api/events"): topic_hostname = topic_hostname.replace("/api/events", "") - + return topic_hostname def _get_full_topic_hostname(topic_hostname): @@ -53,7 +59,7 @@ def _get_full_topic_hostname(topic_hostname): topic_hostname = "https://{}".format(topic_hostname) if not topic_hostname.endswith("/api/events"): topic_hostname = "{}/api/events".format(topic_hostname) - + return topic_hostname def _generate_hmac(key, message): @@ -69,7 +75,10 @@ def _get_authentication_policy(credential): if isinstance(credential, AzureKeyCredential): authentication_policy = AzureKeyCredentialPolicy(credential=credential, name=constants.EVENTGRID_KEY_HEADER) if isinstance(credential, EventGridSharedAccessSignatureCredential): - authentication_policy = EventGridSharedAccessSignatureCredentialPolicy(credential=credential, name=constants.EVENTGRID_TOKEN_HEADER) + authentication_policy = EventGridSharedAccessSignatureCredentialPolicy( + credential=credential, + name=constants.EVENTGRID_TOKEN_HEADER + ) return authentication_policy def _is_cloud_event(event): diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_models.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_models.py index 43d3624e672e..a304f488fa51 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_models.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_models.py @@ -3,16 +3,12 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # pylint:disable=protected-access -from typing import Optional -from msrest.serialization import UTC import datetime as dt import uuid import json import six -from ._generated import models -from ._generated.models import StorageBlobCreatedEventData, \ - EventGridEvent as InternalEventGridEvent, \ - CloudEvent as InternalCloudEvent +from msrest.serialization import UTC +from ._generated.models import EventGridEvent as InternalEventGridEvent, CloudEvent as InternalCloudEvent from ._shared.mixins import DictMixin from ._event_mappings import _event_mappings @@ -55,8 +51,8 @@ class CloudEvent(EventMixin): #pylint:disable=too-many-instance-attributes All required parameters must be populated in order to send to Azure. - :param source: Required. Identifies the context in which an event happened. The combination of id and source must be - unique for each distinct event. If publishing to a domain topic, source must be the domain name. + :param source: Required. Identifies the context in which an event happened. The combination of id and source must + be unique for each distinct event. If publishing to a domain topic, source must be the domain name. :type source: str :param data: Event data specific to the event type. :type data: object @@ -75,7 +71,7 @@ class CloudEvent(EventMixin): #pylint:disable=too-many-instance-attributes unique for each distinct event. :type id: Optional[str] """ - def __init__(self, source, type, **kwargs): + def __init__(self, source, type, **kwargs): # pylint: disable=redefined-builtin # type: (str, str, Any) -> None self.source = source self.type = type @@ -87,13 +83,13 @@ def __init__(self, source, type, **kwargs): self.dataschema = kwargs.pop("dataschema", None) self.subject = kwargs.pop("subject", None) self.extensions = {} - self.extensions.update({k:v for k, v in kwargs.pop('extensions', {}).items()}) + self.extensions.update(dict(kwargs.pop('extensions', {}))) @classmethod def _from_generated(cls, cloud_event, **kwargs): generated = InternalCloudEvent.deserialize(cloud_event) if generated.additional_properties: - extensions = {k:v for k, v in generated.additional_properties.items()} + extensions = dict(generated.additional_properties) kwargs.setdefault('extensions', extensions) return cls( id=generated.id, @@ -154,7 +150,8 @@ class EventGridEvent(InternalEventGridEvent, EventMixin): :param id: Optional. An identifier for the event. The combination of id and source must be unique for each distinct event. :type id: Optional[str] - :param event_time: Optional.The time (in UTC) of the event. If not provided, it will be the time (in UTC) the event was generated. + :param event_time: Optional.The time (in UTC) of the event. If not provided, + it will be the time (in UTC) the event was generated. :type event_time: Optional[~datetime.datetime] """ diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_publisher_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_publisher_client.py index 44b664ddc493..082f03891e78 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_publisher_client.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_publisher_client.py @@ -5,11 +5,11 @@ # license information. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING, Sequence -import json +from typing import TYPE_CHECKING -from azure.core import PipelineClient -from msrest import Deserializer, Serializer +from ._models import CloudEvent, EventGridEvent, CustomEvent +from ._helpers import _get_topic_hostname_only_fqdn, _get_authentication_policy, _is_cloud_event +from ._generated._event_grid_publisher_client import EventGridPublisherClient as EventGridPublisherClientImpl if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -25,18 +25,14 @@ List[Dict] ] -from ._models import CloudEvent, EventGridEvent, CustomEvent -from ._helpers import _get_topic_hostname_only_fqdn, _get_authentication_policy, _is_cloud_event -from ._generated._event_grid_publisher_client import EventGridPublisherClient as EventGridPublisherClientImpl -from . import _constants as constants - class EventGridPublisherClient(object): """EventGrid Python Publisher Client. :param str topic_hostname: The topic endpoint to send the events to. - :param credential: The credential object used for authentication which implements SAS key authentication or SAS token authentication. - :type credential: Union[~azure.core.credentials.AzureKeyCredential, azure.eventgrid.EventGridSharedAccessSignatureCredential] + :param credential: The credential object used for authentication which + implements SAS key authentication or SAS token authentication. + :type credential: ~azure.core.credentials.AzureKeyCredential or EventGridSharedAccessSignatureCredential """ def __init__(self, topic_hostname, credential, **kwargs): @@ -54,7 +50,8 @@ def send(self, events, **kwargs): :param events: A list or an instance of CloudEvent/EventGridEvent/CustomEvent to be sent. :type events: SendType :keyword str content_type: The type of content to be used to send the events. - Has default value "application/json; charset=utf-8" for EventGridEvents, with "cloudevents-batch+json" for CloudEvents + Has default value "application/json; charset=utf-8" for EventGridEvents, + with "cloudevents-batch+json" for CloudEvents :rtype: None :raises: :class:`ValueError`, when events do not follow specified SendType. """ @@ -63,7 +60,7 @@ def send(self, events, **kwargs): if all(isinstance(e, CloudEvent) for e in events) or all(_is_cloud_event(e) for e in events): try: - events = [e._to_generated(**kwargs) for e in events] + events = [e._to_generated(**kwargs) for e in events] # pylint: disable=protected-access except AttributeError: pass # means it's a dictionary kwargs.setdefault("content_type", "application/cloudevents-batch+json; charset=utf-8") diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/mixins.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/mixins.py index 0b24e8edc45c..411fd236b681 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/mixins.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared/mixins.py @@ -37,22 +37,22 @@ def __ne__(self, other): def __str__(self): return str({k: v for k, v in self.__dict__.items() if not k.startswith('_')}) - def has_key(self, k, **kwargs): + def has_key(self, k): return k in self.__dict__ def update(self, *args, **kwargs): return self.__dict__.update(*args, **kwargs) - def keys(self, **kwargs): + def keys(self): return [k for k in self.__dict__ if not k.startswith('_')] - def values(self, **kwargs): + def values(self): return [v for k, v in self.__dict__.items() if not k.startswith('_')] - def items(self, **kwargs): + def items(self): return [(k, v) for k, v in self.__dict__.items() if not k.startswith('_')] - def get(self, key, default=None, **kwargs): + def get(self, key, default=None): if key in self.__dict__: return self.__dict__[key] return default diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared_access_signature_credential.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared_access_signature_credential.py index dece8da69fe1..7c3a178c96eb 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared_access_signature_credential.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_shared_access_signature_credential.py @@ -22,7 +22,7 @@ def signature(self): :rtype: str """ return self._signature - + def update(self, signature): # type: (str) -> None """ diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_signature_credential_policy.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_signature_credential_policy.py index 3370595d1d5d..3ae58fbf4a08 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_signature_credential_policy.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_signature_credential_policy.py @@ -1,3 +1,9 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# ------------------------------------------------------------------------- + import six from azure.core.pipeline.policies import SansIOHTTPPolicy diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_publisher_client_async.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_publisher_client_async.py index 0cfe1de4693f..786793525a26 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_publisher_client_async.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_publisher_client_async.py @@ -7,20 +7,15 @@ # -------------------------------------------------------------------------- from typing import Any, TYPE_CHECKING - -from azure.core import AsyncPipelineClient -from msrest import Deserializer, Serializer +from azure.core.credentials import AzureKeyCredential from .._models import CloudEvent, EventGridEvent, CustomEvent from .._helpers import _get_topic_hostname_only_fqdn, _get_authentication_policy, _is_cloud_event -from azure.core.pipeline.policies import AzureKeyCredentialPolicy -from azure.core.credentials import AzureKeyCredential from .._generated.aio import EventGridPublisherClient as EventGridPublisherClientAsync -from .. import _constants as constants if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Union, Dict, List + from typing import Union, Dict, List SendType = Union[ CloudEvent, EventGridEvent, @@ -36,8 +31,9 @@ class EventGridPublisherClient(object): """Asynchronous EventGrid Python Publisher Client. :param str topic_hostname: The topic endpoint to send the events to. - :param credential: The credential object used for authentication which implements SAS key authentication or SAS token authentication. - :type credential: Union[~azure.core.credentials.AzureKeyCredential, azure.eventgrid.EventGridSharedAccessSignatureCredential] + :param credential: The credential object used for authentication which implements + SAS key authentication or SAS token authentication. + :type credential: ~azure.core.credentials.AzureKeyCredential or EventGridSharedAccessSignatureCredential """ def __init__(self, topic_hostname, credential, **kwargs): @@ -55,7 +51,8 @@ async def send(self, events, **kwargs): :param events: A list or an instance of CloudEvent/EventGridEvent/CustomEvent to be sent. :type events: SendType :keyword str content_type: The type of content to be used to send the events. - Has default value "application/json; charset=utf-8" for EventGridEvents, with "cloudevents-batch+json" for CloudEvents + Has default value "application/json; charset=utf-8" for EventGridEvents, + with "cloudevents-batch+json" for CloudEvents :rtype: None :raises: :class:`ValueError`, when events do not follow specified SendType. """ @@ -64,7 +61,7 @@ async def send(self, events, **kwargs): if all(isinstance(e, CloudEvent) for e in events) or all(_is_cloud_event(e) for e in events): try: - events = [e._to_generated(**kwargs) for e in events] + events = [e._to_generated(**kwargs) for e in events] # pylint: disable=protected-access except AttributeError: pass # means it's a dictionary kwargs.setdefault("content_type", "application/cloudevents-batch+json; charset=utf-8") @@ -77,4 +74,3 @@ async def send(self, events, **kwargs): await self._client.publish_custom_event_events(self._topic_hostname, serialized_events, **kwargs) else: raise ValueError("Event schema is not correct.") - diff --git a/sdk/eventgrid/azure-eventgrid/tests/test_eg_consumer.py b/sdk/eventgrid/azure-eventgrid/tests/test_eg_consumer.py index 344f5dd70634..450910d936a8 100644 --- a/sdk/eventgrid/azure-eventgrid/tests/test_eg_consumer.py +++ b/sdk/eventgrid/azure-eventgrid/tests/test_eg_consumer.py @@ -13,7 +13,8 @@ from devtools_testutils import AzureMgmtTestCase from msrest.serialization import UTC -from azure.eventgrid import EventGridConsumer, CloudEvent, EventGridEvent, StorageBlobCreatedEventData +from azure.eventgrid import EventGridConsumer, CloudEvent, EventGridEvent +from azure.eventgrid.models import StorageBlobCreatedEventData from _mocks import ( cloud_storage_dict, cloud_storage_string, From 3b1432a8e082064759a0d660a85de9e0b5c63b37 Mon Sep 17 00:00:00 2001 From: KieranBrantnerMagee Date: Tue, 8 Sep 2020 16:05:25 -0700 Subject: [PATCH 15/16] * Remove `is_anonymous_accessible` from management entities. (#13628) * Remove `support_ordering` from `create_queue` and `QueueProperties` * Remove `enable_subscription_partitioning` from `create_topic` and `TopicProperties` * update tests/changelog --- sdk/servicebus/azure-servicebus/CHANGELOG.md | 3 +++ .../management/_management_client_async.py | 15 ------------ .../management/_management_client.py | 15 ------------ .../azure/servicebus/management/_models.py | 23 ------------------- .../mgmt_tests/test_mgmt_queues_async.py | 10 +------- .../mgmt_tests/test_mgmt_topics_async.py | 6 ----- .../tests/mgmt_tests/test_mgmt_queues.py | 10 +------- .../tests/mgmt_tests/test_mgmt_topics.py | 6 ----- 8 files changed, 5 insertions(+), 83 deletions(-) diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index 6d9966e32314..8980f96e6114 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -13,6 +13,9 @@ * 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 +* Remove `is_anonymous_accessible` from management entities. +* Remove `support_ordering` from `create_queue` and `QueueProperties` +* Remove `enable_subscription_partitioning` from `create_topic` and `TopicProperties` ## 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 304d04d46d76..b456acb3c54c 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 @@ -198,9 +198,6 @@ async def create_queue(self, name: str, **kwargs) -> QueueProperties: :keyword enable_partitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. :type enable_partitioning: bool - :keyword is_anonymous_accessible: A value indicating if the resource can be accessed without - authorization. - :type is_anonymous_accessible: bool :keyword 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. @@ -223,8 +220,6 @@ async def create_queue(self, name: str, **kwargs) -> QueueProperties: :keyword user_metadata: Custom metdata that user can associate with the description. Max length is 1024 chars. :type user_metadata: str - :keyword support_ordering: A value that indicates whether the queue supports ordering. - :type support_ordering: bool :keyword forward_dead_lettered_messages_to: The name of the recipient entity to which all the dead-lettered messages of this subscription are forwarded to. :type forward_dead_lettered_messages_to: str @@ -242,14 +237,12 @@ async def create_queue(self, name: str, **kwargs) -> QueueProperties: enable_batched_operations=kwargs.pop("enable_batched_operations", None), enable_express=kwargs.pop("enable_express", None), enable_partitioning=kwargs.pop("enable_partitioning", None), - is_anonymous_accessible=kwargs.pop("is_anonymous_accessible", None), lock_duration=kwargs.pop("lock_duration", None), max_delivery_count=kwargs.pop("max_delivery_count", None), max_size_in_megabytes=kwargs.pop("max_size_in_megabytes", None), requires_duplicate_detection=kwargs.pop("requires_duplicate_detection", None), requires_session=kwargs.pop("requires_session", None), status=kwargs.pop("status", None), - support_ordering=kwargs.pop("support_ordering", None), forward_to=kwargs.pop("forward_to", None), forward_dead_lettered_messages_to=kwargs.pop("forward_dead_lettered_messages_to", None), user_metadata=kwargs.pop("user_metadata", None) @@ -413,9 +406,6 @@ async def create_topic(self, name: str, **kwargs) -> TopicProperties: :type size_in_bytes: int :keyword filtering_messages_before_publishing: Filter messages before publishing. :type filtering_messages_before_publishing: bool - :keyword is_anonymous_accessible: A value indicating if the resource can be accessed without - authorization. - :type is_anonymous_accessible: bool :keyword authorization_rules: Authorization rules for resource. :type authorization_rules: list[~azure.servicebus.management.AuthorizationRule] @@ -427,9 +417,6 @@ async def create_topic(self, name: str, **kwargs) -> TopicProperties: :keyword enable_partitioning: A value that indicates whether the topic is to be partitioned across multiple message brokers. :type enable_partitioning: bool - :keyword enable_subscription_partitioning: A value that indicates whether the topic's - subscription is to be partitioned. - :type enable_subscription_partitioning: bool :keyword 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 @@ -447,14 +434,12 @@ async def create_topic(self, name: str, **kwargs) -> TopicProperties: duplicate_detection_history_time_window=kwargs.pop("duplicate_detection_history_time_window", None), enable_batched_operations=kwargs.pop("enable_batched_operations", None), size_in_bytes=kwargs.pop("size_in_bytes", None), - is_anonymous_accessible=kwargs.pop("is_anonymous_accessible", None), authorization_rules=kwargs.pop("authorization_rules", None), status=kwargs.pop("status", None), 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), - enable_subscription_partitioning=kwargs.pop("enable_subscription_partitioning", None), enable_express=kwargs.pop("enable_express", None), user_metadata=kwargs.pop("user_metadata", None) ) 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 d0238b70f8a3..740a9cac73c3 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py @@ -193,9 +193,6 @@ def create_queue(self, name, **kwargs): :keyword enable_partitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. :type enable_partitioning: bool - :keyword is_anonymous_accessible: A value indicating if the resource can be accessed without - authorization. - :type is_anonymous_accessible: bool :keyword 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. @@ -218,8 +215,6 @@ def create_queue(self, name, **kwargs): :keyword user_metadata: Custom metdata that user can associate with the description. Max length is 1024 chars. :type user_metadata: str - :keyword support_ordering: A value that indicates whether the queue supports ordering. - :type support_ordering: bool :keyword forward_dead_lettered_messages_to: The name of the recipient entity to which all the dead-lettered messages of this subscription are forwarded to. :type forward_dead_lettered_messages_to: str @@ -237,14 +232,12 @@ def create_queue(self, name, **kwargs): enable_batched_operations=kwargs.pop("enable_batched_operations", None), enable_express=kwargs.pop("enable_express", None), enable_partitioning=kwargs.pop("enable_partitioning", None), - is_anonymous_accessible=kwargs.pop("is_anonymous_accessible", None), lock_duration=kwargs.pop("lock_duration", None), max_delivery_count=kwargs.pop("max_delivery_count", None), max_size_in_megabytes=kwargs.pop("max_size_in_megabytes", None), requires_duplicate_detection=kwargs.pop("requires_duplicate_detection", None), requires_session=kwargs.pop("requires_session", None), status=kwargs.pop("status", None), - support_ordering=kwargs.pop("support_ordering", None), forward_to=kwargs.pop("forward_to", None), forward_dead_lettered_messages_to=kwargs.pop("forward_dead_lettered_messages_to", None), user_metadata=kwargs.pop("user_metadata", None) @@ -417,9 +410,6 @@ def create_topic(self, name, **kwargs): :type size_in_bytes: int :keyword filtering_messages_before_publishing: Filter messages before publishing. :type filtering_messages_before_publishing: bool - :keyword is_anonymous_accessible: A value indicating if the resource can be accessed without - authorization. - :type is_anonymous_accessible: bool :keyword authorization_rules: Authorization rules for resource. :type authorization_rules: list[~azure.servicebus.management.AuthorizationRule] @@ -431,9 +421,6 @@ def create_topic(self, name, **kwargs): :keyword enable_partitioning: A value that indicates whether the topic is to be partitioned across multiple message brokers. :type enable_partitioning: bool - :keyword enable_subscription_partitioning: A value that indicates whether the topic's - subscription is to be partitioned. - :type enable_subscription_partitioning: bool :keyword 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 @@ -450,14 +437,12 @@ def create_topic(self, name, **kwargs): duplicate_detection_history_time_window=kwargs.pop("duplicate_detection_history_time_window", None), enable_batched_operations=kwargs.pop("enable_batched_operations", None), size_in_bytes=kwargs.pop("size_in_bytes", None), - is_anonymous_accessible=kwargs.pop("is_anonymous_accessible", None), authorization_rules=kwargs.pop("authorization_rules", None), status=kwargs.pop("status", None), 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), - enable_subscription_partitioning=kwargs.pop("enable_subscription_partitioning", None), enable_express=kwargs.pop("enable_express", None), user_metadata=kwargs.pop("user_metadata", None) ) diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py index 1bf01ae807a5..7f537ba1f146 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py @@ -125,9 +125,6 @@ class QueueProperties(DictMixin): # pylint:disable=too-many-instance-attributes :ivar enable_partitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. :type enable_partitioning: bool - :ivar is_anonymous_accessible: A value indicating if the resource can be accessed without - authorization. - :type is_anonymous_accessible: bool :ivar 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. @@ -153,8 +150,6 @@ class QueueProperties(DictMixin): # pylint:disable=too-many-instance-attributes :ivar user_metadata: Custom metdata that user can associate with the description. Max length is 1024 chars. :type user_metadata: str - :ivar support_ordering: A value that indicates whether the queue supports ordering. - :type support_ordering: bool :ivar forward_dead_lettered_messages_to: The name of the recipient entity to which all the dead-lettered messages of this subscription are forwarded to. :type forward_dead_lettered_messages_to: str @@ -181,14 +176,12 @@ def __init__( self.enable_batched_operations = extract_kwarg('enable_batched_operations') self.enable_express = extract_kwarg('enable_express') self.enable_partitioning = extract_kwarg('enable_partitioning') - self.is_anonymous_accessible = extract_kwarg('is_anonymous_accessible') self.lock_duration = extract_kwarg('lock_duration') self.max_delivery_count = extract_kwarg('max_delivery_count') self.max_size_in_megabytes = extract_kwarg('max_size_in_megabytes') self.requires_duplicate_detection = extract_kwarg('requires_duplicate_detection') self.requires_session = extract_kwarg('requires_session') self.status = extract_kwarg('status') - self.support_ordering = extract_kwarg('support_ordering') self.forward_to = extract_kwarg('forward_to') self.user_metadata = extract_kwarg('user_metadata') self.forward_dead_lettered_messages_to = extract_kwarg('forward_dead_lettered_messages_to') @@ -210,14 +203,12 @@ def _from_internal_entity(cls, name, internal_qd): enable_batched_operations=internal_qd.enable_batched_operations, enable_express=internal_qd.enable_express, enable_partitioning=internal_qd.enable_partitioning, - is_anonymous_accessible=internal_qd.is_anonymous_accessible, lock_duration=internal_qd.lock_duration, max_delivery_count=internal_qd.max_delivery_count, max_size_in_megabytes=internal_qd.max_size_in_megabytes, requires_duplicate_detection=internal_qd.requires_duplicate_detection, requires_session=internal_qd.requires_session, status=internal_qd.status, - support_ordering=internal_qd.support_ordering, forward_to=internal_qd.forward_to, forward_dead_lettered_messages_to=internal_qd.forward_dead_lettered_messages_to, user_metadata=internal_qd.user_metadata @@ -239,14 +230,12 @@ def _to_internal_entity(self): 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 - self._internal_qd.is_anonymous_accessible = self.is_anonymous_accessible self._internal_qd.lock_duration = self.lock_duration self._internal_qd.max_delivery_count = self.max_delivery_count self._internal_qd.max_size_in_megabytes = self.max_size_in_megabytes self._internal_qd.requires_duplicate_detection = self.requires_duplicate_detection self._internal_qd.requires_session = self.requires_session self._internal_qd.status = self.status - self._internal_qd.support_ordering = self.support_ordering self._internal_qd.forward_to = self.forward_to self._internal_qd.forward_dead_lettered_messages_to = self.forward_dead_lettered_messages_to self._internal_qd.user_metadata = self.user_metadata @@ -386,9 +375,6 @@ class TopicProperties(DictMixin): # pylint:disable=too-many-instance-attributes :type size_in_bytes: int :ivar filtering_messages_before_publishing: Filter messages before publishing. :type filtering_messages_before_publishing: bool - :ivar is_anonymous_accessible: A value indicating if the resource can be accessed without - authorization. - :type is_anonymous_accessible: bool :ivar authorization_rules: Authorization rules for resource. :type authorization_rules: list[~azure.servicebus.management.AuthorizationRule] @@ -407,9 +393,6 @@ class TopicProperties(DictMixin): # pylint:disable=too-many-instance-attributes "Available", "Limited", "Renaming", "Restoring", "Unknown". :type entity_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. - :type enable_subscription_partitioning: bool :ivar 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 @@ -434,14 +417,12 @@ def __init__( self.duplicate_detection_history_time_window = extract_kwarg('duplicate_detection_history_time_window') self.enable_batched_operations = extract_kwarg('enable_batched_operations') self.size_in_bytes = extract_kwarg('size_in_bytes') - self.is_anonymous_accessible = extract_kwarg('is_anonymous_accessible') self.authorization_rules = extract_kwarg('authorization_rules') self.status = extract_kwarg('status') 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.enable_subscription_partitioning = extract_kwarg('enable_subscription_partitioning') self.enable_express = extract_kwarg('enable_express') self.user_metadata = extract_kwarg('user_metadata') @@ -458,14 +439,12 @@ def _from_internal_entity(cls, name, internal_td): duplicate_detection_history_time_window=internal_td.duplicate_detection_history_time_window, enable_batched_operations=internal_td.enable_batched_operations, size_in_bytes=internal_td.size_in_bytes, - is_anonymous_accessible=internal_td.is_anonymous_accessible, authorization_rules=internal_td.authorization_rules, status=internal_td.status, 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, - enable_subscription_partitioning=internal_td.enable_subscription_partitioning, enable_express=internal_td.enable_express, user_metadata=internal_td.user_metadata ) @@ -482,14 +461,12 @@ def _to_internal_entity(self): self._internal_td.duplicate_detection_history_time_window = self.duplicate_detection_history_time_window self._internal_td.enable_batched_operations = self.enable_batched_operations self._internal_td.size_in_bytes = self.size_in_bytes - self._internal_td.is_anonymous_accessible = self.is_anonymous_accessible self._internal_td.authorization_rules = self.authorization_rules self._internal_td.status = self.status 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.enable_subscription_partitioning = self.enable_subscription_partitioning self._internal_td.enable_express = self.enable_express self._internal_td.user_metadata = self.user_metadata 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 261ac2f694a3..9fbdcdf66b3a 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 @@ -231,13 +231,11 @@ async def test_async_mgmt_queue_create_with_queue_description(self, servicebus_n enable_batched_operations=True, enable_express=True, enable_partitioning=True, - is_anonymous_accessible=True, lock_duration=datetime.timedelta(seconds=13), max_delivery_count=14, max_size_in_megabytes=3072, #requires_duplicate_detection=True, - requires_session=True, - support_ordering=True + requires_session=True ) try: queue = await mgmt_service.get_queue(queue_name) @@ -249,13 +247,11 @@ async def test_async_mgmt_queue_create_with_queue_description(self, servicebus_n assert queue.enable_batched_operations == True assert queue.enable_express == True assert queue.enable_partitioning == True - assert queue.is_anonymous_accessible == True assert queue.lock_duration == datetime.timedelta(seconds=13) assert queue.max_delivery_count == 14 assert queue.max_size_in_megabytes % 3072 == 0 #assert queue.requires_duplicate_detection == True assert queue.requires_session == True - assert queue.support_ordering == True finally: await mgmt_service.delete_queue(queue_name) @@ -295,13 +291,11 @@ async def test_async_mgmt_queue_update_success(self, servicebus_namespace_connec queue_description.enable_batched_operations = True queue_description.enable_express = True #queue_description.enable_partitioning = True # Cannot be changed after creation - queue_description.is_anonymous_accessible = True queue_description.lock_duration = datetime.timedelta(seconds=13) queue_description.max_delivery_count = 14 queue_description.max_size_in_megabytes = 3072 #queue_description.requires_duplicate_detection = True # Read only #queue_description.requires_session = True # Cannot be changed after creation - queue_description.support_ordering = True await mgmt_service.update_queue(queue_description) queue_description = await mgmt_service.get_queue(queue_name) @@ -313,13 +307,11 @@ async def test_async_mgmt_queue_update_success(self, servicebus_namespace_connec assert queue_description.enable_batched_operations == True assert queue_description.enable_express == True #assert queue_description.enable_partitioning == True - assert queue_description.is_anonymous_accessible == True assert queue_description.lock_duration == datetime.timedelta(seconds=13) assert queue_description.max_delivery_count == 14 assert queue_description.max_size_in_megabytes == 3072 #assert queue_description.requires_duplicate_detection == True #assert queue_description.requires_session == True - assert queue_description.support_ordering == True finally: await mgmt_service.delete_queue(queue_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 39a2c2388f43..a431350e61d0 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 @@ -56,8 +56,6 @@ async def test_async_mgmt_topic_create_with_topic_description(self, servicebus_n enable_batched_operations=True, enable_express=True, enable_partitioning=True, - enable_subscription_partitioning=True, - is_anonymous_accessible=True, max_size_in_megabytes=3072 ) topic = await mgmt_service.get_topic(topic_name) @@ -68,8 +66,6 @@ async def test_async_mgmt_topic_create_with_topic_description(self, servicebus_n assert topic.enable_batched_operations assert topic.enable_express assert topic.enable_partitioning - assert topic.enable_subscription_partitioning - assert topic.is_anonymous_accessible assert topic.max_size_in_megabytes % 3072 == 0 finally: await mgmt_service.delete_topic(topic_name) @@ -109,7 +105,6 @@ async def test_async_mgmt_topic_update_success(self, servicebus_namespace_connec topic_description.enable_batched_operations = True topic_description.enable_express = True # topic_description.enable_partitioning = True # Cannot be changed after creation - topic_description.is_anonymous_accessible = True topic_description.max_size_in_megabytes = 3072 # topic_description.requires_duplicate_detection = True # Read only # topic_description.requires_session = True # Cannot be changed after creation @@ -124,7 +119,6 @@ async def test_async_mgmt_topic_update_success(self, servicebus_namespace_connec assert topic_description.enable_batched_operations == True assert topic_description.enable_express == True # assert topic_description.enable_partitioning == True - assert topic_description.is_anonymous_accessible == True assert topic_description.max_size_in_megabytes == 3072 # assert topic_description.requires_duplicate_detection == True # assert topic_description.requires_session == True 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 36c2bf390451..b4b66f524dfc 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 @@ -245,13 +245,11 @@ def test_mgmt_queue_create_with_queue_description(self, servicebus_namespace_con enable_batched_operations=True, enable_express=True, enable_partitioning=True, - is_anonymous_accessible=True, lock_duration=datetime.timedelta(seconds=13), max_delivery_count=14, max_size_in_megabytes=3072, #requires_duplicate_detection=True, - requires_session=True, - support_ordering=True + requires_session=True ) try: queue = mgmt_service.get_queue(queue_name) @@ -263,7 +261,6 @@ def test_mgmt_queue_create_with_queue_description(self, servicebus_namespace_con assert queue.enable_batched_operations == True assert queue.enable_express == True assert queue.enable_partitioning == True - assert queue.is_anonymous_accessible == True assert queue.lock_duration == datetime.timedelta(seconds=13) assert queue.max_delivery_count == 14 assert queue.max_size_in_megabytes % 3072 == 0 # TODO: In my local test, I don't see a multiple of the input number. To confirm @@ -272,7 +269,6 @@ def test_mgmt_queue_create_with_queue_description(self, servicebus_namespace_con # To know more visit https://aka.ms/sbResourceMgrExceptions. #assert queue.requires_duplicate_detection == True assert queue.requires_session == True - assert queue.support_ordering == True finally: mgmt_service.delete_queue(queue_name) @@ -314,13 +310,11 @@ def test_mgmt_queue_update_success(self, servicebus_namespace_connection_string, queue_description.enable_batched_operations = True queue_description.enable_express = True #queue_description.enable_partitioning = True # Cannot be changed after creation - queue_description.is_anonymous_accessible = True queue_description.lock_duration = datetime.timedelta(seconds=13) queue_description.max_delivery_count = 14 queue_description.max_size_in_megabytes = 3072 #queue_description.requires_duplicate_detection = True # Read only #queue_description.requires_session = True # Cannot be changed after creation - queue_description.support_ordering = True mgmt_service.update_queue(queue_description) queue_description = mgmt_service.get_queue(queue_name) @@ -332,13 +326,11 @@ def test_mgmt_queue_update_success(self, servicebus_namespace_connection_string, assert queue_description.enable_batched_operations == True assert queue_description.enable_express == True #assert queue_description.enable_partitioning == True - assert queue_description.is_anonymous_accessible == True assert queue_description.lock_duration == datetime.timedelta(seconds=13) assert queue_description.max_delivery_count == 14 assert queue_description.max_size_in_megabytes == 3072 #assert queue_description.requires_duplicate_detection == True #assert queue_description.requires_session == True - assert queue_description.support_ordering == True finally: mgmt_service.delete_queue(queue_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 c85ee6f36861..6b15c8f3357a 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 @@ -55,8 +55,6 @@ def test_mgmt_topic_create_with_topic_description(self, servicebus_namespace_con enable_batched_operations=True, enable_express=True, enable_partitioning=True, - enable_subscription_partitioning=True, - is_anonymous_accessible=True, max_size_in_megabytes=3072 ) topic = mgmt_service.get_topic(topic_name) @@ -67,8 +65,6 @@ def test_mgmt_topic_create_with_topic_description(self, servicebus_namespace_con assert topic.enable_batched_operations assert topic.enable_express assert topic.enable_partitioning - assert topic.enable_subscription_partitioning - assert topic.is_anonymous_accessible assert topic.max_size_in_megabytes % 3072 == 0 finally: mgmt_service.delete_topic(topic_name) @@ -109,7 +105,6 @@ def test_mgmt_topic_update_success(self, servicebus_namespace_connection_string, topic_description.enable_batched_operations = True topic_description.enable_express = True # topic_description.enable_partitioning = True # Cannot be changed after creation - topic_description.is_anonymous_accessible = True topic_description.max_size_in_megabytes = 3072 # topic_description.requires_duplicate_detection = True # Read only # topic_description.requires_session = True # Cannot be changed after creation @@ -124,7 +119,6 @@ def test_mgmt_topic_update_success(self, servicebus_namespace_connection_string, assert topic_description.enable_batched_operations == True assert topic_description.enable_express == True # assert topic_description.enable_partitioning == True - assert topic_description.is_anonymous_accessible == True assert topic_description.max_size_in_megabytes == 3072 # assert topic_description.requires_duplicate_detection == True # assert topic_description.requires_session == True From 3458fb9d460174d9b10a8b054529e90c1d9e1cd0 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 8 Sep 2020 16:20:45 -0700 Subject: [PATCH 16/16] Eventgrid Prepare for Release (#13643) * Release preparation * shared * codeowners --- .github/CODEOWNERS | 2 +- sdk/eventgrid/azure-eventgrid/CHANGELOG.md | 1 + .../azure-eventgrid/samples/README.md | 28 +++++++++++++++++++ sdk/eventgrid/azure-eventgrid/setup.py | 2 +- shared_requirements.txt | 1 + 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 sdk/eventgrid/azure-eventgrid/samples/README.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 38d07437c981..f33aafe15cb0 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -56,7 +56,7 @@ /sdk/datadatamigration/ @vchske # PRLabel: %Event Grid -/sdk/eventgrid/ @kalyanaj +/sdk/eventgrid/ @lmazuel @rakshith91 @KieranBrantnerMagee # PRLabel: %HDInsight /sdk/hdinsight/ @idear1203 diff --git a/sdk/eventgrid/azure-eventgrid/CHANGELOG.md b/sdk/eventgrid/azure-eventgrid/CHANGELOG.md index d44b57ff8e4b..52f2ef057025 100644 --- a/sdk/eventgrid/azure-eventgrid/CHANGELOG.md +++ b/sdk/eventgrid/azure-eventgrid/CHANGELOG.md @@ -5,6 +5,7 @@ **Features** - Version (2.0.0b1) is the first preview of our efforts to create a user-friendly and Pythonic client library for Azure EventGrid. For more information about this, and preview releases of other Azure SDK libraries, please visit https://azure.github.io/azure-sdk/releases/latest/python.html. + - Added Support for `CloudEvents`. - Implements the `EventGridPublisherClient` for the publish flow for EventGrid Events, CloudEvents and CustomEvents. - Implements the `EventGridConsumer` for the consume flow of the events. diff --git a/sdk/eventgrid/azure-eventgrid/samples/README.md b/sdk/eventgrid/azure-eventgrid/samples/README.md new file mode 100644 index 000000000000..c9e5555bf368 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/samples/README.md @@ -0,0 +1,28 @@ +--- +page_type: sample +languages: + - python +products: + - azure + - azure-eventgrid +urlFragment: azure-eventgrid-samples +--- + +# Azure Event Grid Client Library Python Samples + +These code samples show common champion scenario operations with the Azure Event Grid client library. + +* Publish Custom Events to a topic: [cs1_publish_custom_events_to_a_topic.py][python-eg-sample-customevent] +* Publish Custom events to a domain topic: [cs2_publish_custom_events_to_a_domain_topic.py][python-eg-sample-customevent-to-domain] +* Deserialize a System Event: [cs3_consume_system_events.py][python-eg-sample-consume-systemevent] +* Deserialize a Custom Event: [cs4_consume_custom_events.py][python-eg-sample-consume-customevent] +* Deserialize a Cloud Event: [cs5_consume_events_using_cloud_events_1.0_schema.py][python-eg-sample-consume-cloudevent] +* Publish a Cloud Event: [cs6_publish_events_using_cloud_events_1.0_schema.py][python-eg-sample-send-cloudevent] + +[python-eg-sample-customevent]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs1_publish_custom_events_to_a_topic.py +[python-eg-sample-customevent-to-domain]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs2_publish_custom_events_to_a_domain_topic.py +[python-eg-sample-consume-systemevent]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs3_consume_system_events.py +[python-eg-sample-consume-customevent]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs4_consume_custom_events.py +[python-eg-sample-send-cloudevent]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs5_publish_events_using_cloud_events_1.0_schema.py +[python-eg-sample-consume-cloudevent]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_consume_events_using_cloud_events_1.0_schema.py +[publisher-service-doc]: https://docs.microsoft.com/en-us/azure/event-grid/concepts \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/setup.py b/sdk/eventgrid/azure-eventgrid/setup.py index 9353b747230e..77d570f8d795 100644 --- a/sdk/eventgrid/azure-eventgrid/setup.py +++ b/sdk/eventgrid/azure-eventgrid/setup.py @@ -80,7 +80,7 @@ 'azure', ]), install_requires=[ - 'msrest>=0.5.0', + 'msrest>=0.6.19', 'azure-core<2.0.0,>=1.7.0', ], extras_require={ diff --git a/shared_requirements.txt b/shared_requirements.txt index 2e397e351331..55a2e73b30b8 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -163,3 +163,4 @@ opentelemetry-api==0.10b0 #override azure-synapse-artifacts azure-core>=1.6.0,<2.0.0 #override azure-data-tables msrest>=0.6.10 #override azure-ai-anomalydetector azure-core>=1.6.0,<2.0.0 +#override azure-eventgrid msrest>=0.6.19