Skip to content

Commit 1e45362

Browse files
Zim Kalinowski00Kai0
Zim Kalinowski
andauthored
[T2] network - preview.7 (#11489)
* updated t2 network * fix test * regenerated network * regenerated network except networkwatcher * entirely disabled networkwatcher * missing network tests * missing firewall policy * fix connection monitor tests (#11526) * fixed is_live * mistake * 5.0.1-preview.1 * [T2 aiotest] network (#11729) * add aio test * enable network watcher test * add .result for async poller (#11753) * aiohttp * fix test * add random group name (#11912) * changelog and version * fix changelog Co-authored-by: Kerwin Sun <[email protected]>
1 parent 36f2cea commit 1e45362

File tree

3,852 files changed

+1780590
-684988
lines changed

Some content is hidden

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

3,852 files changed

+1780590
-684988
lines changed

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

+31-17
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
11
# Release History
22

3-
## 10.2.0 (2020-04-10)
4-
5-
**Features**
6-
7-
- Model VpnConnection has a new parameter routing_configuration
8-
- Model NatRuleCondition has a new parameter terminate_tls
9-
- Model HubVirtualNetworkConnection has a new parameter routing_configuration
10-
- Model ExpressRouteConnection has a new parameter routing_configuration
11-
- Model FirewallPolicy has a new parameter transport_security
12-
- Model FirewallPolicy has a new parameter identity
13-
- Model FirewallPolicy has a new parameter threat_intel_whitelist
14-
- Model ApplicationRuleCondition has a new parameter target_urls
15-
- Model P2SConnectionConfiguration has a new parameter routing_configuration
16-
- Model BackendAddressPool has a new parameter load_balancer_backend_addresses
17-
- Added operation LoadBalancerBackendAddressPoolsOperations.create_or_update
18-
- Added operation LoadBalancerBackendAddressPoolsOperations.delete
19-
- Added operation group HubRouteTablesOperations
3+
## 15.0.0b1 (2020-06-17)
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+
2034

2135
## 10.1.0 (2020-04-10)
2236

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 NetworkManagementClientConfiguration
139
from ._network_management_client import NetworkManagementClient
14-
__all__ = ['NetworkManagementClient', 'NetworkManagementClientConfiguration']
15-
16-
from .version import VERSION
17-
18-
__version__ = VERSION
10+
__all__ = ['NetworkManagementClient']
1911

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

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

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

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

16+
from ._version import VERSION
17+
18+
19+
class NetworkManagementClientConfiguration(Configuration):
20+
"""Configuration for NetworkManagementClient.
1521
16-
class NetworkManagementClientConfiguration(AzureConfiguration):
17-
"""Configuration for NetworkManagementClient
1822
Note that all parameters used to create this instance are saved as instance
1923
attributes.
2024
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: The subscription credentials which uniquely
25-
identify the Microsoft Azure subscription. The subscription ID forms part
26-
of the URI for every service call.
25+
:param credential: Credential needed for the client to connect to Azure.
26+
:type credential: ~azure.core.credentials.TokenCredential
27+
:param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
2728
:type subscription_id: str
28-
:param str base_url: Service URL
2929
"""
3030

3131
def __init__(
32-
self, credentials, subscription_id, base_url=None):
33-
34-
if credentials is None:
35-
raise ValueError("Parameter 'credentials' must not be None.")
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.")
3640
if subscription_id is None:
3741
raise ValueError("Parameter 'subscription_id' must not be None.")
38-
if not base_url:
39-
base_url = 'https://management.azure.com'
40-
41-
super(NetworkManagementClientConfiguration, self).__init__(base_url)
42+
super(NetworkManagementClientConfiguration, self).__init__(**kwargs)
4243

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-network/{}'.format(VERSION))
47-
self.add_user_agent('Azure-SDK-For-Python')
48-
49-
self.credentials = credentials
44+
self.credential = credential
5045
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-network/{}'.format(VERSION))
49+
self._configure(**kwargs)
50+
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)

0 commit comments

Comments
 (0)