Skip to content

Commit c032c0c

Browse files
00Kai0SDKAuto
and
SDKAuto
authored
T2 privatedns 2021 02 09 (#16627)
* CodeGen from PR 12832 in Azure/azure-rest-api-specs add python track2 config for privatedns (#12832) * test,version,CHANGELOG * fix changelog and version Co-authored-by: SDKAuto <[email protected]>
1 parent 2d1b47c commit c032c0c

Some content is hidden

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

62 files changed

+5629
-3355
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Release History
22

3+
## 1.0.0b1 (2021-02-09)
4+
5+
This is beta preview version.
6+
For detailed changelog please refer to equivalent stable version 10.2.0 (https://pypi.org/project/azure-mgmt-network/10.2.0/)
7+
8+
This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming).
9+
10+
**General breaking changes**
11+
12+
- Credential system has been completly revamped:
13+
14+
- `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/
15+
- `credentials` parameter has been renamed `credential`
16+
17+
- 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
18+
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)
19+
- You can't import a `version` module anymore, use `__version__` instead
20+
- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`.
21+
- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed).
22+
- Most of the operation kwarg have changed. Some of the most noticeable:
23+
24+
- `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user
25+
- For a complete set of
26+
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)
27+
28+
**General new features**
29+
30+
- Type annotations support using `typing`. SDKs are mypy ready.
31+
- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client.
32+
- 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.
33+
34+
335
## 0.1.0 (2019-02-26)
436

537
- Initial Release

sdk/network/azure-mgmt-privatedns/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ library.
1414
For a more complete set of Azure libraries, see the
1515
[azure sdk python release](https://aka.ms/azsdk/python/all).
1616

17-
## Usage
17+
# Usage
1818

19-
For code examples, see [DNS Private
20-
Zones](https://docs.microsoft.com/python/api/overview/azure/) on
21-
docs.microsoft.com.
2219

20+
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
21+
22+
23+
24+
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
25+
Code samples for this package can be found at [Privatedns Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
26+
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
2327
## Provide Feedback
2428

2529
If you encounter any bugs or have suggestions, please file an issue in
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +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
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 .private_dns_management_client import PrivateDnsManagementClient
13-
from .version import VERSION
14-
15-
__all__ = ['PrivateDnsManagementClient']
9+
from ._private_dns_management_client import PrivateDnsManagementClient
10+
from ._version import VERSION
1611

1712
__version__ = VERSION
13+
__all__ = ['PrivateDnsManagementClient']
1814

15+
try:
16+
from ._patch import patch_sdk # type: ignore
17+
patch_sdk()
18+
except ImportError:
19+
pass
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import TYPE_CHECKING
10+
11+
from azure.core.configuration import Configuration
12+
from azure.core.pipeline import policies
13+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
15+
from ._version import VERSION
16+
17+
if TYPE_CHECKING:
18+
# pylint: disable=unused-import,ungrouped-imports
19+
from typing import Any
20+
21+
from azure.core.credentials import TokenCredential
22+
23+
24+
class PrivateDnsManagementClientConfiguration(Configuration):
25+
"""Configuration for PrivateDnsManagementClient.
26+
27+
Note that all parameters used to create this instance are saved as instance
28+
attributes.
29+
30+
:param credential: Credential needed for the client to connect to Azure.
31+
:type credential: ~azure.core.credentials.TokenCredential
32+
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
33+
:type subscription_id: str
34+
"""
35+
36+
def __init__(
37+
self,
38+
credential, # type: "TokenCredential"
39+
subscription_id, # type: str
40+
**kwargs # type: Any
41+
):
42+
# type: (...) -> None
43+
if credential is None:
44+
raise ValueError("Parameter 'credential' must not be None.")
45+
if subscription_id is None:
46+
raise ValueError("Parameter 'subscription_id' must not be None.")
47+
super(PrivateDnsManagementClientConfiguration, self).__init__(**kwargs)
48+
49+
self.credential = credential
50+
self.subscription_id = subscription_id
51+
self.api_version = "2018-09-01"
52+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53+
kwargs.setdefault('sdk_moniker', 'mgmt-privatedns/{}'.format(VERSION))
54+
self._configure(**kwargs)
55+
56+
def _configure(
57+
self,
58+
**kwargs # type: Any
59+
):
60+
# type: (...) -> None
61+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
62+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
63+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
64+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
66+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
67+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
68+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
69+
self.authentication_policy = kwargs.get('authentication_policy')
70+
if self.credential and not self.authentication_policy:
71+
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"chosen_version": "2018-09-01",
3+
"total_api_version_list": ["2018-09-01"],
4+
"client": {
5+
"name": "PrivateDnsManagementClient",
6+
"filename": "_private_dns_management_client",
7+
"description": "The Private DNS Management Client.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true,
12+
"client_side_validation": true
13+
},
14+
"global_parameters": {
15+
"sync": {
16+
"credential": {
17+
"signature": "credential, # type: \"TokenCredential\"",
18+
"description": "Credential needed for the client to connect to Azure.",
19+
"docstring_type": "~azure.core.credentials.TokenCredential",
20+
"required": true
21+
},
22+
"subscription_id": {
23+
"signature": "subscription_id, # type: str",
24+
"description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
25+
"docstring_type": "str",
26+
"required": true
27+
}
28+
},
29+
"async": {
30+
"credential": {
31+
"signature": "credential, # type: \"AsyncTokenCredential\"",
32+
"description": "Credential needed for the client to connect to Azure.",
33+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
34+
"required": true
35+
},
36+
"subscription_id": {
37+
"signature": "subscription_id, # type: str",
38+
"description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
39+
"docstring_type": "str",
40+
"required": true
41+
}
42+
},
43+
"constant": {
44+
},
45+
"call": "credential, subscription_id"
46+
},
47+
"config": {
48+
"credential": true,
49+
"credential_scopes": ["https://management.azure.com/.default"],
50+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
51+
"credential_default_policy_type_has_async_version": true,
52+
"credential_key_header_name": null
53+
},
54+
"operation_groups": {
55+
"private_zones": "PrivateZonesOperations",
56+
"virtual_network_links": "VirtualNetworkLinksOperations",
57+
"record_sets": "RecordSetsOperations"
58+
},
59+
"operation_mixins": {
60+
},
61+
"sync_imports": "None",
62+
"async_imports": "None"
63+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import TYPE_CHECKING
10+
11+
from azure.mgmt.core import ARMPipelineClient
12+
from msrest import Deserializer, Serializer
13+
14+
if TYPE_CHECKING:
15+
# pylint: disable=unused-import,ungrouped-imports
16+
from typing import Any, Optional
17+
18+
from azure.core.credentials import TokenCredential
19+
20+
from ._configuration import PrivateDnsManagementClientConfiguration
21+
from .operations import PrivateZonesOperations
22+
from .operations import VirtualNetworkLinksOperations
23+
from .operations import RecordSetsOperations
24+
from . import models
25+
26+
27+
class PrivateDnsManagementClient(object):
28+
"""The Private DNS Management Client.
29+
30+
:ivar private_zones: PrivateZonesOperations operations
31+
:vartype private_zones: azure.mgmt.privatedns.operations.PrivateZonesOperations
32+
:ivar virtual_network_links: VirtualNetworkLinksOperations operations
33+
:vartype virtual_network_links: azure.mgmt.privatedns.operations.VirtualNetworkLinksOperations
34+
:ivar record_sets: RecordSetsOperations operations
35+
:vartype record_sets: azure.mgmt.privatedns.operations.RecordSetsOperations
36+
:param credential: Credential needed for the client to connect to Azure.
37+
:type credential: ~azure.core.credentials.TokenCredential
38+
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
39+
:type subscription_id: str
40+
:param str base_url: Service URL
41+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
42+
"""
43+
44+
def __init__(
45+
self,
46+
credential, # type: "TokenCredential"
47+
subscription_id, # type: str
48+
base_url=None, # type: Optional[str]
49+
**kwargs # type: Any
50+
):
51+
# type: (...) -> None
52+
if not base_url:
53+
base_url = 'https://management.azure.com'
54+
self._config = PrivateDnsManagementClientConfiguration(credential, subscription_id, **kwargs)
55+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
56+
57+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
58+
self._serialize = Serializer(client_models)
59+
self._deserialize = Deserializer(client_models)
60+
61+
self.private_zones = PrivateZonesOperations(
62+
self._client, self._config, self._serialize, self._deserialize)
63+
self.virtual_network_links = VirtualNetworkLinksOperations(
64+
self._client, self._config, self._serialize, self._deserialize)
65+
self.record_sets = RecordSetsOperations(
66+
self._client, self._config, self._serialize, self._deserialize)
67+
68+
def close(self):
69+
# type: () -> None
70+
self._client.close()
71+
72+
def __enter__(self):
73+
# type: () -> PrivateDnsManagementClient
74+
self._client.__enter__()
75+
return self
76+
77+
def __exit__(self, *exc_details):
78+
# type: (Any) -> None
79+
self._client.__exit__(*exc_details)
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
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-
VERSION = "0.1.0"
13-
9+
VERSION = "1.0.0b1"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from ._private_dns_management_client import PrivateDnsManagementClient
10+
__all__ = ['PrivateDnsManagementClient']

0 commit comments

Comments
 (0)