Skip to content

Commit ecddd3e

Browse files
author
SDKAuto
committed
CodeGen from PR 34058 in Azure/azure-rest-api-specs
Merge a12050ce42024abb6e475276cb3b919b4ac80ba2 into abe6b63e998a3995d1c28d2a1f8c0a6950a79b72
1 parent 1100a73 commit ecddd3e

File tree

815 files changed

+4029
-2930
lines changed

Some content is hidden

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

815 files changed

+4029
-2930
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Network Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "065bac6153f6a83de668f55803270bc6f31f5bc3",
2+
"commit": "19a4e9df37d13908634d8f92746fe4eb38962aa3",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.19.0",
6+
"@autorest/python@6.33.0",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/network/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/network/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.33.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/network/resource-manager/readme.md"
1111
}

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
# --------------------------------------------------------------------------
99

1010
from copy import deepcopy
11-
from typing import Any, TYPE_CHECKING
11+
from typing import Any, Optional, TYPE_CHECKING, cast
1212
from typing_extensions import Self
1313

1414
from azure.core.pipeline import policies
1515
from azure.core.rest import HttpRequest, HttpResponse
16+
from azure.core.settings import settings
1617
from azure.mgmt.core import ARMPipelineClient
1718
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
19+
from azure.mgmt.core.tools import get_arm_endpoints
1820

1921
from . import models as _models
2022
from ._configuration import NetworkManagementClientConfiguration
@@ -565,22 +567,24 @@ class NetworkManagementClient(
565567
:param subscription_id: The subscription credentials which uniquely identify the Microsoft
566568
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
567569
:type subscription_id: str
568-
:param base_url: Service URL. Default value is "https://management.azure.com".
570+
:param base_url: Service URL. Default value is None.
569571
:type base_url: str
570572
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
571573
Retry-After header is present.
572574
"""
573575

574576
def __init__(
575-
self,
576-
credential: "TokenCredential",
577-
subscription_id: str,
578-
base_url: str = "https://management.azure.com",
579-
**kwargs: Any
577+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
580578
) -> None:
579+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
580+
_endpoints = get_arm_endpoints(_cloud)
581+
if not base_url:
582+
base_url = _endpoints["resource_manager"]
583+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
581584
self._config = NetworkManagementClientConfiguration(
582-
credential=credential, subscription_id=subscription_id, **kwargs
585+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
583586
)
587+
584588
_policies = kwargs.pop("policies", None)
585589
if _policies is None:
586590
_policies = [
@@ -599,7 +603,7 @@ def __init__(
599603
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
600604
self._config.http_logging_policy,
601605
]
602-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
606+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
603607

604608
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
605609
self._serialize = Serializer(client_models)

0 commit comments

Comments
 (0)