Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdk/relay/azure-mgmt-relay/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 1.1.1 (2026-05-09)

Comment thread
msyyc marked this conversation as resolved.
### Other Changes

- Regenerated with latest code generator tool

## 2.0.0b1 (2022-11-08)

### Features Added
Expand Down
9 changes: 4 additions & 5 deletions sdk/relay/azure-mgmt-relay/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
include _meta.json
recursive-include tests *.py *.json
recursive-include samples *.py *.md
include *.md
include azure/__init__.py
include azure/mgmt/__init__.py
include LICENSE
include azure/mgmt/relay/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/mgmt/__init__.py
55 changes: 44 additions & 11 deletions sdk/relay/azure-mgmt-relay/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,61 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure Relay Client Library.
This package has been tested with Python 3.7+.
This package has been tested with Python 3.10+.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
Comment thread
msyyc marked this conversation as resolved.

## _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_

# Usage
## Getting started

### Prerequisites

To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)

For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/relay)
Code samples for this package can be found at [Relay](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
Additional code samples for different Azure services are available at [Samples Repo](https://github.com/Azure-Samples/azure-samples-python-management/tree/main/samples/relay)
- Python 3.10+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)
Comment thread
msyyc marked this conversation as resolved.

### Install the package

# Provide Feedback
```bash
pip install azure-mgmt-relay
pip install azure-identity
```

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.
### Authentication

By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` for Azure client secret.

In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.

With above configuration, client can be authenticated by following code:

```python
from azure.identity import DefaultAzureCredential
from azure.mgmt.relay import RelayAPI
import os

sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = RelayAPI(credential=DefaultAzureCredential(), subscription_id=sub_id)
```

## Examples

Code samples for this package can be found at:
- [Search Relay](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)


## Troubleshooting

## Next steps

## 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.
11 changes: 0 additions & 11 deletions sdk/relay/azure-mgmt-relay/_meta.json

This file was deleted.

11 changes: 11 additions & 0 deletions sdk/relay/azure-mgmt-relay/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commit": "cbafdff192ed6ae5bad220cf0288180b33529c6f",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.50.0",
"@autorest/modelerfour@4.27.0"
],
"autorest_command": "autorest specification/relay/resource-manager/Microsoft.Relay/Relay/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/home/codespace/workspace/sdk --tag=package-2017-04 --use=@autorest/python@6.50.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/relay/resource-manager/Microsoft.Relay/Relay/readme.md"
}
99 changes: 99 additions & 0 deletions sdk/relay/azure-mgmt-relay/apiview-properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"CrossLanguagePackageId": null,
"CrossLanguageDefinitionId": {
"azure.mgmt.relay.models.AccessKeys": null,
"azure.mgmt.relay.models.Resource": null,
"azure.mgmt.relay.models.AuthorizationRule": null,
"azure.mgmt.relay.models.AuthorizationRuleListResult": null,
"azure.mgmt.relay.models.CheckNameAvailability": null,
"azure.mgmt.relay.models.CheckNameAvailabilityResult": null,
"azure.mgmt.relay.models.ErrorResponse": null,
"azure.mgmt.relay.models.HybridConnection": null,
"azure.mgmt.relay.models.HybridConnectionListResult": null,
"azure.mgmt.relay.models.Operation": null,
"azure.mgmt.relay.models.OperationDisplay": null,
"azure.mgmt.relay.models.OperationListResult": null,
"azure.mgmt.relay.models.RegenerateAccessKeyParameters": null,
"azure.mgmt.relay.models.TrackedResource": null,
"azure.mgmt.relay.models.RelayNamespace": null,
"azure.mgmt.relay.models.RelayNamespaceListResult": null,
"azure.mgmt.relay.models.ResourceNamespacePatch": null,
"azure.mgmt.relay.models.RelayUpdateParameters": null,
"azure.mgmt.relay.models.Sku": null,
"azure.mgmt.relay.models.WcfRelay": null,
"azure.mgmt.relay.models.WcfRelaysListResult": null,
"azure.mgmt.relay.models.ProvisioningStateEnum": null,
"azure.mgmt.relay.models.AccessRights": null,
"azure.mgmt.relay.models.Relaytype": null,
"azure.mgmt.relay.models.UnavailableReason": null,
"azure.mgmt.relay.models.KeyType": null,
"azure.mgmt.relay.operations.Operations.list": null,
"azure.mgmt.relay.aio.operations.Operations.list": null,
"azure.mgmt.relay.operations.NamespacesOperations.check_name_availability": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.check_name_availability": null,
"azure.mgmt.relay.operations.NamespacesOperations.list": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.list": null,
"azure.mgmt.relay.operations.NamespacesOperations.list_by_resource_group": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.list_by_resource_group": null,
"azure.mgmt.relay.operations.NamespacesOperations.begin_create_or_update": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.begin_create_or_update": null,
"azure.mgmt.relay.operations.NamespacesOperations.begin_delete": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.begin_delete": null,
"azure.mgmt.relay.operations.NamespacesOperations.get": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.get": null,
"azure.mgmt.relay.operations.NamespacesOperations.update": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.update": null,
"azure.mgmt.relay.operations.NamespacesOperations.list_authorization_rules": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.list_authorization_rules": null,
"azure.mgmt.relay.operations.NamespacesOperations.create_or_update_authorization_rule": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.create_or_update_authorization_rule": null,
"azure.mgmt.relay.operations.NamespacesOperations.delete_authorization_rule": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.delete_authorization_rule": null,
"azure.mgmt.relay.operations.NamespacesOperations.get_authorization_rule": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.get_authorization_rule": null,
"azure.mgmt.relay.operations.NamespacesOperations.list_keys": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.list_keys": null,
"azure.mgmt.relay.operations.NamespacesOperations.regenerate_keys": null,
"azure.mgmt.relay.aio.operations.NamespacesOperations.regenerate_keys": null,
"azure.mgmt.relay.operations.HybridConnectionsOperations.list_by_namespace": null,
"azure.mgmt.relay.aio.operations.HybridConnectionsOperations.list_by_namespace": null,
"azure.mgmt.relay.operations.HybridConnectionsOperations.create_or_update": null,
"azure.mgmt.relay.aio.operations.HybridConnectionsOperations.create_or_update": null,
"azure.mgmt.relay.operations.HybridConnectionsOperations.delete": null,
"azure.mgmt.relay.aio.operations.HybridConnectionsOperations.delete": null,
"azure.mgmt.relay.operations.HybridConnectionsOperations.get": null,
"azure.mgmt.relay.aio.operations.HybridConnectionsOperations.get": null,
"azure.mgmt.relay.operations.HybridConnectionsOperations.list_authorization_rules": null,
"azure.mgmt.relay.aio.operations.HybridConnectionsOperations.list_authorization_rules": null,
"azure.mgmt.relay.operations.HybridConnectionsOperations.create_or_update_authorization_rule": null,
"azure.mgmt.relay.aio.operations.HybridConnectionsOperations.create_or_update_authorization_rule": null,
"azure.mgmt.relay.operations.HybridConnectionsOperations.delete_authorization_rule": null,
"azure.mgmt.relay.aio.operations.HybridConnectionsOperations.delete_authorization_rule": null,
"azure.mgmt.relay.operations.HybridConnectionsOperations.get_authorization_rule": null,
"azure.mgmt.relay.aio.operations.HybridConnectionsOperations.get_authorization_rule": null,
"azure.mgmt.relay.operations.HybridConnectionsOperations.list_keys": null,
"azure.mgmt.relay.aio.operations.HybridConnectionsOperations.list_keys": null,
"azure.mgmt.relay.operations.HybridConnectionsOperations.regenerate_keys": null,
"azure.mgmt.relay.aio.operations.HybridConnectionsOperations.regenerate_keys": null,
"azure.mgmt.relay.operations.WCFRelaysOperations.list_by_namespace": null,
"azure.mgmt.relay.aio.operations.WCFRelaysOperations.list_by_namespace": null,
"azure.mgmt.relay.operations.WCFRelaysOperations.create_or_update": null,
"azure.mgmt.relay.aio.operations.WCFRelaysOperations.create_or_update": null,
"azure.mgmt.relay.operations.WCFRelaysOperations.delete": null,
"azure.mgmt.relay.aio.operations.WCFRelaysOperations.delete": null,
"azure.mgmt.relay.operations.WCFRelaysOperations.get": null,
"azure.mgmt.relay.aio.operations.WCFRelaysOperations.get": null,
"azure.mgmt.relay.operations.WCFRelaysOperations.list_authorization_rules": null,
"azure.mgmt.relay.aio.operations.WCFRelaysOperations.list_authorization_rules": null,
"azure.mgmt.relay.operations.WCFRelaysOperations.create_or_update_authorization_rule": null,
"azure.mgmt.relay.aio.operations.WCFRelaysOperations.create_or_update_authorization_rule": null,
"azure.mgmt.relay.operations.WCFRelaysOperations.delete_authorization_rule": null,
"azure.mgmt.relay.aio.operations.WCFRelaysOperations.delete_authorization_rule": null,
"azure.mgmt.relay.operations.WCFRelaysOperations.get_authorization_rule": null,
"azure.mgmt.relay.aio.operations.WCFRelaysOperations.get_authorization_rule": null,
"azure.mgmt.relay.operations.WCFRelaysOperations.list_keys": null,
"azure.mgmt.relay.aio.operations.WCFRelaysOperations.list_keys": null,
"azure.mgmt.relay.operations.WCFRelaysOperations.regenerate_keys": null,
"azure.mgmt.relay.aio.operations.WCFRelaysOperations.regenerate_keys": null
}
}
2 changes: 1 addition & 1 deletion sdk/relay/azure-mgmt-relay/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
2 changes: 1 addition & 1 deletion sdk/relay/azure-mgmt-relay/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
12 changes: 9 additions & 3 deletions sdk/relay/azure-mgmt-relay/azure/mgmt/relay/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._relay_api import RelayAPI
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._relay_api import RelayAPI # type: ignore
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"RelayAPI",
]
__all__.extend([p for p in _patch_all if p not in __all__])
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

_patch_sdk()
38 changes: 19 additions & 19 deletions sdk/relay/azure-mgmt-relay/azure/mgmt/relay/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,19 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core import AzureClouds
from azure.core.credentials import TokenCredential


class RelayAPIConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
class RelayAPIConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for RelayAPI.

Note that all parameters used to create this instance are saved as instance
Expand All @@ -36,14 +29,22 @@ class RelayAPIConfiguration(Configuration): # pylint: disable=too-many-instance
:param subscription_id: Subscription credentials which uniquely identify the Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2021-11-01". Note that overriding this
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
None.
:type cloud_setting: ~azure.core.AzureClouds
:keyword api_version: Api Version. Default value is "2017-04-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(RelayAPIConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2021-11-01") # type: Literal["2021-11-01"]
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
cloud_setting: Optional["AzureClouds"] = None,
**kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2017-04-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -52,23 +53,22 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs

self.credential = credential
self.subscription_id = subscription_id
self.cloud_setting = cloud_setting
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-relay/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)

def _configure(
self, **kwargs # type: Any
):
# type: (...) -> None
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(
Expand Down
Loading