Skip to content

Commit 76fb04c

Browse files
authored
[T2] RDBMS (Azure#15336)
1 parent 1ed0543 commit 76fb04c

File tree

296 files changed

+60965
-19975
lines changed

Some content is hidden

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

296 files changed

+60965
-19975
lines changed

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

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

3+
## 7.0.0b1 (2020-11-05)
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+
333
## 2.2.0 (2020-03-25)
434

535
**Features**

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ For a more complete view of Azure libraries, see the [azure sdk python release](
1010
For code examples, see [RDBMS Management](https://docs.microsoft.com/python/api/overview/azure/)
1111
on docs.microsoft.com.
1212

13+
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
14+
15+
16+
17+
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
18+
Code samples for this package can be found at [RDBMS Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
19+
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
20+
1321

1422
# Provide Feedback
1523

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py renamed to sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# license information.
66
# --------------------------------------------------------------------------
77

8-
VERSION = "2.2.0"
8+
VERSION = "7.0.0b1"
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
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
5-
# license information.
6-
#
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
75
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
107
# --------------------------------------------------------------------------
118

12-
from ._configuration import MariaDBManagementClientConfiguration
139
from ._maria_db_management_client import MariaDBManagementClient
14-
__all__ = ['MariaDBManagementClient', 'MariaDBManagementClientConfiguration']
15-
16-
from .version import VERSION
17-
18-
__version__ = VERSION
10+
__all__ = ['MariaDBManagementClient']
1911

12+
try:
13+
from ._patch import patch_sdk # type: ignore
14+
patch_sdk()
15+
except ImportError:
16+
pass
Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,69 @@
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
5-
# license information.
6-
#
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
75
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
107
# --------------------------------------------------------------------------
11-
from msrestazure import AzureConfiguration
128

13-
from .version import VERSION
9+
from typing import TYPE_CHECKING
1410

11+
from azure.core.configuration import Configuration
12+
from azure.core.pipeline import policies
13+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
15+
if TYPE_CHECKING:
16+
# pylint: disable=unused-import,ungrouped-imports
17+
from typing import Any
18+
19+
from azure.core.credentials import TokenCredential
20+
21+
VERSION = "unknown"
22+
23+
class MariaDBManagementClientConfiguration(Configuration):
24+
"""Configuration for MariaDBManagementClient.
1525
16-
class MariaDBManagementClientConfiguration(AzureConfiguration):
17-
"""Configuration for MariaDBManagementClient
1826
Note that all parameters used to create this instance are saved as instance
1927
attributes.
2028
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>`
29+
:param credential: Credential needed for the client to connect to Azure.
30+
:type credential: ~azure.core.credentials.TokenCredential
2431
:param subscription_id: The ID of the target subscription.
2532
:type subscription_id: str
26-
:param str base_url: Service URL
2733
"""
2834

2935
def __init__(
30-
self, credentials, subscription_id, base_url=None):
31-
32-
if credentials is None:
33-
raise ValueError("Parameter 'credentials' must not be None.")
36+
self,
37+
credential, # type: "TokenCredential"
38+
subscription_id, # type: str
39+
**kwargs # type: Any
40+
):
41+
# type: (...) -> None
42+
if credential is None:
43+
raise ValueError("Parameter 'credential' must not be None.")
3444
if subscription_id is None:
3545
raise ValueError("Parameter 'subscription_id' must not be None.")
36-
if not base_url:
37-
base_url = 'https://management.azure.com'
46+
super(MariaDBManagementClientConfiguration, self).__init__(**kwargs)
3847

39-
super(MariaDBManagementClientConfiguration, self).__init__(base_url)
40-
41-
# Starting Autorest.Python 4.0.64, make connection pool activated by default
42-
self.keep_alive = True
43-
44-
self.add_user_agent('azure-mgmt-rdbms/{}'.format(VERSION))
45-
self.add_user_agent('Azure-SDK-For-Python')
46-
47-
self.credentials = credentials
48+
self.credential = credential
4849
self.subscription_id = subscription_id
50+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
51+
kwargs.setdefault('sdk_moniker', 'mgmt-rdbms/{}'.format(VERSION))
52+
self._configure(**kwargs)
53+
54+
def _configure(
55+
self,
56+
**kwargs # type: Any
57+
):
58+
# type: (...) -> None
59+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
60+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
61+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
62+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
63+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
64+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
65+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
66+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
67+
self.authentication_policy = kwargs.get('authentication_policy')
68+
if self.credential and not self.authentication_policy:
69+
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)

0 commit comments

Comments
 (0)