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")