Skip to content

Commit 40436b0

Browse files
author
SDK Automation
committed
Update from master
1 parent 513a199 commit 40436b0

File tree

109 files changed

+11223
-25709
lines changed

Some content is hidden

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

109 files changed

+11223
-25709
lines changed

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

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

3-
## 8.0.0b1 (2020-06-17)
4-
5-
This is beta preview version.
6-
7-
This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming).
8-
9-
**General breaking changes**
10-
11-
- Credential system has been completly revamped:
12-
13-
- `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported, use the `azure-identity` classes instead: https://pypi.org/project/azure-identity/
14-
- `credentials` parameter has been renamed `credential`
15-
16-
- The `config` attribute no longer exists on a client, configuration should be passed as kwarg. Example: `MyClient(credential, subscription_id, enable_logging=True)`. For a complete set of
17-
supported options, see the [parameters accept in init documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
18-
- You can't import a `version` module anymore, use `__version__` instead
19-
- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`.
20-
- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed).
21-
- Most of the operation kwarg have changed. Some of the most noticeable:
22-
23-
- `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user
24-
- For a complete set of
25-
supported options, see the [parameters accept in Request documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
26-
27-
**General new features**
28-
29-
- Type annotations support using `typing`. SDKs are mypy ready.
30-
- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client.
31-
- This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core-tracing-opentelemetry) for an overview.
32-
33-
## 4.0.0 (2020-06-12)
34-
35-
**Features**
36-
37-
- Model Cluster has a new parameter updated_at
38-
- Model Cluster has a new parameter created_at
39-
- Added operation ClustersOperations.update
40-
- Added operation ClustersOperations.create_or_update
41-
- Added operation ClustersOperations.list_available_cluster_region
42-
43-
** Breaking changes**
44-
45-
- Model Cluster no longer has parameter created
46-
- Model Cluster no longer has parameter updated
47-
- Removed operation ClustersOperations.put
48-
- Removed operation ClustersOperations.list_available_clusters
49-
- Removed operation ClustersOperations.patch
50-
513
## 3.1.0 (2020-05-13)
524

535
**Features**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
This is the Microsoft Azure EventHub Management Client Library.
44
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
5-
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
5+
For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/)
66

77

88
# Usage
99

10-
For code examples, see [EventHub Management](https://docs.microsoft.com/python/api/overview/azure/event-hub?view=azure-python-preview)
10+
For code examples, see [EventHub Management](https://docs.microsoft.com/python/api/overview/azure/event-hub)
1111
on docs.microsoft.com.
1212

1313

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
57
# Code generated by Microsoft (R) AutoRest Code Generator.
6-
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
710
# --------------------------------------------------------------------------
811

12+
from ._configuration import EventHubManagementClientConfiguration
913
from ._event_hub_management_client import EventHubManagementClient
10-
__all__ = ['EventHubManagementClient']
14+
__all__ = ['EventHubManagementClient', 'EventHubManagementClientConfiguration']
15+
16+
from .version import VERSION
17+
18+
__version__ = VERSION
1119

12-
try:
13-
from ._patch import patch_sdk
14-
patch_sdk()
15-
except ImportError:
16-
pass

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

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

13-
from azure.core.configuration import Configuration
14-
from azure.core.pipeline import policies
13+
from .version import VERSION
1514

16-
from ._version import VERSION
17-
18-
19-
class EventHubManagementClientConfiguration(Configuration):
20-
"""Configuration for EventHubManagementClient.
2115

16+
class EventHubManagementClientConfiguration(AzureConfiguration):
17+
"""Configuration for EventHubManagementClient
2218
Note that all parameters used to create this instance are saved as instance
2319
attributes.
2420
25-
:param credential: Credential needed for the client to connect to Azure.
26-
:type credential: ~azure.core.credentials.TokenCredential
27-
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
21+
:param credentials: Credentials needed for the client to connect to Azure.
22+
:type credentials: :mod:`A msrestazure Credentials
23+
object<msrestazure.azure_active_directory>`
24+
:param subscription_id: Subscription credentials that uniquely identify a
25+
Microsoft Azure subscription. The subscription ID forms part of the URI
26+
for every service call.
2827
:type subscription_id: str
28+
:param str base_url: Service URL
2929
"""
3030

3131
def __init__(
32-
self,
33-
credential, # type: "TokenCredential"
34-
subscription_id, # type: str
35-
**kwargs # type: Any
36-
):
37-
# type: (...) -> None
38-
if credential is None:
39-
raise ValueError("Parameter 'credential' must not be None.")
32+
self, credentials, subscription_id, base_url=None):
33+
34+
if credentials is None:
35+
raise ValueError("Parameter 'credentials' must not be None.")
4036
if subscription_id is None:
4137
raise ValueError("Parameter 'subscription_id' must not be None.")
42-
super(EventHubManagementClientConfiguration, self).__init__(**kwargs)
38+
if not base_url:
39+
base_url = 'https://management.azure.com'
4340

44-
self.credential = credential
45-
self.subscription_id = subscription_id
46-
self.credential_scopes = ['https://management.azure.com/.default']
47-
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
48-
kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION))
49-
self._configure(**kwargs)
41+
super(EventHubManagementClientConfiguration, self).__init__(base_url)
5042

51-
def _configure(
52-
self,
53-
**kwargs # type: Any
54-
):
55-
# type: (...) -> None
56-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
57-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
58-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
59-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
60-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
61-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
62-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
63-
self.authentication_policy = kwargs.get('authentication_policy')
64-
if self.credential and not self.authentication_policy:
65-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
43+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
44+
self.keep_alive = True
45+
46+
self.add_user_agent('azure-mgmt-eventhub/{}'.format(VERSION))
47+
self.add_user_agent('Azure-SDK-For-Python')
48+
49+
self.credentials = credentials
50+
self.subscription_id = subscription_id

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

Lines changed: 29 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,41 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from azure.mgmt.core import ARMPipelineClient
12+
from msrest.service_client import SDKClient
1313
from msrest import Serializer, Deserializer
1414

1515
from azure.profiles import KnownProfiles, ProfileDefinition
1616
from azure.profiles.multiapiclient import MultiApiClientMixin
1717
from ._configuration import EventHubManagementClientConfiguration
1818

19-
class _SDKClient(object):
20-
def __init__(self, *args, **kwargs):
21-
"""This is a fake class to support current implemetation of MultiApiClientMixin."
22-
Will be removed in final version of multiapi azure-core based client
23-
"""
24-
pass
2519

26-
class EventHubManagementClient(MultiApiClientMixin, _SDKClient):
27-
"""Azure Event Hubs client.
2820

29-
This ready contains multiple API versions, to help you deal with all of the Azure clouds
21+
class EventHubManagementClient(MultiApiClientMixin, SDKClient):
22+
"""Azure Event Hubs client
23+
24+
This ready contains multiple API versions, to help you deal with all Azure clouds
3025
(Azure Stack, Azure Government, Azure China, etc.).
31-
By default, it uses the latest API version available on public Azure.
32-
For production, you should stick to a particular api-version and/or profile.
33-
The profile sets a mapping between an operation group and its API version.
26+
By default, uses latest API version available on public Azure.
27+
For production, you should stick a particular api-version and/or profile.
28+
The profile sets a mapping between the operation group and an API version.
3429
The api-version parameter sets the default API version if the operation
3530
group is not described in the profile.
3631
37-
:param credential: Credential needed for the client to connect to Azure.
38-
:type credential: ~azure.core.credentials.TokenCredential
39-
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
32+
:ivar config: Configuration for client.
33+
:vartype config: EventHubManagementClientConfiguration
34+
35+
:param credentials: Credentials needed for the client to connect to Azure.
36+
:type credentials: :mod:`A msrestazure Credentials
37+
object<msrestazure.azure_active_directory>`
38+
:param subscription_id: Subscription credentials which uniquely identify
39+
Microsoft Azure subscription. The subscription ID forms part of the URI
40+
for every service call.
4041
:type subscription_id: str
4142
:param str api_version: API version to use if no profile is provided, or if
4243
missing in profile.
4344
:param str base_url: Service URL
4445
:param profile: A profile definition, from KnownProfiles to dict.
4546
:type profile: azure.profiles.KnownProfiles
46-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
4747
"""
4848

4949
DEFAULT_API_VERSION = '2017-04-01'
@@ -55,22 +55,11 @@ class EventHubManagementClient(MultiApiClientMixin, _SDKClient):
5555
_PROFILE_TAG + " latest"
5656
)
5757

58-
def __init__(
59-
self,
60-
credential, # type: "TokenCredential"
61-
subscription_id, # type: str
62-
api_version=None,
63-
base_url=None,
64-
profile=KnownProfiles.default,
65-
**kwargs # type: Any
66-
):
67-
if not base_url:
68-
base_url = 'https://management.azure.com'
69-
self._config = EventHubManagementClientConfiguration(credential, subscription_id, **kwargs)
70-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
58+
def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
59+
self.config = EventHubManagementClientConfiguration(credentials, subscription_id, base_url)
7160
super(EventHubManagementClient, self).__init__(
72-
credential,
73-
self._config,
61+
credentials,
62+
self.config,
7463
api_version=api_version,
7564
profile=profile
7665
)
@@ -109,7 +98,7 @@ def clusters(self):
10998
from .v2018_01_01_preview.operations import ClustersOperations as OperationClass
11099
else:
111100
raise NotImplementedError("APIVersion {} is not available".format(api_version))
112-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
101+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
113102

114103
@property
115104
def configuration(self):
@@ -122,7 +111,7 @@ def configuration(self):
122111
from .v2018_01_01_preview.operations import ConfigurationOperations as OperationClass
123112
else:
124113
raise NotImplementedError("APIVersion {} is not available".format(api_version))
125-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
114+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
126115

127116
@property
128117
def consumer_groups(self):
@@ -141,7 +130,7 @@ def consumer_groups(self):
141130
from .v2018_01_01_preview.operations import ConsumerGroupsOperations as OperationClass
142131
else:
143132
raise NotImplementedError("APIVersion {} is not available".format(api_version))
144-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
133+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
145134

146135
@property
147136
def disaster_recovery_configs(self):
@@ -157,7 +146,7 @@ def disaster_recovery_configs(self):
157146
from .v2018_01_01_preview.operations import DisasterRecoveryConfigsOperations as OperationClass
158147
else:
159148
raise NotImplementedError("APIVersion {} is not available".format(api_version))
160-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
149+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
161150

162151
@property
163152
def event_hubs(self):
@@ -176,7 +165,7 @@ def event_hubs(self):
176165
from .v2018_01_01_preview.operations import EventHubsOperations as OperationClass
177166
else:
178167
raise NotImplementedError("APIVersion {} is not available".format(api_version))
179-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
168+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
180169

181170
@property
182171
def namespaces(self):
@@ -195,7 +184,7 @@ def namespaces(self):
195184
from .v2018_01_01_preview.operations import NamespacesOperations as OperationClass
196185
else:
197186
raise NotImplementedError("APIVersion {} is not available".format(api_version))
198-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
187+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
199188

200189
@property
201190
def operations(self):
@@ -214,7 +203,7 @@ def operations(self):
214203
from .v2018_01_01_preview.operations import Operations as OperationClass
215204
else:
216205
raise NotImplementedError("APIVersion {} is not available".format(api_version))
217-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
206+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
218207

219208
@property
220209
def regions(self):
@@ -230,12 +219,4 @@ def regions(self):
230219
from .v2018_01_01_preview.operations import RegionsOperations as OperationClass
231220
else:
232221
raise NotImplementedError("APIVersion {} is not available".format(api_version))
233-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
234-
235-
def close(self):
236-
self._client.close()
237-
def __enter__(self):
238-
self._client.__enter__()
239-
return self
240-
def __exit__(self, *exc_details):
241-
self._client.__exit__(*exc_details)
222+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

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

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)