azure-communication-networktraversal


Nameazure-communication-networktraversal JSON
Version 1.1.0b2 PyPI version JSON
download
home_pagehttps://github.com/Azure/azure-sdk-for-python
SummaryMicrosoft Azure Communication Network Traversal Service Client Library for Python
upload_time2024-04-16 16:44:59
maintainerNone
docs_urlNone
authorMicrosoft Corporation
requires_python>=3.8
licenseMIT License
keywords azure azure sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Azure Communication Network Traversal Package client library for Python

**Please note, this package has been deprecated and will no longer be maintained after 03/31/2024.**

Azure Communication Network Traversal is managing TURN credentials for Azure Communication Services.

It will provide TURN credentials to a user.

[Source code](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/communication) | [API reference documentation](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/communication)

## _Disclaimer_

_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_

# Getting started
Please note, this package has been deprecated and will no longer be maintained after 03/31/2024.

# Key concepts

## Examples

### Initializing Relay Client

The following section provides code snippets covering some of the most common Azure Communication Network Traversal tasks, including:

- [Getting the relay configuration](#getting-the-relay-configuration)

```python
# You can find your endpoint and access token from your resource in the Azure Portal
import os
from azure.communication.networktraversal import CommunicationRelayClient
from azure.identity import DefaultAzureCredential
from azure.communication.identity import CommunicationIdentityClient

connection_str = "endpoint=ENDPOINT;accessKey=KEY"
endpoint = "https://<RESOURCE_NAME>.communication.azure.com"

# To use Azure Active Directory Authentication (DefaultAzureCredential) make sure to have
# AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET as env variables.
# We also need Identity client to get a User Identifier
identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())
relay_client = CommunicationRelayClient(endpoint, DefaultAzureCredential())
```

#You can also authenticate using your connection string

```python
identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)
relay_client = CommunicationRelayClient.from_connection_string(self.connection_string)
```

### Getting the relay configuration providing a user

```python
# We need a user from Identity
user = identity_client.create_user()
relay_configuration = relay_client.get_relay_configuration(user=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)
```

### 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=user, route_type=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].

# Next steps

## More sample code

## Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project

# Contributing

This project welcomes contributions and suggestions.  Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the
PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

<!-- LINKS -->
[azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/README.md

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Azure/azure-sdk-for-python",
    "name": "azure-communication-networktraversal",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "azure, azure sdk",
    "author": "Microsoft Corporation",
    "author_email": "azuresdkengsysadmins@microsoft.com",
    "download_url": "https://files.pythonhosted.org/packages/c8/5a/95acfcd8b6e2244f3185ff0858cfae9d036bdffccc5172c59310e0654f2f/azure-communication-networktraversal-1.1.0b2.tar.gz",
    "platform": null,
    "description": "# Azure Communication Network Traversal Package client library for Python\n\n**Please note, this package has been deprecated and will no longer be maintained after 03/31/2024.**\n\nAzure Communication Network Traversal is managing TURN credentials for Azure Communication Services.\n\nIt will provide TURN credentials to a user.\n\n[Source code](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/communication) | [API reference documentation](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/communication)\n\n## _Disclaimer_\n\n_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_\n\n# Getting started\nPlease note, this package has been deprecated and will no longer be maintained after 03/31/2024.\n\n# Key concepts\n\n## Examples\n\n### Initializing Relay Client\n\nThe following section provides code snippets covering some of the most common Azure Communication Network Traversal tasks, including:\n\n- [Getting the relay configuration](#getting-the-relay-configuration)\n\n```python\n# You can find your endpoint and access token from your resource in the Azure Portal\nimport os\nfrom azure.communication.networktraversal import CommunicationRelayClient\nfrom azure.identity import DefaultAzureCredential\nfrom azure.communication.identity import CommunicationIdentityClient\n\nconnection_str = \"endpoint=ENDPOINT;accessKey=KEY\"\nendpoint = \"https://<RESOURCE_NAME>.communication.azure.com\"\n\n# To use Azure Active Directory Authentication (DefaultAzureCredential) make sure to have\n# AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET as env variables.\n# We also need Identity client to get a User Identifier\nidentity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\nrelay_client = CommunicationRelayClient(endpoint, DefaultAzureCredential())\n```\n\n#You can also authenticate using your connection string\n\n```python\nidentity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\nrelay_client = CommunicationRelayClient.from_connection_string(self.connection_string)\n```\n\n### Getting the relay configuration providing a user\n\n```python\n# We need a user from Identity\nuser = identity_client.create_user()\nrelay_configuration = relay_client.get_relay_configuration(user=user)\n\nfor iceServer in config.ice_servers:\n    assert iceServer.username is not None\n    print('Username: ' + iceServer.username)\n\n    assert iceServer.credential is not None\n    print('Credential: ' + iceServer.credential)\n    \n    assert iceServer.urls is not None\n    for url in iceServer.urls:\n        print('Url:' + url)\n```\n\n### Getting the relay configuration without providing a user\n\n```python\nrelay_configuration = relay_client.get_relay_configuration()\n\nfor iceServer in config.ice_servers:\n    assert iceServer.username is not None\n    print('Username: ' + iceServer.username)\n\n    assert iceServer.credential is not None\n    print('Credential: ' + iceServer.credential)\n    \n    assert iceServer.urls is not None\n    for url in iceServer.urls:\n        print('Url:' + url)\n```\n\n### Getting the relay configuration without providing a RouteType\n\n```python\n# We need a user from Identity\nuser = identity_client.create_user()\nrelay_configuration = relay_client.get_relay_configuration(user=user, route_type=RouteType.NEAREST)\n\nfor iceServer in config.ice_servers:\n    assert iceServer.username is not None\n    print('Username: ' + iceServer.username)\n\n    assert iceServer.credential is not None\n    print('Credential: ' + iceServer.credential)\n    \n    assert iceServer.urls is not None\n    for url in iceServer.urls:\n        print('Url:' + url)\n```\n\n# Troubleshooting\n\nThe Azure Communication Relay client will raise exceptions defined in [Azure Core][azure_core].\n\n# Next steps\n\n## More sample code\n\n## Provide Feedback\n\nIf you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project\n\n# Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the\nPR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n<!-- LINKS -->\n[azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/README.md\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Microsoft Azure Communication Network Traversal Service Client Library for Python",
    "version": "1.1.0b2",
    "project_urls": {
        "Bug Reports": "https://github.com/Azure/azure-sdk-for-python/issues",
        "Homepage": "https://github.com/Azure/azure-sdk-for-python",
        "Source": "https://github.com/Azure/azure-sdk-for-python"
    },
    "split_keywords": [
        "azure",
        " azure sdk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dddb32d174fac9bf2e637918ce7d621e04a14418048af6bfeedb1806e88ebbc9",
                "md5": "217a029abc61504f4911620e2cd2fb2e",
                "sha256": "cdd5fa0c219f22c5ae2f63e6ed74b00477677293131fbdb68e285b6edff09bd1"
            },
            "downloads": -1,
            "filename": "azure_communication_networktraversal-1.1.0b2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "217a029abc61504f4911620e2cd2fb2e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 44264,
            "upload_time": "2024-04-16T16:45:01",
            "upload_time_iso_8601": "2024-04-16T16:45:01.482796Z",
            "url": "https://files.pythonhosted.org/packages/dd/db/32d174fac9bf2e637918ce7d621e04a14418048af6bfeedb1806e88ebbc9/azure_communication_networktraversal-1.1.0b2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c85a95acfcd8b6e2244f3185ff0858cfae9d036bdffccc5172c59310e0654f2f",
                "md5": "917a96d7f01df7c755487eafcd3dd923",
                "sha256": "d6a7125bb0069634544378e5181dcfc6009411a97d2db3451657751cf8b411ae"
            },
            "downloads": -1,
            "filename": "azure-communication-networktraversal-1.1.0b2.tar.gz",
            "has_sig": false,
            "md5_digest": "917a96d7f01df7c755487eafcd3dd923",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 31400,
            "upload_time": "2024-04-16T16:44:59",
            "upload_time_iso_8601": "2024-04-16T16:44:59.423796Z",
            "url": "https://files.pythonhosted.org/packages/c8/5a/95acfcd8b6e2244f3185ff0858cfae9d036bdffccc5172c59310e0654f2f/azure-communication-networktraversal-1.1.0b2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 16:44:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Azure",
    "github_project": "azure-sdk-for-python",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "azure-communication-networktraversal"
}
        
Elapsed time: 0.30209s