From 0e9e29ffb3e423b9e7efb3f9cb41b3d3cf2d6443 Mon Sep 17 00:00:00 2001 From: Ari Zavala Date: Mon, 1 Nov 2021 16:36:59 -0700 Subject: [PATCH 1/6] Add autogenerated code --- .../_generated/_configuration.py | 2 +- .../_generated/aio/_configuration.py | 2 +- ...munication_network_traversal_operations.py | 11 +++++--- .../_generated/models/__init__.py | 7 +++++ ...nication_network_traversal_client_enums.py | 26 ++++++++++++++++++ .../_generated/models/_models.py | 21 +++++++++++++++ .../_generated/models/_models_py3.py | 27 ++++++++++++++++++- ...munication_network_traversal_operations.py | 13 ++++++--- .../swagger/SWAGGER.md | 4 +-- 9 files changed, 101 insertions(+), 12 deletions(-) create mode 100644 sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_configuration.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_configuration.py index 2e7175c2d548..e6483b1110c2 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_configuration.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_configuration.py @@ -38,7 +38,7 @@ def __init__( super(CommunicationNetworkTraversalClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2021-06-21-preview" + self.api_version = "2021-10-08-preview" kwargs.setdefault('sdk_moniker', 'communicationnetworktraversalclient/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_configuration.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_configuration.py index be91851bbf30..8e29a0786662 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_configuration.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_configuration.py @@ -33,7 +33,7 @@ def __init__( super(CommunicationNetworkTraversalClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2021-06-21-preview" + self.api_version = "2021-10-08-preview" kwargs.setdefault('sdk_moniker', 'communicationnetworktraversalclient/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/operations/_communication_network_traversal_operations.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/operations/_communication_network_traversal_operations.py index c093ef0e412f..e550079f82ce 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/operations/_communication_network_traversal_operations.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/operations/_communication_network_traversal_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -48,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def issue_relay_configuration( self, id: Optional[str] = None, + route_type: Optional[Union[str, "_models.CommunicationRelayConfigurationRequestRouteType"]] = None, **kwargs: Any ) -> "_models.CommunicationRelayConfiguration": """Issue a configuration for an STUN/TURN server for an existing identity. @@ -56,6 +57,10 @@ async def issue_relay_configuration( :param id: An existing ACS identity. :type id: str + :param route_type: The routing methodology to where the ICE server will be located from the + client. + :type route_type: str or + ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType :keyword callable cls: A custom type or function that will be passed the direct response :return: CommunicationRelayConfiguration, or the result of cls(response) :rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration @@ -69,7 +74,7 @@ async def issue_relay_configuration( content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - _body = _models.CommunicationRelayConfigurationRequest(id=id) + _body = _models.CommunicationRelayConfigurationRequest(id=id, route_type=route_type) if _body is not None: json = self._serialize.body(_body, 'CommunicationRelayConfigurationRequest') else: @@ -86,7 +91,7 @@ async def issue_relay_configuration( } request.url = self._client.format_url(request.url, **path_format_arguments) - pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/__init__.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/__init__.py index ca88ae3e261e..f73e5f3a1f78 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/__init__.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/__init__.py @@ -19,10 +19,17 @@ from ._models import CommunicationRelayConfiguration # type: ignore from ._models import CommunicationRelayConfigurationRequest # type: ignore +from ._communication_network_traversal_client_enums import ( + CommunicationIceServerRouteType, + CommunicationRelayConfigurationRequestRouteType, +) + __all__ = [ 'CommunicationError', 'CommunicationErrorResponse', 'CommunicationIceServer', 'CommunicationRelayConfiguration', 'CommunicationRelayConfigurationRequest', + 'CommunicationIceServerRouteType', + 'CommunicationRelayConfigurationRequestRouteType', ] diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py new file mode 100644 index 000000000000..484679d516cf --- /dev/null +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class CommunicationIceServerRouteType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The routing methodology to where the ICE server will be located from the client. + """ + + ANY = "any" + NEAREST = "nearest" + +class CommunicationRelayConfigurationRequestRouteType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The routing methodology to where the ICE server will be located from the client. + """ + + ANY = "any" + NEAREST = "nearest" diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models.py index fed3c7405e7a..804450c0ab4d 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models.py @@ -103,18 +103,24 @@ class CommunicationIceServer(msrest.serialization.Model): :vartype username: str :ivar credential: Required. Credential for the server. :vartype credential: str + :ivar route_type: Required. The routing methodology to where the ICE server will be located + from the client. Possible values include: "any", "nearest". + :vartype route_type: str or + ~azure.communication.networktraversal.models.CommunicationIceServerRouteType """ _validation = { 'urls': {'required': True}, 'username': {'required': True}, 'credential': {'required': True}, + 'route_type': {'required': True}, } _attribute_map = { 'urls': {'key': 'urls', 'type': '[str]'}, 'username': {'key': 'username', 'type': 'str'}, 'credential': {'key': 'credential', 'type': 'str'}, + 'route_type': {'key': 'routeType', 'type': 'str'}, } def __init__( @@ -128,11 +134,16 @@ def __init__( :paramtype username: str :keyword credential: Required. Credential for the server. :paramtype credential: str + :keyword route_type: Required. The routing methodology to where the ICE server will be located + from the client. Possible values include: "any", "nearest". + :paramtype route_type: str or + ~azure.communication.networktraversal.models.CommunicationIceServerRouteType """ super(CommunicationIceServer, self).__init__(**kwargs) self.urls = kwargs['urls'] self.username = kwargs['username'] self.credential = kwargs['credential'] + self.route_type = kwargs['route_type'] class CommunicationRelayConfiguration(msrest.serialization.Model): @@ -181,10 +192,15 @@ class CommunicationRelayConfigurationRequest(msrest.serialization.Model): :ivar id: An existing ACS identity. :vartype id: str + :ivar route_type: The routing methodology to where the ICE server will be located from the + client. Possible values include: "any", "nearest". + :vartype route_type: str or + ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, + 'route_type': {'key': 'routeType', 'type': 'str'}, } def __init__( @@ -194,6 +210,11 @@ def __init__( """ :keyword id: An existing ACS identity. :paramtype id: str + :keyword route_type: The routing methodology to where the ICE server will be located from the + client. Possible values include: "any", "nearest". + :paramtype route_type: str or + ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType """ super(CommunicationRelayConfigurationRequest, self).__init__(**kwargs) self.id = kwargs.get('id', None) + self.route_type = kwargs.get('route_type', None) diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models_py3.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models_py3.py index 75c2169ac8ec..8c8a21a2c4cf 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models_py3.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models_py3.py @@ -7,11 +7,13 @@ # -------------------------------------------------------------------------- import datetime -from typing import List, Optional +from typing import List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization +from ._communication_network_traversal_client_enums import * + class CommunicationError(msrest.serialization.Model): """The Communication Services error. @@ -111,18 +113,24 @@ class CommunicationIceServer(msrest.serialization.Model): :vartype username: str :ivar credential: Required. Credential for the server. :vartype credential: str + :ivar route_type: Required. The routing methodology to where the ICE server will be located + from the client. Possible values include: "any", "nearest". + :vartype route_type: str or + ~azure.communication.networktraversal.models.CommunicationIceServerRouteType """ _validation = { 'urls': {'required': True}, 'username': {'required': True}, 'credential': {'required': True}, + 'route_type': {'required': True}, } _attribute_map = { 'urls': {'key': 'urls', 'type': '[str]'}, 'username': {'key': 'username', 'type': 'str'}, 'credential': {'key': 'credential', 'type': 'str'}, + 'route_type': {'key': 'routeType', 'type': 'str'}, } def __init__( @@ -131,6 +139,7 @@ def __init__( urls: List[str], username: str, credential: str, + route_type: Union[str, "CommunicationIceServerRouteType"], **kwargs ): """ @@ -140,11 +149,16 @@ def __init__( :paramtype username: str :keyword credential: Required. Credential for the server. :paramtype credential: str + :keyword route_type: Required. The routing methodology to where the ICE server will be located + from the client. Possible values include: "any", "nearest". + :paramtype route_type: str or + ~azure.communication.networktraversal.models.CommunicationIceServerRouteType """ super(CommunicationIceServer, self).__init__(**kwargs) self.urls = urls self.username = username self.credential = credential + self.route_type = route_type class CommunicationRelayConfiguration(msrest.serialization.Model): @@ -196,21 +210,32 @@ class CommunicationRelayConfigurationRequest(msrest.serialization.Model): :ivar id: An existing ACS identity. :vartype id: str + :ivar route_type: The routing methodology to where the ICE server will be located from the + client. Possible values include: "any", "nearest". + :vartype route_type: str or + ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, + 'route_type': {'key': 'routeType', 'type': 'str'}, } def __init__( self, *, id: Optional[str] = None, + route_type: Optional[Union[str, "CommunicationRelayConfigurationRequestRouteType"]] = None, **kwargs ): """ :keyword id: An existing ACS identity. :paramtype id: str + :keyword route_type: The routing methodology to where the ICE server will be located from the + client. Possible values include: "any", "nearest". + :paramtype route_type: str or + ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType """ super(CommunicationRelayConfigurationRequest, self).__init__(**kwargs) self.id = id + self.route_type = route_type diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/operations/_communication_network_traversal_operations.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/operations/_communication_network_traversal_operations.py index 1f20e8968ecf..c094fe189d15 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/operations/_communication_network_traversal_operations.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/operations/_communication_network_traversal_operations.py @@ -21,7 +21,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ def build_issue_relay_configuration_request( # type: (...) -> HttpRequest content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-06-21-preview" + api_version = "2021-10-08-preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/networktraversal/:issueRelayConfiguration') @@ -85,6 +85,7 @@ def __init__(self, client, config, serializer, deserializer): def issue_relay_configuration( self, id=None, # type: Optional[str] + route_type=None, # type: Optional[Union[str, "_models.CommunicationRelayConfigurationRequestRouteType"]] **kwargs # type: Any ): # type: (...) -> "_models.CommunicationRelayConfiguration" @@ -94,6 +95,10 @@ def issue_relay_configuration( :param id: An existing ACS identity. :type id: str + :param route_type: The routing methodology to where the ICE server will be located from the + client. + :type route_type: str or + ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType :keyword callable cls: A custom type or function that will be passed the direct response :return: CommunicationRelayConfiguration, or the result of cls(response) :rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration @@ -107,7 +112,7 @@ def issue_relay_configuration( content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - _body = _models.CommunicationRelayConfigurationRequest(id=id) + _body = _models.CommunicationRelayConfigurationRequest(id=id, route_type=route_type) if _body is not None: json = self._serialize.body(_body, 'CommunicationRelayConfigurationRequest') else: @@ -124,7 +129,7 @@ def issue_relay_configuration( } request.url = self._client.format_url(request.url, **path_format_arguments) - pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: diff --git a/sdk/communication/azure-communication-networktraversal/swagger/SWAGGER.md b/sdk/communication/azure-communication-networktraversal/swagger/SWAGGER.md index 4b4fb6c76e35..2a306546a095 100644 --- a/sdk/communication/azure-communication-networktraversal/swagger/SWAGGER.md +++ b/sdk/communication/azure-communication-networktraversal/swagger/SWAGGER.md @@ -16,8 +16,8 @@ autorest ./SWAGGER.md ### Settings ``` yaml -tag: package-2021-06-21-preview -require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/4c8162b0a1f7bbd46e9aedc0e19bbe181e549c4c/specification/communication/data-plane/NetworkTraversal/readme.md +tag: package-2021-10-08-preview +require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/283fd578dca61390523cae07a2312a34ea87ec90/specification/communication/data-plane/NetworkTraversal/readme.md output-folder: ../azure/communication/networktraversal/_generated/ namespace: azure.communication.networktraversal license-header: MICROSOFT_MIT_NO_VERSION From 0e000d7e00206a0f2c933c82144728459514c0a2 Mon Sep 17 00:00:00 2001 From: Ari Zavala Date: Tue, 9 Nov 2021 18:49:07 -0800 Subject: [PATCH 2/6] RouteType option and tests --- .../networktraversal/__init__.py | 1 + .../_communication_relay_client.py | 4 +- ..._communication_network_traversal_client.py | 5 +- .../_generated/_configuration.py | 8 +- .../_generated/aio/__init__.py | 6 ++ ..._communication_network_traversal_client.py | 5 +- .../_generated/aio/_configuration.py | 8 +- ...munication_network_traversal_operations.py | 11 ++- .../_generated/models/__init__.py | 6 +- ...nication_network_traversal_client_enums.py | 9 +- .../_generated/models/_models.py | 12 +-- .../_generated/models/_models_py3.py | 16 ++- ...munication_network_traversal_operations.py | 14 ++- .../networktraversal/aio/__init__.py | 1 + .../aio/_communication_relay_client_async.py | 4 +- .../samples/network_traversal_samples.py | 20 ---- .../network_traversal_samples_async.py | 19 ---- .../swagger/SWAGGER.md | 2 +- ...y_client.test_get_relay_configuration.yaml | 42 ++++---- ...lay_configuration_with_route_type_any.yaml | 96 ++++++++++++++++++ ...configuration_with_route_type_nearest.yaml | 97 +++++++++++++++++++ ..._relay_configuration_without_identity.yaml | 24 ++--- ...nt_async.test_get_relay_configuration.yaml | 42 ++++---- ...lay_configuration_with_route_type_any.yaml | 72 ++++++++++++++ ...configuration_with_route_type_nearest.yaml | 73 ++++++++++++++ ..._relay_configuration_without_identity.yaml | 25 +++-- .../tests/test_communication_relay_client.py | 61 ++++++++++-- .../test_communication_relay_client_async.py | 53 +++++++++- 28 files changed, 568 insertions(+), 168 deletions(-) create mode 100644 sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml create mode 100644 sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml create mode 100644 sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml create mode 100644 sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/__init__.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/__init__.py index 6b34c6a0afb5..aa3aa4febf32 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/__init__.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/__init__.py @@ -6,3 +6,4 @@ # pylint: disable=bad-option-value, unused-import from ._communication_relay_client import CommunicationRelayClient +from ._generated.models import RouteType diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py index c4eb0fc83c7b..aceacd10ab81 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py @@ -86,6 +86,7 @@ def from_connection_string( def get_relay_configuration( self, user=None, # type: CommunicationUserIdentifier + route_type=None, #type: RouteType **kwargs # type: Any ): # type: (Any) -> CommunicationRelayConfiguration @@ -96,7 +97,8 @@ def get_relay_configuration( """ if user is None: return self._network_traversal_service_client.communication_network_traversal.issue_relay_configuration( - None, **kwargs) + None, route_type, **kwargs) return self._network_traversal_service_client.communication_network_traversal.issue_relay_configuration( user.properties['id'], + route_type, **kwargs) diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_communication_network_traversal_client.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_communication_network_traversal_client.py index 232315d13b62..afc2c120fbba 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_communication_network_traversal_client.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_communication_network_traversal_client.py @@ -31,6 +31,9 @@ class CommunicationNetworkTraversalClient(object): :param endpoint: The communication resource, for example https://my-resource.communication.azure.com. :type endpoint: str + :keyword api_version: Api Version. The default value is "2021-10-08-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -40,7 +43,7 @@ def __init__( ): # type: (...) -> None _base_url = '{endpoint}' - self._config = CommunicationNetworkTraversalClientConfiguration(endpoint, **kwargs) + self._config = CommunicationNetworkTraversalClientConfiguration(endpoint=endpoint, **kwargs) self._client = PipelineClient(base_url=_base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_configuration.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_configuration.py index e6483b1110c2..23b7c48186ca 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_configuration.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/_configuration.py @@ -25,6 +25,8 @@ class CommunicationNetworkTraversalClientConfiguration(Configuration): :param endpoint: The communication resource, for example https://my-resource.communication.azure.com. :type endpoint: str + :keyword api_version: Api Version. The default value is "2021-10-08-preview". Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -33,12 +35,14 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None + super(CommunicationNetworkTraversalClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-10-08-preview") # type: str + if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") - super(CommunicationNetworkTraversalClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2021-10-08-preview" + self.api_version = api_version kwargs.setdefault('sdk_moniker', 'communicationnetworktraversalclient/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/__init__.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/__init__.py index ec77cdaca90a..c71626ac5e17 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/__init__.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/__init__.py @@ -8,3 +8,9 @@ from ._communication_network_traversal_client import CommunicationNetworkTraversalClient __all__ = ['CommunicationNetworkTraversalClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_communication_network_traversal_client.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_communication_network_traversal_client.py index cb1e98300c1d..306d55bcf1b7 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_communication_network_traversal_client.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_communication_network_traversal_client.py @@ -26,6 +26,9 @@ class CommunicationNetworkTraversalClient: :param endpoint: The communication resource, for example https://my-resource.communication.azure.com. :type endpoint: str + :keyword api_version: Api Version. The default value is "2021-10-08-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -34,7 +37,7 @@ def __init__( **kwargs: Any ) -> None: _base_url = '{endpoint}' - self._config = CommunicationNetworkTraversalClientConfiguration(endpoint, **kwargs) + self._config = CommunicationNetworkTraversalClientConfiguration(endpoint=endpoint, **kwargs) self._client = AsyncPipelineClient(base_url=_base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_configuration.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_configuration.py index 8e29a0786662..8caa9bc6f914 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_configuration.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/_configuration.py @@ -21,6 +21,8 @@ class CommunicationNetworkTraversalClientConfiguration(Configuration): :param endpoint: The communication resource, for example https://my-resource.communication.azure.com. :type endpoint: str + :keyword api_version: Api Version. The default value is "2021-10-08-preview". Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -28,12 +30,14 @@ def __init__( endpoint: str, **kwargs: Any ) -> None: + super(CommunicationNetworkTraversalClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-10-08-preview") # type: str + if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") - super(CommunicationNetworkTraversalClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2021-10-08-preview" + self.api_version = api_version kwargs.setdefault('sdk_moniker', 'communicationnetworktraversalclient/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/operations/_communication_network_traversal_operations.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/operations/_communication_network_traversal_operations.py index e550079f82ce..2c0527b05e3b 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/operations/_communication_network_traversal_operations.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/aio/operations/_communication_network_traversal_operations.py @@ -18,7 +18,6 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._communication_network_traversal_operations import build_issue_relay_configuration_request - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +47,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def issue_relay_configuration( self, id: Optional[str] = None, - route_type: Optional[Union[str, "_models.CommunicationRelayConfigurationRequestRouteType"]] = None, + route_type: Optional[Union[str, "_models.RouteType"]] = None, **kwargs: Any ) -> "_models.CommunicationRelayConfiguration": """Issue a configuration for an STUN/TURN server for an existing identity. @@ -59,8 +58,10 @@ async def issue_relay_configuration( :type id: str :param route_type: The routing methodology to where the ICE server will be located from the client. - :type route_type: str or - ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType + :type route_type: str or ~azure.communication.networktraversal.models.RouteType + :keyword api_version: Api Version. The default value is "2021-10-08-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CommunicationRelayConfiguration, or the result of cls(response) :rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration @@ -72,6 +73,7 @@ async def issue_relay_configuration( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-10-08-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _body = _models.CommunicationRelayConfigurationRequest(id=id, route_type=route_type) @@ -81,6 +83,7 @@ async def issue_relay_configuration( json = None request = build_issue_relay_configuration_request( + api_version=api_version, content_type=content_type, json=json, template_url=self.issue_relay_configuration.metadata['url'], diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/__init__.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/__init__.py index f73e5f3a1f78..44beaa0e11b1 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/__init__.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/__init__.py @@ -20,8 +20,7 @@ from ._models import CommunicationRelayConfigurationRequest # type: ignore from ._communication_network_traversal_client_enums import ( - CommunicationIceServerRouteType, - CommunicationRelayConfigurationRequestRouteType, + RouteType, ) __all__ = [ @@ -30,6 +29,5 @@ 'CommunicationIceServer', 'CommunicationRelayConfiguration', 'CommunicationRelayConfigurationRequest', - 'CommunicationIceServerRouteType', - 'CommunicationRelayConfigurationRequestRouteType', + 'RouteType', ] diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py index 484679d516cf..4ec5d071d1eb 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py @@ -11,14 +11,7 @@ from azure.core import CaseInsensitiveEnumMeta -class CommunicationIceServerRouteType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The routing methodology to where the ICE server will be located from the client. - """ - - ANY = "any" - NEAREST = "nearest" - -class CommunicationRelayConfigurationRequestRouteType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class RouteType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The routing methodology to where the ICE server will be located from the client. """ diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models.py index 804450c0ab4d..bcdf46396908 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models.py @@ -105,8 +105,7 @@ class CommunicationIceServer(msrest.serialization.Model): :vartype credential: str :ivar route_type: Required. The routing methodology to where the ICE server will be located from the client. Possible values include: "any", "nearest". - :vartype route_type: str or - ~azure.communication.networktraversal.models.CommunicationIceServerRouteType + :vartype route_type: str or ~azure.communication.networktraversal.models.RouteType """ _validation = { @@ -136,8 +135,7 @@ def __init__( :paramtype credential: str :keyword route_type: Required. The routing methodology to where the ICE server will be located from the client. Possible values include: "any", "nearest". - :paramtype route_type: str or - ~azure.communication.networktraversal.models.CommunicationIceServerRouteType + :paramtype route_type: str or ~azure.communication.networktraversal.models.RouteType """ super(CommunicationIceServer, self).__init__(**kwargs) self.urls = kwargs['urls'] @@ -194,8 +192,7 @@ class CommunicationRelayConfigurationRequest(msrest.serialization.Model): :vartype id: str :ivar route_type: The routing methodology to where the ICE server will be located from the client. Possible values include: "any", "nearest". - :vartype route_type: str or - ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType + :vartype route_type: str or ~azure.communication.networktraversal.models.RouteType """ _attribute_map = { @@ -212,8 +209,7 @@ def __init__( :paramtype id: str :keyword route_type: The routing methodology to where the ICE server will be located from the client. Possible values include: "any", "nearest". - :paramtype route_type: str or - ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType + :paramtype route_type: str or ~azure.communication.networktraversal.models.RouteType """ super(CommunicationRelayConfigurationRequest, self).__init__(**kwargs) self.id = kwargs.get('id', None) diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models_py3.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models_py3.py index 8c8a21a2c4cf..d6fde2dcabd2 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models_py3.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models_py3.py @@ -115,8 +115,7 @@ class CommunicationIceServer(msrest.serialization.Model): :vartype credential: str :ivar route_type: Required. The routing methodology to where the ICE server will be located from the client. Possible values include: "any", "nearest". - :vartype route_type: str or - ~azure.communication.networktraversal.models.CommunicationIceServerRouteType + :vartype route_type: str or ~azure.communication.networktraversal.models.RouteType """ _validation = { @@ -139,7 +138,7 @@ def __init__( urls: List[str], username: str, credential: str, - route_type: Union[str, "CommunicationIceServerRouteType"], + route_type: Union[str, "RouteType"], **kwargs ): """ @@ -151,8 +150,7 @@ def __init__( :paramtype credential: str :keyword route_type: Required. The routing methodology to where the ICE server will be located from the client. Possible values include: "any", "nearest". - :paramtype route_type: str or - ~azure.communication.networktraversal.models.CommunicationIceServerRouteType + :paramtype route_type: str or ~azure.communication.networktraversal.models.RouteType """ super(CommunicationIceServer, self).__init__(**kwargs) self.urls = urls @@ -212,8 +210,7 @@ class CommunicationRelayConfigurationRequest(msrest.serialization.Model): :vartype id: str :ivar route_type: The routing methodology to where the ICE server will be located from the client. Possible values include: "any", "nearest". - :vartype route_type: str or - ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType + :vartype route_type: str or ~azure.communication.networktraversal.models.RouteType """ _attribute_map = { @@ -225,7 +222,7 @@ def __init__( self, *, id: Optional[str] = None, - route_type: Optional[Union[str, "CommunicationRelayConfigurationRequestRouteType"]] = None, + route_type: Optional[Union[str, "RouteType"]] = None, **kwargs ): """ @@ -233,8 +230,7 @@ def __init__( :paramtype id: str :keyword route_type: The routing methodology to where the ICE server will be located from the client. Possible values include: "any", "nearest". - :paramtype route_type: str or - ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType + :paramtype route_type: str or ~azure.communication.networktraversal.models.RouteType """ super(CommunicationRelayConfigurationRequest, self).__init__(**kwargs) self.id = id diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/operations/_communication_network_traversal_operations.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/operations/_communication_network_traversal_operations.py index c094fe189d15..036ca8a53b1d 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/operations/_communication_network_traversal_operations.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/operations/_communication_network_traversal_operations.py @@ -22,20 +22,20 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False # fmt: off def build_issue_relay_configuration_request( **kwargs # type: Any ): # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2021-10-08-preview") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-10-08-preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/networktraversal/:issueRelayConfiguration') @@ -85,7 +85,7 @@ def __init__(self, client, config, serializer, deserializer): def issue_relay_configuration( self, id=None, # type: Optional[str] - route_type=None, # type: Optional[Union[str, "_models.CommunicationRelayConfigurationRequestRouteType"]] + route_type=None, # type: Optional[Union[str, "_models.RouteType"]] **kwargs # type: Any ): # type: (...) -> "_models.CommunicationRelayConfiguration" @@ -97,8 +97,10 @@ def issue_relay_configuration( :type id: str :param route_type: The routing methodology to where the ICE server will be located from the client. - :type route_type: str or - ~azure.communication.networktraversal.models.CommunicationRelayConfigurationRequestRouteType + :type route_type: str or ~azure.communication.networktraversal.models.RouteType + :keyword api_version: Api Version. The default value is "2021-10-08-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CommunicationRelayConfiguration, or the result of cls(response) :rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration @@ -110,6 +112,7 @@ def issue_relay_configuration( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-10-08-preview") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _body = _models.CommunicationRelayConfigurationRequest(id=id, route_type=route_type) @@ -119,6 +122,7 @@ def issue_relay_configuration( json = None request = build_issue_relay_configuration_request( + api_version=api_version, content_type=content_type, json=json, template_url=self.issue_relay_configuration.metadata['url'], diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/__init__.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/__init__.py index 60e51a69334d..4b9333068023 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/__init__.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/__init__.py @@ -5,6 +5,7 @@ # -------------------------------------------------------------------------- from ._communication_relay_client_async import CommunicationRelayClient +from .._generated.models import RouteType __all__ = [ 'CommunicationRelayClient' diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py index f04ea0c60c23..7a0a6cfcf9df 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py @@ -84,6 +84,7 @@ def from_connection_string( async def get_relay_configuration( self, user: 'CommunicationUserIdentifier' = None, + route_type: 'CommunicationRelayConfigurationRequestRouteType' = None, **kwargs # type: Any ) -> 'CommunicationRelayConfiguration': """get a Communication Relay configuration. @@ -93,9 +94,10 @@ async def get_relay_configuration( """ if user is None: return await self._network_traversal_service_client.communication_network_traversal. \ - issue_relay_configuration(None, **kwargs) + issue_relay_configuration(None, route_type, **kwargs) return await self._network_traversal_service_client.communication_network_traversal.issue_relay_configuration( user.properties['id'], + route_type, **kwargs) async def __aenter__(self) -> "CommunicationRelayClient": diff --git a/sdk/communication/azure-communication-networktraversal/samples/network_traversal_samples.py b/sdk/communication/azure-communication-networktraversal/samples/network_traversal_samples.py index e0a658cbd187..96589bd48dd4 100644 --- a/sdk/communication/azure-communication-networktraversal/samples/network_traversal_samples.py +++ b/sdk/communication/azure-communication-networktraversal/samples/network_traversal_samples.py @@ -58,26 +58,6 @@ def get_relay_config(self): print("Icer server:") print(iceServer) - def get_relay_config_no_identity(self): - from azure.communication.networktraversal import ( - CommunicationRelayClient - ) - - if self.client_id is not None and self.client_secret is not None and self.tenant_id is not None: - from azure.identity import DefaultAzureCredential - endpoint, _ = parse_connection_str(self.connection_string) - relay_client = CommunicationRelayClient(endpoint, DefaultAzureCredential()) - else: - relay_client = CommunicationRelayClient.from_connection_string(self.connection_string) - - print("Getting relay configuration") - relay_configuration = relay_client.get_relay_configuration() - - for iceServer in relay_configuration.ice_servers: - print("Icer server:") - print(iceServer) - if __name__ == '__main__': sample = CommunicationRelayClientSamples() sample.get_relay_config() - sample.get_relay_config_no_identity() diff --git a/sdk/communication/azure-communication-networktraversal/samples/network_traversal_samples_async.py b/sdk/communication/azure-communication-networktraversal/samples/network_traversal_samples_async.py index 5d3932338adf..7eb8c56d6950 100644 --- a/sdk/communication/azure-communication-networktraversal/samples/network_traversal_samples_async.py +++ b/sdk/communication/azure-communication-networktraversal/samples/network_traversal_samples_async.py @@ -57,28 +57,9 @@ async def get_relay_config(self): print("Icer server:") print(iceServer) - async def get_relay_config_no_identity(self): - from azure.communication.networktraversal.aio import CommunicationRelayClient - - if self.client_id is not None and self.client_secret is not None and self.tenant_id is not None: - from azure.identity.aio import DefaultAzureCredential - endpoint, _ = parse_connection_str(self.connection_string) - relay_client = CommunicationRelayClient(endpoint, DefaultAzureCredential()) - else: - relay_client = CommunicationRelayClient.from_connection_string(self.connection_string) - - async with relay_client: - print("Getting relay configuration") - relay_configuration = await relay_client.get_relay_configuration() - - for iceServer in relay_configuration.ice_servers: - print("Icer server:") - print(iceServer) - async def main(): sample = CommunicationRelayClientSamples() await sample.get_relay_config() - await sample.get_relay_config_no_identity() if __name__ == '__main__': loop = asyncio.get_event_loop() diff --git a/sdk/communication/azure-communication-networktraversal/swagger/SWAGGER.md b/sdk/communication/azure-communication-networktraversal/swagger/SWAGGER.md index 2a306546a095..df98393216d6 100644 --- a/sdk/communication/azure-communication-networktraversal/swagger/SWAGGER.md +++ b/sdk/communication/azure-communication-networktraversal/swagger/SWAGGER.md @@ -17,7 +17,7 @@ autorest ./SWAGGER.md ### Settings ``` yaml tag: package-2021-10-08-preview -require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/283fd578dca61390523cae07a2312a34ea87ec90/specification/communication/data-plane/NetworkTraversal/readme.md +require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f2e08ab373eb0e96b54920e89f9fc96d683355ca/specification/communication/data-plane/NetworkTraversal/readme.md output-folder: ../azure/communication/networktraversal/_generated/ namespace: azure.communication.networktraversal license-header: MICROSOFT_MIT_NO_VERSION diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml index 10e71f3b7d7e..37ac68581104 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml @@ -13,13 +13,13 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.7.4 (Windows-10-10.0.22454-SP0) + - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Fri, 01 Oct 2021 23:03:08 GMT + - Wed, 10 Nov 2021 22:11:50 GMT x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-10-31-preview response: body: string: '{"identity": {"id": "sanitized"}}' @@ -27,22 +27,22 @@ interactions: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, 2021-10-31-preview + content-length: + - '101' content-type: - application/json; charset=utf-8 date: - - Fri, 01 Oct 2021 23:03:07 GMT + - Wed, 10 Nov 2021 22:11:50 GMT ms-cv: - - FV1I5QAfBk69A3bUGCU3xg.0 + - vug3lSbrLUeWHAoTQF9K8A.0 request-context: - appId= strict-transport-security: - max-age=2592000 - transfer-encoding: - - chunked x-cache: - CONFIG_NOCACHE x-processing-time: - - 179ms + - 44ms status: code: 201 message: Created @@ -60,37 +60,39 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22454-SP0) + - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Fri, 01 Oct 2021 23:03:08 GMT + - Wed, 10 Nov 2021 22:11:50 GMT x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-06-21-preview + uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview response: body: - string: '{"expiresOn": "2021-10-01T23:03:08.8008369+00:00", "iceServers": [{"urls": - ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", - "credential": "sanitized"}]}' + string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], + "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", + "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": + "BQAANksGVt4B19gS8Lb+vxW6oP1nmVTKtyyuY+TSztUAAAAMARCsgNlqhd5IsZldo6P6NifI1W7m/58vAl5NNuX7wFldw/QrbrI=", + "credential": "qXWLvJMJvz1ERUrh2Rgbq5W7/rg="}], "expiresOn": "2021-11-10T22:11:51.0590396+00:00"}' headers: api-supported-versions: - - 2021-02-22-preview1, 2021-06-21-preview + - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview + content-length: + - '560' content-type: - application/json; charset=utf-8 date: - - Fri, 01 Oct 2021 23:03:08 GMT + - Wed, 10 Nov 2021 22:11:51 GMT ms-cv: - - T1Tb9K+y6E6pLXFgnCjmmg.0 + - Z5bc4Wnyz0+tCw6tOOvbNQ.0 request-context: - appId= strict-transport-security: - max-age=2592000 - transfer-encoding: - - chunked x-cache: - CONFIG_NOCACHE x-processing-time: - - 128ms + - 23ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml new file mode 100644 index 000000000000..2ae36f400a77 --- /dev/null +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml @@ -0,0 +1,96 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) + x-ms-date: + - Wed, 10 Nov 2021 22:11:51 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-10-31-preview + response: + body: + string: '{"identity": {"id": "sanitized"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + content-length: + - '101' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Nov 2021 22:11:50 GMT + ms-cv: + - pea7KFeta0yz+d5I+l5x5A.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 23ms + status: + code: 201 + message: Created +- request: + body: '{"id": "sanitized", "routeType": "any"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '109' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) + x-ms-date: + - Wed, 10 Nov 2021 22:11:51 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview + response: + body: + string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], + "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-10T22:11:51.6345782+00:00"}' + headers: + api-supported-versions: + - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview + content-length: + - '319' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Nov 2021 22:11:51 GMT + ms-cv: + - JQL72YekxEO0P35AwHKGwQ.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 88ms + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml new file mode 100644 index 000000000000..1fa6e7065bd6 --- /dev/null +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml @@ -0,0 +1,97 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) + x-ms-date: + - Wed, 10 Nov 2021 22:11:51 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-10-31-preview + response: + body: + string: '{"identity": {"id": "sanitized"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + content-length: + - '101' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Nov 2021 22:11:51 GMT + ms-cv: + - qh9OWFVE6UivRoo1YLvO0w.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 24ms + status: + code: 201 + message: Created +- request: + body: '{"id": "sanitized", "routeType": "nearest"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '113' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) + x-ms-date: + - Wed, 10 Nov 2021 22:11:51 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview + response: + body: + string: '{"iceServers": [{"routeType": "nearest", "urls": ["turn.skype.com", + "turn:13.107.17.41:3478"], "username": "sanitized", "credential": "sanitized"}], + "expiresOn": "2021-11-10T22:11:51.8649696+00:00"}' + headers: + api-supported-versions: + - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview + content-length: + - '305' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Nov 2021 22:11:51 GMT + ms-cv: + - RC7pSMciR0GK77B71fTqjw.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 21ms + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml index 7a1fa30695d5..e27b14decf8b 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml @@ -13,27 +13,23 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22454-SP0) + - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Fri, 01 Oct 2021 23:03:08 GMT + - Wed, 10 Nov 2021 02:43:46 GMT x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-06-21-preview + uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview response: body: - string: '{"expiresOn": "2021-10-01T23:03:09.2274327+00:00", "iceServers": [{"urls": - ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", - "credential": "sanitized"}]}' + string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' headers: - api-supported-versions: - - 2021-02-22-preview1, 2021-06-21-preview content-type: - - application/json; charset=utf-8 + - application/json date: - - Fri, 01 Oct 2021 23:03:08 GMT + - Wed, 10 Nov 2021 02:43:46 GMT ms-cv: - - c1XdV0vrhEOnOWF2LrDjGQ.0 + - oDaiaJ5PkUq9TNTsJyP6Sg.0 request-context: - appId= strict-transport-security: @@ -43,8 +39,8 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 311ms + - 9ms status: - code: 200 - message: OK + code: 401 + message: Unauthorized version: 1 diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml index 0902b75be361..c542ca9052c2 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml @@ -9,31 +9,31 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.7.4 (Windows-10-10.0.22454-SP0) + - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Fri, 01 Oct 2021 23:03:09 GMT + - Wed, 10 Nov 2021 22:11:51 GMT x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/identities?api-version=2021-10-31-preview response: body: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, 2021-10-31-preview + content-length: '101' content-type: application/json; charset=utf-8 - date: Fri, 01 Oct 2021 23:03:09 GMT - ms-cv: hEHBfG5MIkqgUk3m0Wdarw.0 + date: Wed, 10 Nov 2021 22:11:51 GMT + ms-cv: GynjuQm1oUuxQMqmcjtgyg.0 request-context: appId= strict-transport-security: max-age=2592000 - transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 145ms + x-processing-time: 27ms status: code: 201 message: Created - url: https://smstestapp.communication.azure.com/identities?api-version=2021-03-07 + url: https://smstestapp.communication.azure.com/identities?api-version=2021-10-31-preview - request: body: '{"id": "sanitized"}' headers: @@ -44,30 +44,32 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22454-SP0) + - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Fri, 01 Oct 2021 23:03:09 GMT + - Wed, 10 Nov 2021 22:11:51 GMT x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-06-21-preview + uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview response: body: - string: '{"expiresOn": "2021-10-01T23:03:10.0042344+00:00", "iceServers": [{"urls": - ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", - "credential": "sanitized"}]}' + string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], + "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", + "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": + "BQAANkukXQMB19gSYdXtLqhi7A41dwQPkLVlfAK8wZ8AAAAMARCsgNlqhd5IsZldo6P6NifIM3HjmLwECvQ6BTJYFW5n/fzu2Gg=", + "credential": "5caHpuagc1m5x9BvsVMcbC2D+EQ="}], "expiresOn": "2021-11-10T22:11:52.0851966+00:00"}' headers: - api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview + api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview + content-length: '560' content-type: application/json; charset=utf-8 - date: Fri, 01 Oct 2021 23:03:09 GMT - ms-cv: pDiu+i86Fk+DMv1bFRw7qA.0 + date: Wed, 10 Nov 2021 22:11:51 GMT + ms-cv: rTN2hcJ8DE65nzciBzPGfA.0 request-context: appId= strict-transport-security: max-age=2592000 - transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 118ms + x-processing-time: 20ms status: code: 200 message: OK - url: https://smstestapp.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-06-21-preview + url: https://smstestapp.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview version: 1 diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml new file mode 100644 index 000000000000..949cd731da22 --- /dev/null +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml @@ -0,0 +1,72 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) + x-ms-date: + - Wed, 10 Nov 2021 22:11:52 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-10-31-preview + response: + body: + string: '{"identity": {"id": "sanitized"}}' + headers: + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, + 2021-03-31-preview1, 2021-10-31-preview + content-length: '101' + content-type: application/json; charset=utf-8 + date: Wed, 10 Nov 2021 22:11:51 GMT + ms-cv: 7N/qTH9boE2H1wsmfTEtqA.0 + request-context: appId= + strict-transport-security: max-age=2592000 + x-cache: CONFIG_NOCACHE + x-processing-time: 23ms + status: + code: 201 + message: Created + url: https://smstestapp.communication.azure.com/identities?api-version=2021-10-31-preview +- request: + body: '{"id": "sanitized", "routeType": "any"}' + headers: + Accept: + - application/json + Content-Length: + - '109' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) + x-ms-date: + - Wed, 10 Nov 2021 22:11:52 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview + response: + body: + string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], + "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-10T22:11:52.3668579+00:00"}' + headers: + api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview + content-length: '319' + content-type: application/json; charset=utf-8 + date: Wed, 10 Nov 2021 22:11:52 GMT + ms-cv: drPQHdOrqk+qbrxWVnPsPg.0 + request-context: appId= + strict-transport-security: max-age=2592000 + x-cache: CONFIG_NOCACHE + x-processing-time: 22ms + status: + code: 200 + message: OK + url: https://smstestapp.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview +version: 1 diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml new file mode 100644 index 000000000000..1cc6965deace --- /dev/null +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml @@ -0,0 +1,73 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) + x-ms-date: + - Wed, 10 Nov 2021 22:11:52 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-10-31-preview + response: + body: + string: '{"identity": {"id": "sanitized"}}' + headers: + api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, + 2021-03-31-preview1, 2021-10-31-preview + content-length: '101' + content-type: application/json; charset=utf-8 + date: Wed, 10 Nov 2021 22:11:52 GMT + ms-cv: q0qf2xdpz0+6WirMnd0KGA.0 + request-context: appId= + strict-transport-security: max-age=2592000 + x-cache: CONFIG_NOCACHE + x-processing-time: 23ms + status: + code: 201 + message: Created + url: https://smstestapp.communication.azure.com/identities?api-version=2021-10-31-preview +- request: + body: '{"id": "sanitized", "routeType": "nearest"}' + headers: + Accept: + - application/json + Content-Length: + - '113' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) + x-ms-date: + - Wed, 10 Nov 2021 22:11:52 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview + response: + body: + string: '{"iceServers": [{"routeType": "nearest", "urls": ["turn.skype.com", + "turn:13.107.17.41:3478"], "username": "sanitized", "credential": "sanitized"}], + "expiresOn": "2021-11-10T22:11:52.6821641+00:00"}' + headers: + api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview + content-length: '305' + content-type: application/json; charset=utf-8 + date: Wed, 10 Nov 2021 22:11:52 GMT + ms-cv: LyoOgZQNM0mc0+4Lm7Bmbg.0 + request-context: appId= + strict-transport-security: max-age=2592000 + x-cache: CONFIG_NOCACHE + x-processing-time: 38ms + status: + code: 200 + message: OK + url: https://smstestapp.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview +version: 1 diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml index 93ea5a5eea47..f11e9bc7c7bf 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml @@ -9,30 +9,27 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22454-SP0) + - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Fri, 01 Oct 2021 23:03:10 GMT + - Wed, 10 Nov 2021 02:43:47 GMT x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-06-21-preview + uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview response: body: - string: '{"expiresOn": "2021-10-01T23:03:10.2349126+00:00", "iceServers": [{"urls": - ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", - "credential": "sanitized"}]}' + string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' headers: - api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview - content-type: application/json; charset=utf-8 - date: Fri, 01 Oct 2021 23:03:09 GMT - ms-cv: roYDP9+E6EKToiocQJpVlg.0 + content-type: application/json + date: Wed, 10 Nov 2021 02:43:46 GMT + ms-cv: bIks/Sfk+0GQz4otdIHTmg.0 request-context: appId= strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 117ms + x-processing-time: 9ms status: - code: 200 - message: OK - url: https://smstestapp.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-06-21-preview + code: 401 + message: Unauthorized + url: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview version: 1 diff --git a/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client.py b/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client.py index 53f5a0921257..ef3c4ed07eaf 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client.py +++ b/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client.py @@ -6,6 +6,7 @@ # -------------------------------------------------------------------------- from azure.core.credentials import AccessToken from azure.communication.identity import CommunicationIdentityClient +from azure.communication.networktraversal import RouteType from azure.communication.identity._api_versions import ApiVersion from azure.communication.networktraversal import CommunicationRelayClient from _shared.helper import URIIdentityReplacer @@ -36,7 +37,6 @@ def setUp(self): def test_get_relay_configuration(self, communication_livetest_dynamic_connection_string): identity_client = CommunicationIdentityClient.from_connection_string( communication_livetest_dynamic_connection_string, - api_version=ApiVersion.V2021_03_07, http_logging_policy=get_http_logging_policy() ) user = identity_client.create_user() @@ -49,7 +49,8 @@ def test_get_relay_configuration(self, communication_livetest_dynamic_connection print('Getting relay config:\n') config = relay_client.get_relay_configuration(user) - print('Ice Servers: \n') + print(config.ice_servers) + for iceServer in config.ice_servers: assert iceServer.username is not None print('Username: ' + iceServer.username) @@ -58,23 +59,31 @@ def test_get_relay_configuration(self, communication_livetest_dynamic_connection print('Credential: ' + iceServer.credential) assert iceServer.urls is not None + for url in iceServer.urls: print('Url: ' + url) + + print(iceServer.route_type) + assert iceServer.route_type is not None assert config is not None @CommunicationPreparer() - def test_get_relay_configuration_without_identity(self, communication_livetest_dynamic_connection_string): - + def test_get_relay_configuration_with_route_type_nearest(self, communication_livetest_dynamic_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_livetest_dynamic_connection_string, + http_logging_policy=get_http_logging_policy() + ) + user = identity_client.create_user() + relay_client = CommunicationRelayClient.from_connection_string( communication_livetest_dynamic_connection_string, http_logging_policy=get_http_logging_policy() ) - print('Getting relay config:\n') - config = relay_client.get_relay_configuration() - - print('Ice Servers: \n') + print('Getting relay config with route type nearest:\n') + config = relay_client.get_relay_configuration(user, RouteType.NEAREST) + for iceServer in config.ice_servers: assert iceServer.username is not None print('Username: ' + iceServer.username) @@ -86,5 +95,39 @@ def test_get_relay_configuration_without_identity(self, communication_livetest_d for url in iceServer.urls: print('Url: ' + url) + print(iceServer.route_type) + assert iceServer.route_type == RouteType.NEAREST + assert config is not None - \ No newline at end of file + + @CommunicationPreparer() + def test_get_relay_configuration_with_route_type_any(self, communication_livetest_dynamic_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_livetest_dynamic_connection_string, + http_logging_policy=get_http_logging_policy() + ) + user = identity_client.create_user() + + relay_client = CommunicationRelayClient.from_connection_string( + communication_livetest_dynamic_connection_string, + http_logging_policy=get_http_logging_policy() + ) + + print('Getting relay config with route type nearest:\n') + config = relay_client.get_relay_configuration(user, RouteType.ANY) + + for iceServer in config.ice_servers: + assert iceServer.username is not None + print('Username: ' + iceServer.username) + + assert iceServer.credential is not None + print('Credential: ' + iceServer.credential) + + assert iceServer.urls is not None + for url in iceServer.urls: + print('Url: ' + url) + + print(iceServer.route_type) + assert iceServer.route_type == RouteType.ANY + + assert config is not None \ No newline at end of file diff --git a/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client_async.py b/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client_async.py index 6e133a1cc73f..66689d306b9f 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client_async.py +++ b/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client_async.py @@ -6,6 +6,7 @@ # -------------------------------------------------------------------------- from azure.core.credentials import AccessToken from azure.communication.identity.aio import CommunicationIdentityClient +from azure.communication.networktraversal import RouteType from azure.communication.identity._api_versions import ApiVersion from azure.communication.networktraversal.aio import CommunicationRelayClient from _shared.helper import URIIdentityReplacer @@ -36,7 +37,6 @@ def setUp(self): async def test_get_relay_configuration(self, communication_livetest_dynamic_connection_string): identity_client = CommunicationIdentityClient.from_connection_string( communication_livetest_dynamic_connection_string, - api_version=ApiVersion.V2021_03_07, http_logging_policy=get_http_logging_policy() ) @@ -52,6 +52,40 @@ async def test_get_relay_configuration(self, communication_livetest_dynamic_conn print('Getting relay config:\n') config = await networkTraversalClient.get_relay_configuration(user) + for iceServer in config.ice_servers: + assert iceServer.username is not None + print('Username: ' + iceServer.username) + + assert iceServer.credential is not None + print('Credential: ' + iceServer.credential) + + assert iceServer.urls is not None + for url in iceServer.urls: + print('Url:' + url) + + assert iceServer.route_type is not None + + assert config is not None + + @CommunicationPreparer() + async def test_get_relay_configuration_with_route_type_nearest(self, communication_livetest_dynamic_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_livetest_dynamic_connection_string, + http_logging_policy=get_http_logging_policy() + ) + + async with identity_client: + user = await identity_client.create_user() + + networkTraversalClient = CommunicationRelayClient.from_connection_string( + communication_livetest_dynamic_connection_string, + http_logging_policy=get_http_logging_policy() + ) + + async with networkTraversalClient: + print('Getting relay config with nearest type:\n') + config = await networkTraversalClient.get_relay_configuration(user, RouteType.NEAREST) + print('Ice Servers Async:\n') for iceServer in config.ice_servers: assert iceServer.username is not None @@ -63,11 +97,20 @@ async def test_get_relay_configuration(self, communication_livetest_dynamic_conn assert iceServer.urls is not None for url in iceServer.urls: print('Url:' + url) + + assert iceServer.route_type == RouteType.NEAREST assert config is not None @CommunicationPreparer() - async def test_get_relay_configuration_without_identity(self, communication_livetest_dynamic_connection_string): + async def test_get_relay_configuration_with_route_type_any(self, communication_livetest_dynamic_connection_string): + identity_client = CommunicationIdentityClient.from_connection_string( + communication_livetest_dynamic_connection_string, + http_logging_policy=get_http_logging_policy() + ) + + async with identity_client: + user = await identity_client.create_user() networkTraversalClient = CommunicationRelayClient.from_connection_string( communication_livetest_dynamic_connection_string, @@ -75,8 +118,8 @@ async def test_get_relay_configuration_without_identity(self, communication_live ) async with networkTraversalClient: - print('Getting relay config:\n') - config = await networkTraversalClient.get_relay_configuration() + print('Getting relay config with nearest type:\n') + config = await networkTraversalClient.get_relay_configuration(user, RouteType.ANY) print('Ice Servers Async:\n') for iceServer in config.ice_servers: @@ -89,6 +132,8 @@ async def test_get_relay_configuration_without_identity(self, communication_live assert iceServer.urls is not None for url in iceServer.urls: print('Url:' + url) + + assert iceServer.route_type == RouteType.ANY assert config is not None \ No newline at end of file From ad9f0ca7978a190ac80bde36c0ae180792d4ee82 Mon Sep 17 00:00:00 2001 From: Ari Zavala Date: Mon, 15 Nov 2021 20:44:38 -0800 Subject: [PATCH 3/6] Update PR, fixes with API view --- .../_communication_relay_client.py | 12 ++++----- .../networktraversal/aio/__init__.py | 3 ++- .../aio/_communication_relay_client_async.py | 2 +- ...y_client.test_get_relay_configuration.yaml | 24 ++++++++--------- ...lay_configuration_with_route_type_any.yaml | 18 ++++++------- ...configuration_with_route_type_nearest.yaml | 20 +++++++------- ..._relay_configuration_without_identity.yaml | 26 ++++++++++++------- ...nt_async.test_get_relay_configuration.yaml | 22 ++++++++-------- ...lay_configuration_with_route_type_any.yaml | 18 ++++++------- ...configuration_with_route_type_nearest.yaml | 18 ++++++------- ..._relay_configuration_without_identity.yaml | 25 +++++++++++------- .../tests/test_communication_relay_client.py | 25 ++++++++++++++++++ .../test_communication_relay_client_async.py | 26 +++++++++++++++++++ 13 files changed, 150 insertions(+), 89 deletions(-) diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py index aceacd10ab81..d8f11909cf32 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py @@ -4,7 +4,7 @@ # Licensed under the MIT License. # ------------------------------------ -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING from azure.core.tracing.decorator import distributed_trace @@ -13,7 +13,6 @@ as CommunicationNetworkTraversalClientGen from ._shared.utils import parse_connection_str, get_authentication_policy from ._version import SDK_MONIKER -from ._generated.models import CommunicationRelayConfiguration if TYPE_CHECKING: from azure.core.credentials import TokenCredential @@ -85,15 +84,14 @@ def from_connection_string( @distributed_trace def get_relay_configuration( self, - user=None, # type: CommunicationUserIdentifier - route_type=None, #type: RouteType + user: 'CommunicationUserIdentifier' = None, + route_type: 'CommunicationRelayConfigurationRequestRouteType' = None, **kwargs # type: Any - ): - # type: (Any) -> CommunicationRelayConfiguration + ) -> 'CommunicationRelayConfiguration': """get a Communication Relay configuration :param: CommunicationUserIdentifier user: A user from which we will get an id :return: CommunicationRelayConfiguration - :rtype: ~azure.communication.networktraversal.CommunicationRelayConfiguration + :rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration """ if user is None: return self._network_traversal_service_client.communication_network_traversal.issue_relay_configuration( diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/__init__.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/__init__.py index 4b9333068023..93345989ad8f 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/__init__.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/__init__.py @@ -8,5 +8,6 @@ from .._generated.models import RouteType __all__ = [ - 'CommunicationRelayClient' + 'CommunicationRelayClient', + 'RouteType' ] diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py index 7a0a6cfcf9df..87a4470d4e32 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py @@ -90,7 +90,7 @@ async def get_relay_configuration( """get a Communication Relay configuration. :param: CommunicationUserIdentifier user: A user from which we will get an id :return: CommunicationRelayConfiguration - :rtype: ~azure.communication.networktraversal.CommunicationRelayConfiguration + :rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration """ if user is None: return await self._network_traversal_service_client.communication_network_traversal. \ diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml index 37ac68581104..69db4f46914b 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:50 GMT + - Tue, 16 Nov 2021 04:40:46 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -26,15 +26,15 @@ interactions: headers: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, - 2021-10-31-preview + 2021-10-31-preview, 2021-11-01 content-length: - '101' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Nov 2021 22:11:50 GMT + - Tue, 16 Nov 2021 04:40:46 GMT ms-cv: - - vug3lSbrLUeWHAoTQF9K8A.0 + - qI09mrYTPUuAtVj/PabBww.0 request-context: - appId= strict-transport-security: @@ -42,7 +42,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 44ms + - 23ms status: code: 201 message: Created @@ -62,7 +62,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:50 GMT + - Tue, 16 Nov 2021 04:40:46 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -72,19 +72,19 @@ interactions: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": - "BQAANksGVt4B19gS8Lb+vxW6oP1nmVTKtyyuY+TSztUAAAAMARCsgNlqhd5IsZldo6P6NifI1W7m/58vAl5NNuX7wFldw/QrbrI=", - "credential": "qXWLvJMJvz1ERUrh2Rgbq5W7/rg="}], "expiresOn": "2021-11-10T22:11:51.0590396+00:00"}' + "BQAANnQYA/8B19w2XJI64cWPuSblG0LB/y/+9Z+Xbm4AAAAMARCsgNlqhd5IsZldo6P6NifI1sBqyfp3/I9YO2DhmIV60ZOijWg=", + "credential": "K6OG/tyorha4BEYTKagDZt+cxG8="}], "expiresOn": "2021-11-16T04:40:46.495112+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview content-length: - - '560' + - '559' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Nov 2021 22:11:51 GMT + - Tue, 16 Nov 2021 04:40:46 GMT ms-cv: - - Z5bc4Wnyz0+tCw6tOOvbNQ.0 + - h9Fh2W/OIUWhTVn9wTM1oQ.0 request-context: - appId= strict-transport-security: @@ -92,7 +92,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 23ms + - 80ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml index 2ae36f400a77..86877bcc61b1 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:51 GMT + - Tue, 16 Nov 2021 04:40:46 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -26,15 +26,15 @@ interactions: headers: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, - 2021-10-31-preview + 2021-10-31-preview, 2021-11-01 content-length: - '101' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Nov 2021 22:11:50 GMT + - Tue, 16 Nov 2021 04:40:46 GMT ms-cv: - - pea7KFeta0yz+d5I+l5x5A.0 + - BfDeZYO3AEyM5dy+AnonDw.0 request-context: - appId= strict-transport-security: @@ -62,7 +62,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:51 GMT + - Tue, 16 Nov 2021 04:40:46 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -70,7 +70,7 @@ interactions: response: body: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], - "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-10T22:11:51.6345782+00:00"}' + "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T04:40:46.7398695+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview @@ -79,9 +79,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Nov 2021 22:11:51 GMT + - Tue, 16 Nov 2021 04:40:46 GMT ms-cv: - - JQL72YekxEO0P35AwHKGwQ.0 + - ip6U5Ji77k+Q1DO1+2Gg0w.0 request-context: - appId= strict-transport-security: @@ -89,7 +89,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 88ms + - 22ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml index 1fa6e7065bd6..c8aa86240832 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:51 GMT + - Tue, 16 Nov 2021 04:40:46 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -26,15 +26,15 @@ interactions: headers: api-supported-versions: - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, - 2021-10-31-preview + 2021-10-31-preview, 2021-11-01 content-length: - '101' content-type: - application/json; charset=utf-8 date: - - Wed, 10 Nov 2021 22:11:51 GMT + - Tue, 16 Nov 2021 04:40:46 GMT ms-cv: - - qh9OWFVE6UivRoo1YLvO0w.0 + - gI04zYnvoUy8jBb5Y1wBSQ.0 request-context: - appId= strict-transport-security: @@ -42,7 +42,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 24ms + - 25ms status: code: 201 message: Created @@ -62,7 +62,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:51 GMT + - Tue, 16 Nov 2021 04:40:46 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -71,7 +71,7 @@ interactions: body: string: '{"iceServers": [{"routeType": "nearest", "urls": ["turn.skype.com", "turn:13.107.17.41:3478"], "username": "sanitized", "credential": "sanitized"}], - "expiresOn": "2021-11-10T22:11:51.8649696+00:00"}' + "expiresOn": "2021-11-16T04:40:47.0013447+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview @@ -80,9 +80,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Nov 2021 22:11:51 GMT + - Tue, 16 Nov 2021 04:40:46 GMT ms-cv: - - RC7pSMciR0GK77B71fTqjw.0 + - 2x+A1+Jba0WqkXohqm0ICQ.0 request-context: - appId= strict-transport-security: @@ -90,7 +90,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 21ms + - 23ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml index e27b14decf8b..cb0801833bb6 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml @@ -15,32 +15,38 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 02:43:46 GMT + - Tue, 16 Nov 2021 04:40:47 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview response: body: - string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' + string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], + "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", + "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": + "BQAANnSBao0B19w2X3qe7o9e7W+6rvySC4FEqP0Jp0QAAAAMARCsgNlqhd5IsZldo6P6NifIf0Y1au0lIjmsCWlNNw3+1jt/4FE=", + "credential": "jcE0W+ai0GTWM29K0Q4nnsVS4UI="}], "expiresOn": "2021-11-16T04:40:47.1711817+00:00"}' headers: + api-supported-versions: + - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview + content-length: + - '560' content-type: - - application/json + - application/json; charset=utf-8 date: - - Wed, 10 Nov 2021 02:43:46 GMT + - Tue, 16 Nov 2021 04:40:46 GMT ms-cv: - - oDaiaJ5PkUq9TNTsJyP6Sg.0 + - 7iXw5vjfgkGvhAx8VKBp2Q.0 request-context: - appId= strict-transport-security: - max-age=2592000 - transfer-encoding: - - chunked x-cache: - CONFIG_NOCACHE x-processing-time: - - 9ms + - 19ms status: - code: 401 - message: Unauthorized + code: 200 + message: OK version: 1 diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml index c542ca9052c2..adb89bf44e27 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:51 GMT + - Tue, 16 Nov 2021 04:40:47 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -21,15 +21,15 @@ interactions: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, - 2021-03-31-preview1, 2021-10-31-preview + 2021-03-31-preview1, 2021-10-31-preview, 2021-11-01 content-length: '101' content-type: application/json; charset=utf-8 - date: Wed, 10 Nov 2021 22:11:51 GMT - ms-cv: GynjuQm1oUuxQMqmcjtgyg.0 + date: Tue, 16 Nov 2021 04:40:46 GMT + ms-cv: 3+1oH5z9t0OADoly/cuolA.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 27ms + x-processing-time: 26ms status: code: 201 message: Created @@ -46,7 +46,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:51 GMT + - Tue, 16 Nov 2021 04:40:47 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -56,18 +56,18 @@ interactions: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": - "BQAANkukXQMB19gSYdXtLqhi7A41dwQPkLVlfAK8wZ8AAAAMARCsgNlqhd5IsZldo6P6NifIM3HjmLwECvQ6BTJYFW5n/fzu2Gg=", - "credential": "5caHpuagc1m5x9BvsVMcbC2D+EQ="}], "expiresOn": "2021-11-10T22:11:52.0851966+00:00"}' + "BQAANnSXU4EB19w2aCWTWAJL01t6XoklNPG7HphtE/8AAAAMARCsgNlqhd5IsZldo6P6NifIEHLHZlovGBYG/Um0CEiYowfIPEM=", + "credential": "zQTkxP2TkfXcd37rPKsaK8x47mE="}], "expiresOn": "2021-11-16T04:40:47.3233983+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview content-length: '560' content-type: application/json; charset=utf-8 - date: Wed, 10 Nov 2021 22:11:51 GMT - ms-cv: rTN2hcJ8DE65nzciBzPGfA.0 + date: Tue, 16 Nov 2021 04:40:46 GMT + ms-cv: adJLtbC3R02Dl6M5sFljLw.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 20ms + x-processing-time: 22ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml index 949cd731da22..c64aedd09f37 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:52 GMT + - Tue, 16 Nov 2021 04:40:47 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -21,11 +21,11 @@ interactions: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, - 2021-03-31-preview1, 2021-10-31-preview + 2021-03-31-preview1, 2021-10-31-preview, 2021-11-01 content-length: '101' content-type: application/json; charset=utf-8 - date: Wed, 10 Nov 2021 22:11:51 GMT - ms-cv: 7N/qTH9boE2H1wsmfTEtqA.0 + date: Tue, 16 Nov 2021 04:40:47 GMT + ms-cv: m/sTsHdtBUSU/ZLS1u+p4w.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE @@ -46,7 +46,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:52 GMT + - Tue, 16 Nov 2021 04:40:47 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -54,13 +54,13 @@ interactions: response: body: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], - "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-10T22:11:52.3668579+00:00"}' + "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T04:40:47.511629+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview - content-length: '319' + content-length: '318' content-type: application/json; charset=utf-8 - date: Wed, 10 Nov 2021 22:11:52 GMT - ms-cv: drPQHdOrqk+qbrxWVnPsPg.0 + date: Tue, 16 Nov 2021 04:40:47 GMT + ms-cv: d49KyvQFC0Cf2j4Au4SALQ.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml index 1cc6965deace..9949f98b5984 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:52 GMT + - Tue, 16 Nov 2021 04:40:47 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -21,11 +21,11 @@ interactions: string: '{"identity": {"id": "sanitized"}}' headers: api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, - 2021-03-31-preview1, 2021-10-31-preview + 2021-03-31-preview1, 2021-10-31-preview, 2021-11-01 content-length: '101' content-type: application/json; charset=utf-8 - date: Wed, 10 Nov 2021 22:11:52 GMT - ms-cv: q0qf2xdpz0+6WirMnd0KGA.0 + date: Tue, 16 Nov 2021 04:40:47 GMT + ms-cv: +6F8yaDW2UGg2XAxZjyVdQ.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE @@ -46,7 +46,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 22:11:52 GMT + - Tue, 16 Nov 2021 04:40:47 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -55,17 +55,17 @@ interactions: body: string: '{"iceServers": [{"routeType": "nearest", "urls": ["turn.skype.com", "turn:13.107.17.41:3478"], "username": "sanitized", "credential": "sanitized"}], - "expiresOn": "2021-11-10T22:11:52.6821641+00:00"}' + "expiresOn": "2021-11-16T04:40:47.7258565+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview content-length: '305' content-type: application/json; charset=utf-8 - date: Wed, 10 Nov 2021 22:11:52 GMT - ms-cv: LyoOgZQNM0mc0+4Lm7Bmbg.0 + date: Tue, 16 Nov 2021 04:40:47 GMT + ms-cv: lgk0fBUeCkub5DTQ4/+Jiw.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 38ms + x-processing-time: 30ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml index f11e9bc7c7bf..63a48fded98b 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml @@ -11,25 +11,30 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Wed, 10 Nov 2021 02:43:47 GMT + - Tue, 16 Nov 2021 04:40:47 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview response: body: - string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' + string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], + "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", + "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": + "BQAANnTlkX0B19w2dbBSG1UD2LcSBg6mzxAq9lgst4kAAAAMARCsgNlqhd5IsZldo6P6NifIK0ST4XLjupcaRHPzxPh+kNw6TdA=", + "credential": "4Mpd6DYBzwyeXfuaTklnicfuxF8="}], "expiresOn": "2021-11-16T04:40:47.836559+00:00"}' headers: - content-type: application/json - date: Wed, 10 Nov 2021 02:43:46 GMT - ms-cv: bIks/Sfk+0GQz4otdIHTmg.0 + api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview + content-length: '559' + content-type: application/json; charset=utf-8 + date: Tue, 16 Nov 2021 04:40:47 GMT + ms-cv: CjRQnylXcEe6g7bnjQhLBw.0 request-context: appId= strict-transport-security: max-age=2592000 - transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 9ms + x-processing-time: 20ms status: - code: 401 - message: Unauthorized - url: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview + code: 200 + message: OK + url: https://smstestapp.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview version: 1 diff --git a/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client.py b/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client.py index ef3c4ed07eaf..5067cb4b53b7 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client.py +++ b/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client.py @@ -67,6 +67,31 @@ def test_get_relay_configuration(self, communication_livetest_dynamic_connection assert iceServer.route_type is not None assert config is not None + + @CommunicationPreparer() + def test_get_relay_configuration_without_identity(self, communication_livetest_dynamic_connection_string): + + relay_client = CommunicationRelayClient.from_connection_string( + communication_livetest_dynamic_connection_string, + http_logging_policy=get_http_logging_policy() + ) + + print('Getting relay config:\n') + config = relay_client.get_relay_configuration() + + print('Ice Servers: \n') + for iceServer in config.ice_servers: + assert iceServer.username is not None + print('Username: ' + iceServer.username) + + assert iceServer.credential is not None + print('Credential: ' + iceServer.credential) + + assert iceServer.urls is not None + for url in iceServer.urls: + print('Url: ' + url) + + assert config is not None @CommunicationPreparer() def test_get_relay_configuration_with_route_type_nearest(self, communication_livetest_dynamic_connection_string): diff --git a/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client_async.py b/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client_async.py index 66689d306b9f..bf2180635d45 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client_async.py +++ b/sdk/communication/azure-communication-networktraversal/tests/test_communication_relay_client_async.py @@ -66,6 +66,32 @@ async def test_get_relay_configuration(self, communication_livetest_dynamic_conn assert iceServer.route_type is not None assert config is not None + + @CommunicationPreparer() + async def test_get_relay_configuration_without_identity(self, communication_livetest_dynamic_connection_string): + + networkTraversalClient = CommunicationRelayClient.from_connection_string( + communication_livetest_dynamic_connection_string, + http_logging_policy=get_http_logging_policy() + ) + + async with networkTraversalClient: + print('Getting relay config:\n') + config = await networkTraversalClient.get_relay_configuration() + + print('Ice Servers Async:\n') + for iceServer in config.ice_servers: + assert iceServer.username is not None + print('Username: ' + iceServer.username) + + assert iceServer.credential is not None + print('Credential: ' + iceServer.credential) + + assert iceServer.urls is not None + for url in iceServer.urls: + print('Url:' + url) + + assert config is not None @CommunicationPreparer() async def test_get_relay_configuration_with_route_type_nearest(self, communication_livetest_dynamic_connection_string): From 4b18edfa3ba32b66e3c07ffa1d1fa37cefd560b2 Mon Sep 17 00:00:00 2001 From: Ari Zavala Date: Tue, 16 Nov 2021 10:17:11 -0800 Subject: [PATCH 4/6] Update PR --- .../_communication_relay_client.py | 14 ++++++++---- .../aio/_communication_relay_client_async.py | 5 ++++- ...y_client.test_get_relay_configuration.yaml | 22 +++++++++---------- ...lay_configuration_with_route_type_any.yaml | 16 +++++++------- ...configuration_with_route_type_nearest.yaml | 18 +++++++-------- ..._relay_configuration_without_identity.yaml | 10 ++++----- ...nt_async.test_get_relay_configuration.yaml | 20 ++++++++--------- ...lay_configuration_with_route_type_any.yaml | 18 +++++++-------- ...configuration_with_route_type_nearest.yaml | 18 +++++++-------- ..._relay_configuration_without_identity.yaml | 12 +++++----- 10 files changed, 81 insertions(+), 72 deletions(-) diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py index d8f11909cf32..49ce4fa926ff 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py @@ -13,10 +13,12 @@ as CommunicationNetworkTraversalClientGen from ._shared.utils import parse_connection_str, get_authentication_policy from ._version import SDK_MONIKER +from ._generated.models import CommunicationRelayConfiguration if TYPE_CHECKING: from azure.core.credentials import TokenCredential from azure.communication.identity import CommunicationUserIdentifier + from azure.communication.networktraversal import RouteType class CommunicationRelayClient(object): """Azure Communication Services Relay client. @@ -84,12 +86,16 @@ def from_connection_string( @distributed_trace def get_relay_configuration( self, - user: 'CommunicationUserIdentifier' = None, - route_type: 'CommunicationRelayConfigurationRequestRouteType' = None, + user=None, # type: CommunicationUserIdentifier + route_type=None, #type: RouteType **kwargs # type: Any - ) -> 'CommunicationRelayConfiguration': + ): + # type: (...) -> CommunicationRelayConfiguration """get a Communication Relay configuration - :param: CommunicationUserIdentifier user: A user from which we will get an id + :param user: Azure Communication User + :type user: ~azure.communication.identity.CommunicationUserIdentifier + :param route_type: Azure Communication Route Type + :type route_type: ~azure.communication.networktraversal.RouteType :return: CommunicationRelayConfiguration :rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration """ diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py index 87a4470d4e32..38b6c3d05e3d 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py @@ -88,7 +88,10 @@ async def get_relay_configuration( **kwargs # type: Any ) -> 'CommunicationRelayConfiguration': """get a Communication Relay configuration. - :param: CommunicationUserIdentifier user: A user from which we will get an id + :param user: Azure Communication User + :type user: ~azure.communication.identity.CommunicationUserIdentifier + :param route_type: Azure Communication Route Type + :type route_type: ~azure.communication.networktraversal.RouteType :return: CommunicationRelayConfiguration :rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration """ diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml index 69db4f46914b..e313885d4d5a 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:13 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -32,9 +32,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:13 GMT ms-cv: - - qI09mrYTPUuAtVj/PabBww.0 + - rMk10TBNvUqvS4oHz1IS/A.0 request-context: - appId= strict-transport-security: @@ -42,7 +42,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 23ms + - 22ms status: code: 201 message: Created @@ -62,7 +62,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:13 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -72,19 +72,19 @@ interactions: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": - "BQAANnQYA/8B19w2XJI64cWPuSblG0LB/y/+9Z+Xbm4AAAAMARCsgNlqhd5IsZldo6P6NifI1sBqyfp3/I9YO2DhmIV60ZOijWg=", - "credential": "K6OG/tyorha4BEYTKagDZt+cxG8="}], "expiresOn": "2021-11-16T04:40:46.495112+00:00"}' + "BQAANs/yomQB19ynHsyCrY2MbvzaJwv0gMDo0xYRPUkAAAAMARCsgNlqhd5IsZldo6P6NifIRdfvTVWYnnh2/8NGGhXsQ4Rxtr4=", + "credential": "lOKKYLHezJ6nfn9w2XkK4VLnn6w="}], "expiresOn": "2021-11-16T18:12:13.7183673+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview content-length: - - '559' + - '560' content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:13 GMT ms-cv: - - h9Fh2W/OIUWhTVn9wTM1oQ.0 + - a8WXPhWFpEKMOH10HY4JQw.0 request-context: - appId= strict-transport-security: @@ -92,7 +92,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 80ms + - 21ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml index 86877bcc61b1..d42114c4eaa7 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:13 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -32,9 +32,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:13 GMT ms-cv: - - BfDeZYO3AEyM5dy+AnonDw.0 + - tMAatS3hakCNEz7IBeVQuw.0 request-context: - appId= strict-transport-security: @@ -62,7 +62,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:13 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -70,7 +70,7 @@ interactions: response: body: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], - "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T04:40:46.7398695+00:00"}' + "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T18:12:14.2059608+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview @@ -79,9 +79,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:14 GMT ms-cv: - - ip6U5Ji77k+Q1DO1+2Gg0w.0 + - A7op7aWw7E2ZCoEwl5fAmA.0 request-context: - appId= strict-transport-security: @@ -89,7 +89,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 22ms + - 251ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml index c8aa86240832..4d4765f7f03d 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:14 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -32,9 +32,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:14 GMT ms-cv: - - gI04zYnvoUy8jBb5Y1wBSQ.0 + - CmiBTU1NwEyy87FuhEBK7A.0 request-context: - appId= strict-transport-security: @@ -42,7 +42,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 25ms + - 27ms status: code: 201 message: Created @@ -62,7 +62,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:14 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -71,7 +71,7 @@ interactions: body: string: '{"iceServers": [{"routeType": "nearest", "urls": ["turn.skype.com", "turn:13.107.17.41:3478"], "username": "sanitized", "credential": "sanitized"}], - "expiresOn": "2021-11-16T04:40:47.0013447+00:00"}' + "expiresOn": "2021-11-16T18:12:14.4601949+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview @@ -80,9 +80,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:13 GMT ms-cv: - - 2x+A1+Jba0WqkXohqm0ICQ.0 + - Nb3xPuBb/Uakdw1OPiFXNw.0 request-context: - appId= strict-transport-security: @@ -90,7 +90,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 23ms + - 21ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml index cb0801833bb6..bb6c63428601 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:47 GMT + - Tue, 16 Nov 2021 18:12:14 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -25,8 +25,8 @@ interactions: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": - "BQAANnSBao0B19w2X3qe7o9e7W+6rvySC4FEqP0Jp0QAAAAMARCsgNlqhd5IsZldo6P6NifIf0Y1au0lIjmsCWlNNw3+1jt/4FE=", - "credential": "jcE0W+ai0GTWM29K0Q4nnsVS4UI="}], "expiresOn": "2021-11-16T04:40:47.1711817+00:00"}' + "BQAANtBz/NYB19yn7SY1nkF612kTjgmPttjhkO6JCNwAAAAMARCsgNlqhd5IsZldo6P6NifID2+vKJ0vXLUjx7ZnoagxJH/7578=", + "credential": "HaIJfgMzmK926LaQhAYHwNHmcl8="}], "expiresOn": "2021-11-16T18:12:14.5755767+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview @@ -35,9 +35,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 04:40:46 GMT + - Tue, 16 Nov 2021 18:12:14 GMT ms-cv: - - 7iXw5vjfgkGvhAx8VKBp2Q.0 + - tkBLnT2bVEOs+LkVHtAWtA.0 request-context: - appId= strict-transport-security: diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml index adb89bf44e27..6525ac7547c7 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:47 GMT + - Tue, 16 Nov 2021 18:12:14 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -24,12 +24,12 @@ interactions: 2021-03-31-preview1, 2021-10-31-preview, 2021-11-01 content-length: '101' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 04:40:46 GMT - ms-cv: 3+1oH5z9t0OADoly/cuolA.0 + date: Tue, 16 Nov 2021 18:12:14 GMT + ms-cv: BWgT7mkiqkqAXPurnvmOog.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 26ms + x-processing-time: 24ms status: code: 201 message: Created @@ -46,7 +46,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:47 GMT + - Tue, 16 Nov 2021 18:12:14 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -56,18 +56,18 @@ interactions: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": - "BQAANnSXU4EB19w2aCWTWAJL01t6XoklNPG7HphtE/8AAAAMARCsgNlqhd5IsZldo6P6NifIEHLHZlovGBYG/Um0CEiYowfIPEM=", - "credential": "zQTkxP2TkfXcd37rPKsaK8x47mE="}], "expiresOn": "2021-11-16T04:40:47.3233983+00:00"}' + "BQAANtCRunEB19ynz1zYrstqWuXcDScC9OxMUAmTSGYAAAAMARCsgNlqhd5IsZldo6P6NifIxO0N8PGDcYESPk3DLuFqQUanDuI=", + "credential": "xymBhFWwcyX8FqwGvSK7IiPA2Mo="}], "expiresOn": "2021-11-16T18:12:14.7734624+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview content-length: '560' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 04:40:46 GMT - ms-cv: adJLtbC3R02Dl6M5sFljLw.0 + date: Tue, 16 Nov 2021 18:12:14 GMT + ms-cv: VfNWUpSrr0K5aKqXSx3qTQ.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 22ms + x-processing-time: 34ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml index c64aedd09f37..90e801f7f65e 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:47 GMT + - Tue, 16 Nov 2021 18:12:14 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -24,12 +24,12 @@ interactions: 2021-03-31-preview1, 2021-10-31-preview, 2021-11-01 content-length: '101' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 04:40:47 GMT - ms-cv: m/sTsHdtBUSU/ZLS1u+p4w.0 + date: Tue, 16 Nov 2021 18:12:14 GMT + ms-cv: LEAkDfI/fEi/OJCg03CiIQ.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 23ms + x-processing-time: 28ms status: code: 201 message: Created @@ -46,7 +46,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:47 GMT + - Tue, 16 Nov 2021 18:12:14 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -54,13 +54,13 @@ interactions: response: body: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], - "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T04:40:47.511629+00:00"}' + "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T18:12:14.9614738+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview - content-length: '318' + content-length: '319' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 04:40:47 GMT - ms-cv: d49KyvQFC0Cf2j4Au4SALQ.0 + date: Tue, 16 Nov 2021 18:12:14 GMT + ms-cv: t/AVmHA780enpqECFu5waw.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml index 9949f98b5984..14ade2cb8d7b 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:47 GMT + - Tue, 16 Nov 2021 18:12:14 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -24,12 +24,12 @@ interactions: 2021-03-31-preview1, 2021-10-31-preview, 2021-11-01 content-length: '101' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 04:40:47 GMT - ms-cv: +6F8yaDW2UGg2XAxZjyVdQ.0 + date: Tue, 16 Nov 2021 18:12:15 GMT + ms-cv: 4zyTrpIKm0SQinIOJNsmyQ.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 23ms + x-processing-time: 22ms status: code: 201 message: Created @@ -46,7 +46,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:47 GMT + - Tue, 16 Nov 2021 18:12:15 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -55,17 +55,17 @@ interactions: body: string: '{"iceServers": [{"routeType": "nearest", "urls": ["turn.skype.com", "turn:13.107.17.41:3478"], "username": "sanitized", "credential": "sanitized"}], - "expiresOn": "2021-11-16T04:40:47.7258565+00:00"}' + "expiresOn": "2021-11-16T18:12:15.1574008+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview content-length: '305' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 04:40:47 GMT - ms-cv: lgk0fBUeCkub5DTQ4/+Jiw.0 + date: Tue, 16 Nov 2021 18:12:14 GMT + ms-cv: YvAvu6jlHE6+63c9sBokxg.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 30ms + x-processing-time: 21ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml index 63a48fded98b..97e80172c941 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 04:40:47 GMT + - Tue, 16 Nov 2021 18:12:15 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -21,14 +21,14 @@ interactions: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": - "BQAANnTlkX0B19w2dbBSG1UD2LcSBg6mzxAq9lgst4kAAAAMARCsgNlqhd5IsZldo6P6NifIK0ST4XLjupcaRHPzxPh+kNw6TdA=", - "credential": "4Mpd6DYBzwyeXfuaTklnicfuxF8="}], "expiresOn": "2021-11-16T04:40:47.836559+00:00"}' + "BQAANtDZQ14B19ynJItWCVBEIV7eYH+2EnQv47U1OEYAAAAMARCsgNlqhd5IsZldo6P6NifI5yZ9rBvIkDZ3yvTxXOZh6XqEVzk=", + "credential": "OnQGn2aQWQS/aTw2LFojZfzwEPk="}], "expiresOn": "2021-11-16T18:12:15.2361077+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview - content-length: '559' + content-length: '560' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 04:40:47 GMT - ms-cv: CjRQnylXcEe6g7bnjQhLBw.0 + date: Tue, 16 Nov 2021 18:12:14 GMT + ms-cv: byMReZIO1US/hX11MkdNwg.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE From a172a9af3e5d50e21f78f63c48303cd931abe6a5 Mon Sep 17 00:00:00 2001 From: Ari Zavala Date: Tue, 16 Nov 2021 16:46:12 -0800 Subject: [PATCH 5/6] Update PR --- .../_communication_relay_client.py | 2 +- ...y_client.test_get_relay_configuration.yaml | 20 +++++++++---------- ...lay_configuration_with_route_type_any.yaml | 18 ++++++++--------- ...configuration_with_route_type_nearest.yaml | 18 ++++++++--------- ..._relay_configuration_without_identity.yaml | 12 +++++------ ...nt_async.test_get_relay_configuration.yaml | 20 +++++++++---------- ...lay_configuration_with_route_type_any.yaml | 18 ++++++++--------- ...configuration_with_route_type_nearest.yaml | 18 ++++++++--------- ..._relay_configuration_without_identity.yaml | 14 ++++++------- 9 files changed, 70 insertions(+), 70 deletions(-) diff --git a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py index 49ce4fa926ff..fdbcddc566fb 100644 --- a/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py +++ b/sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py @@ -87,7 +87,7 @@ def from_connection_string( def get_relay_configuration( self, user=None, # type: CommunicationUserIdentifier - route_type=None, #type: RouteType + route_type=None, # type: Optional[Union[str, "RouteType"]] **kwargs # type: Any ): # type: (...) -> CommunicationRelayConfiguration diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml index e313885d4d5a..0542e670ccba 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:13 GMT + - Tue, 16 Nov 2021 23:06:39 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -32,9 +32,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 18:12:13 GMT + - Tue, 16 Nov 2021 23:06:39 GMT ms-cv: - - rMk10TBNvUqvS4oHz1IS/A.0 + - U9b65h5ASkKa+KIPCvUxWQ.0 request-context: - appId= strict-transport-security: @@ -42,7 +42,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 22ms + - 41ms status: code: 201 message: Created @@ -62,7 +62,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:13 GMT + - Tue, 16 Nov 2021 23:06:39 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -72,8 +72,8 @@ interactions: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": - "BQAANs/yomQB19ynHsyCrY2MbvzaJwv0gMDo0xYRPUkAAAAMARCsgNlqhd5IsZldo6P6NifIRdfvTVWYnnh2/8NGGhXsQ4Rxtr4=", - "credential": "lOKKYLHezJ6nfn9w2XkK4VLnn6w="}], "expiresOn": "2021-11-16T18:12:13.7183673+00:00"}' + "BQAANvHfttoB19zQystmgxt0S2mLYX7tGAxJeabzv9sAAAAMARCsgNlqhd5IsZldo6P6NifItsKK7e2LnRB0Ih7ljEfqyuKo124=", + "credential": "jCELLqJ7zq/h3iDdbwz9KEikIt0="}], "expiresOn": "2021-11-16T23:06:40.0024453+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview @@ -82,9 +82,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 18:12:13 GMT + - Tue, 16 Nov 2021 23:06:39 GMT ms-cv: - - a8WXPhWFpEKMOH10HY4JQw.0 + - qEuVYpr70Ei+7tA9v36ydg.0 request-context: - appId= strict-transport-security: @@ -92,7 +92,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 21ms + - 40ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml index d42114c4eaa7..e1e54788462c 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:13 GMT + - Tue, 16 Nov 2021 23:06:40 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -32,9 +32,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 18:12:13 GMT + - Tue, 16 Nov 2021 23:06:39 GMT ms-cv: - - tMAatS3hakCNEz7IBeVQuw.0 + - rmh6d+6tBkiqtYEPdBND/Q.0 request-context: - appId= strict-transport-security: @@ -42,7 +42,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 23ms + - 43ms status: code: 201 message: Created @@ -62,7 +62,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:13 GMT + - Tue, 16 Nov 2021 23:06:40 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -70,7 +70,7 @@ interactions: response: body: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], - "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T18:12:14.2059608+00:00"}' + "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T23:06:40.4127712+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview @@ -79,9 +79,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:39 GMT ms-cv: - - A7op7aWw7E2ZCoEwl5fAmA.0 + - fuapfk2WNE2Qo3K+cXomnw.0 request-context: - appId= strict-transport-security: @@ -89,7 +89,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 251ms + - 39ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml index 4d4765f7f03d..7e7d43bfe279 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:40 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -32,9 +32,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:39 GMT ms-cv: - - CmiBTU1NwEyy87FuhEBK7A.0 + - AWedRcBNFEiUrHbsxosGJg.0 request-context: - appId= strict-transport-security: @@ -42,7 +42,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 27ms + - 25ms status: code: 201 message: Created @@ -62,7 +62,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:40 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -71,7 +71,7 @@ interactions: body: string: '{"iceServers": [{"routeType": "nearest", "urls": ["turn.skype.com", "turn:13.107.17.41:3478"], "username": "sanitized", "credential": "sanitized"}], - "expiresOn": "2021-11-16T18:12:14.4601949+00:00"}' + "expiresOn": "2021-11-16T23:06:41.0641698+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview @@ -80,9 +80,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 18:12:13 GMT + - Tue, 16 Nov 2021 23:06:40 GMT ms-cv: - - Nb3xPuBb/Uakdw1OPiFXNw.0 + - gb3giHJ1ak+dJlNIiwKx6A.0 request-context: - appId= strict-transport-security: @@ -90,7 +90,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 21ms + - 303ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml index bb6c63428601..1641e2c2fedb 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml @@ -15,7 +15,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:41 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -25,8 +25,8 @@ interactions: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": - "BQAANtBz/NYB19yn7SY1nkF612kTjgmPttjhkO6JCNwAAAAMARCsgNlqhd5IsZldo6P6NifID2+vKJ0vXLUjx7ZnoagxJH/7578=", - "credential": "HaIJfgMzmK926LaQhAYHwNHmcl8="}], "expiresOn": "2021-11-16T18:12:14.5755767+00:00"}' + "BQAANvKq+koB19zQBweakrFDOv2ryC7xNWF/jV9BJoAAAAAMARCsgNlqhd5IsZldo6P6NifIAa6byOgmmQCuGcIq36sfDTfL6Cc=", + "credential": "pF5SPr5F7X6ZwmMOn8cGEKl50YM="}], "expiresOn": "2021-11-16T23:06:41.3447718+00:00"}' headers: api-supported-versions: - 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview @@ -35,9 +35,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:40 GMT ms-cv: - - tkBLnT2bVEOs+LkVHtAWtA.0 + - nsDeFbsDmUi6XnHX4QvoSA.0 request-context: - appId= strict-transport-security: @@ -45,7 +45,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 19ms + - 159ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml index 6525ac7547c7..0418c0a2d400 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:41 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -24,12 +24,12 @@ interactions: 2021-03-31-preview1, 2021-10-31-preview, 2021-11-01 content-length: '101' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 18:12:14 GMT - ms-cv: BWgT7mkiqkqAXPurnvmOog.0 + date: Tue, 16 Nov 2021 23:06:40 GMT + ms-cv: 4ptSJ2AmVE+PjMCylDY7Aw.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 24ms + x-processing-time: 21ms status: code: 201 message: Created @@ -46,7 +46,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:41 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -56,18 +56,18 @@ interactions: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": - "BQAANtCRunEB19ynz1zYrstqWuXcDScC9OxMUAmTSGYAAAAMARCsgNlqhd5IsZldo6P6NifIxO0N8PGDcYESPk3DLuFqQUanDuI=", - "credential": "xymBhFWwcyX8FqwGvSK7IiPA2Mo="}], "expiresOn": "2021-11-16T18:12:14.7734624+00:00"}' + "BQAANvLEk3sB19zQDFB99XfvREaYUjaW+99mXybbmD8AAAAMARCsgNlqhd5IsZldo6P6NifI+iWmJVl8G6EL9UYo+n1+3Vjdkrg=", + "credential": "HHySJRALhMrETWsv/DWRtfjHZ4E="}], "expiresOn": "2021-11-16T23:06:41.5125461+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview content-length: '560' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 18:12:14 GMT - ms-cv: VfNWUpSrr0K5aKqXSx3qTQ.0 + date: Tue, 16 Nov 2021 23:06:41 GMT + ms-cv: cxYKkXL150+Dhco9akfN/Q.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 34ms + x-processing-time: 21ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml index 90e801f7f65e..bf3b88185d66 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:41 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -24,12 +24,12 @@ interactions: 2021-03-31-preview1, 2021-10-31-preview, 2021-11-01 content-length: '101' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 18:12:14 GMT - ms-cv: LEAkDfI/fEi/OJCg03CiIQ.0 + date: Tue, 16 Nov 2021 23:06:41 GMT + ms-cv: +m4qlverWU2x1qiBYz7jkw.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 28ms + x-processing-time: 24ms status: code: 201 message: Created @@ -46,7 +46,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:41 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -54,17 +54,17 @@ interactions: response: body: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], - "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T18:12:14.9614738+00:00"}' + "username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T23:06:41.9304572+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview content-length: '319' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 18:12:14 GMT - ms-cv: t/AVmHA780enpqECFu5waw.0 + date: Tue, 16 Nov 2021 23:06:41 GMT + ms-cv: KRB1BWGVHk24ApJNUrmViw.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 22ms + x-processing-time: 280ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml index 14ade2cb8d7b..383a0fa3ee52 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_nearest.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:14 GMT + - Tue, 16 Nov 2021 23:06:41 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -24,12 +24,12 @@ interactions: 2021-03-31-preview1, 2021-10-31-preview, 2021-11-01 content-length: '101' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 18:12:15 GMT - ms-cv: 4zyTrpIKm0SQinIOJNsmyQ.0 + date: Tue, 16 Nov 2021 23:06:41 GMT + ms-cv: /N9YbA1Auk6fyACeMfet1A.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 22ms + x-processing-time: 25ms status: code: 201 message: Created @@ -46,7 +46,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:15 GMT + - Tue, 16 Nov 2021 23:06:42 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -55,17 +55,17 @@ interactions: body: string: '{"iceServers": [{"routeType": "nearest", "urls": ["turn.skype.com", "turn:13.107.17.41:3478"], "username": "sanitized", "credential": "sanitized"}], - "expiresOn": "2021-11-16T18:12:15.1574008+00:00"}' + "expiresOn": "2021-11-16T23:06:42.1186447+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview content-length: '305' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 18:12:14 GMT - ms-cv: YvAvu6jlHE6+63c9sBokxg.0 + date: Tue, 16 Nov 2021 23:06:41 GMT + ms-cv: 7KtJ3h8LDkCGRWOukVG7eQ.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 21ms + x-processing-time: 23ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml index 97e80172c941..424d46daa5ac 100644 --- a/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml +++ b/sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_without_identity.yaml @@ -11,7 +11,7 @@ interactions: User-Agent: - azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0) x-ms-date: - - Tue, 16 Nov 2021 18:12:15 GMT + - Tue, 16 Nov 2021 23:06:42 GMT x-ms-return-client-request-id: - 'true' method: POST @@ -21,18 +21,18 @@ interactions: string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"], "username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest", "urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username": - "BQAANtDZQ14B19ynJItWCVBEIV7eYH+2EnQv47U1OEYAAAAMARCsgNlqhd5IsZldo6P6NifI5yZ9rBvIkDZ3yvTxXOZh6XqEVzk=", - "credential": "OnQGn2aQWQS/aTw2LFojZfzwEPk="}], "expiresOn": "2021-11-16T18:12:15.2361077+00:00"}' + "BQAANvMy40gB19zQSlEkRVh1/NNKh1DiLyF8/XLlsvAAAAAMARCsgNlqhd5IsZldo6P6NifIJL2J21avFzCaenmOaE4FLkbOnpI=", + "credential": "3kkYslXJ8YfdkE2umnl6QSrEGXk="}], "expiresOn": "2021-11-16T23:06:42.230697+00:00"}' headers: api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview - content-length: '560' + content-length: '559' content-type: application/json; charset=utf-8 - date: Tue, 16 Nov 2021 18:12:14 GMT - ms-cv: byMReZIO1US/hX11MkdNwg.0 + date: Tue, 16 Nov 2021 23:06:41 GMT + ms-cv: bLTqTS2HfEGkVtY9HQA9+w.0 request-context: appId= strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 20ms + x-processing-time: 21ms status: code: 200 message: OK From ef274b781e11b2c64fdc4751042967a4490310f2 Mon Sep 17 00:00:00 2001 From: Ari Zavala Date: Wed, 17 Nov 2021 09:39:55 -0800 Subject: [PATCH 6/6] Update Changelog and Readme --- .../CHANGELOG.md | 16 ++++++++ .../README.md | 38 ++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/sdk/communication/azure-communication-networktraversal/CHANGELOG.md b/sdk/communication/azure-communication-networktraversal/CHANGELOG.md index e4cfa026e6f6..ab81b08b0c85 100644 --- a/sdk/communication/azure-communication-networktraversal/CHANGELOG.md +++ b/sdk/communication/azure-communication-networktraversal/CHANGELOG.md @@ -1,6 +1,21 @@ # Release History +## 1.0.0-beta.2 (2021-11-18) + +### Features Added + +- Made User Identity an optional parameter when getting a Relay Configuration. +- Added RouteType as optional parameter when getting a Relay Configuration so users can + choose the routing type protocol of the requested Relay Configuration. + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0b1 (2021-08-16) + - Preview release of `azure-communication-networktraversal`. The first preview of the Azure Communication Relay Client has the following features: @@ -8,6 +23,7 @@ The first preview of the Azure Communication Relay Client has the following feat - get a Relay Configuration by creating a CommunicationRelayClient ### Added + - Added CommunicationRelayClient in preview. - Added CommunicationRelayClient.get_relay_configuration in preview. diff --git a/sdk/communication/azure-communication-networktraversal/README.md b/sdk/communication/azure-communication-networktraversal/README.md index d6760ce27e81..b661e58a929a 100644 --- a/sdk/communication/azure-communication-networktraversal/README.md +++ b/sdk/communication/azure-communication-networktraversal/README.md @@ -58,7 +58,7 @@ identity_client = CommunicationIdentityClient.from_connection_string(self.connec relay_client = CommunicationRelayClient.from_connection_string(self.connection_string) ``` -### Getting the relay configuration +### Getting the relay configuration providing a user ```python # We need a user from Identity @@ -77,6 +77,42 @@ for iceServer in config.ice_servers: print('Url:' + url) ``` +### Getting the relay configuration without providing a user + +```python +relay_configuration = relay_client.get_relay_configuration() + +for iceServer in config.ice_servers: + assert iceServer.username is not None + print('Username: ' + iceServer.username) + + assert iceServer.credential is not None + print('Credential: ' + iceServer.credential) + + assert iceServer.urls is not None + for url in iceServer.urls: + print('Url:' + url) +``` + +### Getting the relay configuration without providing a RouteType + +```python +# We need a user from Identity +user = identity_client.create_user() +relay_configuration = relay_client.get_relay_configuration(user, RouteType.NEAREST) + +for iceServer in config.ice_servers: + assert iceServer.username is not None + print('Username: ' + iceServer.username) + + assert iceServer.credential is not None + print('Credential: ' + iceServer.credential) + + assert iceServer.urls is not None + for url in iceServer.urls: + print('Url:' + url) +``` + # Troubleshooting The Azure Communication Relay client will raise exceptions defined in [Azure Core][azure_core].