Skip to content

Commit 4da5f96

Browse files
azure-sdkZhenbiao Wei (WICRESOFT NORTH AMERICA LTD)
andauthored
[AutoRelease] t2-eventhub-2023-02-14-65994(can only be merged by SDK owner) (Azure#28799)
* code and test * update version --------- Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <[email protected]>
1 parent ee3aa5d commit 4da5f96

File tree

370 files changed

+85538
-37293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+85538
-37293
lines changed

sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Release History
22

3+
## 11.0.0b1 (2023-02-14)
4+
5+
### Features Added
6+
7+
- Model Eventhub has a new parameter retention_description
8+
9+
### Breaking Changes
10+
11+
- Model NetworkSecurityPerimeterConfiguration no longer has parameter location
12+
- Model NetworkSecurityPerimeterConfiguration no longer has parameter tags
13+
314
## 10.1.0 (2022-06-22)
415

516
**Features**

sdk/eventhub/azure-mgmt-eventhub/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include _meta.json
22
recursive-include tests *.py *.json
3+
recursive-include samples *.py *.md
34
include *.md
45
include azure/__init__.py
56
include azure/mgmt/__init__.py

sdk/eventhub/azure-mgmt-eventhub/README.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,52 @@ For a more complete view of Azure libraries, see the [azure sdk python release](
88

99
_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_
1010

11-
# Usage
11+
## Getting started
1212

13+
### Prerequisites
1314

14-
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/event-hub?view=azure-python-preview)
17-
Code samples for this package can be found at [Event Hub Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
18-
Additional code samples for different Azure services are available at [Samples Repo](https://github.com/Azure-Samples/azure-samples-python-management/tree/main/samples/eventhub)
15+
- Python 3.7+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
1917

18+
### Install the package
2019

21-
# Provide Feedback
20+
```bash
21+
pip install azure-mgmt-eventhub
22+
pip install azure-identity
23+
```
24+
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
32+
33+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
34+
35+
With above configuration, client can be authenticated by following code:
36+
37+
```python
38+
from azure.identity import DefaultAzureCredential
39+
from azure.mgmt.eventhub import EventHubManagementClient
40+
import os
41+
42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = EventHubManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
45+
46+
## Examples
47+
48+
49+
Code samples for this package can be found at [Event Hub Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com and [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
50+
51+
52+
## Troubleshooting
53+
54+
## Next steps
55+
56+
## Provide Feedback
2257

2358
If you encounter any bugs or have suggestions, please file an issue in the
2459
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"commit": "2f17a9028f33fe80cf1ae62642fe9ed63c0a17f7",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.13.0",
5-
"@autorest/modelerfour@4.19.3"
6+
"@autorest/python@6.4.0",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "f1cf4b44dc3abfcf9d9a514e2e6faa3ae8d11b4c",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/eventhub/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
9+
"autorest_command": "autorest specification/eventhub/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/eventhub/resource-manager/readme.md"
1111
}

sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
patch_sdk()
1515
except ImportError:
1616
pass
17+
18+
from ._version import VERSION
19+
20+
__version__ = VERSION

sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_configuration.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Changes may cause incorrect behavior and will be lost if the code is
99
# regenerated.
1010
# --------------------------------------------------------------------------
11-
from typing import TYPE_CHECKING
11+
from typing import Any, TYPE_CHECKING
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
@@ -18,8 +18,6 @@
1818

1919
if TYPE_CHECKING:
2020
# pylint: disable=unused-import,ungrouped-imports
21-
from typing import Any
22-
2321
from azure.core.credentials import TokenCredential
2422

2523
class EventHubManagementClientConfiguration(Configuration):
@@ -28,19 +26,18 @@ class EventHubManagementClientConfiguration(Configuration):
2826
Note that all parameters used to create this instance are saved as instance
2927
attributes.
3028
31-
:param credential: Credential needed for the client to connect to Azure.
29+
:param credential: Credential needed for the client to connect to Azure. Required.
3230
:type credential: ~azure.core.credentials.TokenCredential
33-
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
31+
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.
3432
:type subscription_id: str
3533
"""
3634

3735
def __init__(
3836
self,
39-
credential, # type: "TokenCredential"
40-
subscription_id, # type: str
41-
**kwargs # type: Any
37+
credential: "TokenCredential",
38+
subscription_id: str,
39+
**kwargs: Any
4240
):
43-
# type: (...) -> None
4441
if credential is None:
4542
raise ValueError("Parameter 'credential' must not be None.")
4643
if subscription_id is None:
@@ -55,9 +52,8 @@ def __init__(
5552

5653
def _configure(
5754
self,
58-
**kwargs # type: Any
55+
**kwargs: Any
5956
):
60-
# type: (...) -> None
6157
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
6258
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
6359
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)

0 commit comments

Comments
 (0)