Skip to content

Commit 77875ed

Browse files
author
SDKAuto
committed
CodeGen from PR 18338 in Azure/azure-rest-api-specs
Merge c1ea9b46d9f7349a8ebd73a9766e71b429a1cd9a into 2fbe5679bf51f8c2d0585525f6fdf89ce5f9ef83
1 parent 005b707 commit 77875ed

File tree

5,114 files changed

+1320574
-1399728
lines changed

Some content is hidden

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

5,114 files changed

+1320574
-1399728
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.5",
2+
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.8.4",
5-
"@autorest/[email protected].2"
4+
"@autorest/python@5.12.0",
5+
"@autorest/[email protected].3"
66
],
7-
"commit": "200370117556209695877b7631afa7d6c100c356",
7+
"commit": "06b62b9488930a0228c4b0e8430e611209a589b5",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/network/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/[email protected].2 --version=3.4.5",
9+
"autorest_command": "autorest specification/network/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected].3 --version=3.7.2",
1010
"readme": "specification/network/resource-manager/readme.md"
1111
}

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

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

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
15+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1616

1717
from ._version import VERSION
1818

@@ -68,4 +68,4 @@ def _configure(
6868
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6969
self.authentication_policy = kwargs.get('authentication_policy')
7070
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
71+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from typing import Any, Optional
2525

2626
from azure.core.credentials import TokenCredential
27-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
2827

2928
class _SDKClient(object):
3029
def __init__(self, *args, **kwargs):
@@ -93,12 +92,10 @@ def __init__(
9392
credential, # type: "TokenCredential"
9493
subscription_id, # type: str
9594
api_version=None, # type: Optional[str]
96-
base_url=None, # type: Optional[str]
95+
base_url="https://management.azure.com", # type: str
9796
profile=KnownProfiles.default, # type: KnownProfiles
9897
**kwargs # type: Any
9998
):
100-
if not base_url:
101-
base_url = 'https://management.azure.com'
10299
self._config = NetworkManagementClientConfiguration(credential, subscription_id, **kwargs)
103100
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
104101
super(NetworkManagementClient, self).__init__(

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

Lines changed: 56 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,13 @@
1010
# --------------------------------------------------------------------------
1111
from msrest import Serializer, Deserializer
1212
from typing import TYPE_CHECKING
13-
import warnings
14-
15-
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
16-
from azure.core.paging import ItemPaged
17-
from azure.core.pipeline import PipelineResponse
18-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
19-
from azure.core.polling import LROPoller, NoPolling, PollingMethod
20-
from azure.mgmt.core.exceptions import ARMErrorFormat
21-
from azure.mgmt.core.polling.arm_polling import ARMPolling
2213

2314
if TYPE_CHECKING:
2415
# pylint: disable=unused-import,ungrouped-imports
25-
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
16+
from typing import Any, Iterable, Optional
17+
18+
from azure.core.paging import ItemPaged
19+
from azure.core.polling import LROPoller
2620

2721

2822
class NetworkManagementClientOperationsMixin(object):
@@ -34,6 +28,7 @@ def begin_delete_bastion_shareable_link(
3428
bsl_request, # type: "_models.BastionShareableLinkListRequest"
3529
**kwargs # type: Any
3630
):
31+
# type: (...) -> LROPoller[None]
3732
"""Deletes the Bastion Shareable Links for all the VMs specified in the request.
3833
3934
:param resource_group_name: The name of the resource group.
@@ -44,13 +39,15 @@ def begin_delete_bastion_shareable_link(
4439
:type bsl_request: ~azure.mgmt.network.v2021_05_01.models.BastionShareableLinkListRequest
4540
:keyword callable cls: A custom type or function that will be passed the direct response
4641
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
47-
:keyword polling: By default, your polling method will be ARMPolling.
48-
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
42+
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
43+
operation to not poll, or pass in your own initialized polling object for a personal polling
44+
strategy.
4945
:paramtype polling: bool or ~azure.core.polling.PollingMethod
50-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
46+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
47+
Retry-After header is present.
5148
:return: An instance of LROPoller that returns either None or the result of cls(response)
5249
:rtype: ~azure.core.polling.LROPoller[None]
53-
:raises ~azure.core.exceptions.HttpResponseError:
50+
:raises: ~azure.core.exceptions.HttpResponseError
5451
"""
5552
api_version = self._get_api_version('begin_delete_bastion_shareable_link')
5653
if api_version == '2019-09-01':
@@ -94,6 +91,7 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile(
9491
vpn_client_params, # type: "_models.VirtualWanVpnProfileParameters"
9592
**kwargs # type: Any
9693
):
94+
# type: (...) -> LROPoller["_models.VpnProfileResponse"]
9795
"""Generates a unique VPN profile for P2S clients for VirtualWan and associated
9896
VpnServerConfiguration combination in the specified resource group.
9997
@@ -107,13 +105,17 @@ def begin_generatevirtualwanvpnserverconfigurationvpnprofile(
107105
:type vpn_client_params: ~azure.mgmt.network.v2021_05_01.models.VirtualWanVpnProfileParameters
108106
:keyword callable cls: A custom type or function that will be passed the direct response
109107
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
110-
:keyword polling: By default, your polling method will be ARMPolling.
111-
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
108+
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
109+
operation to not poll, or pass in your own initialized polling object for a personal polling
110+
strategy.
112111
:paramtype polling: bool or ~azure.core.polling.PollingMethod
113-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
114-
:return: An instance of LROPoller that returns either VpnProfileResponse or the result of cls(response)
115-
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2021_05_01.models.VpnProfileResponse]
116-
:raises ~azure.core.exceptions.HttpResponseError:
112+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
113+
Retry-After header is present.
114+
:return: An instance of LROPoller that returns either VpnProfileResponse or the result of
115+
cls(response)
116+
:rtype:
117+
~azure.core.polling.LROPoller[~azure.mgmt.network.v2021_05_01.models.VpnProfileResponse]
118+
:raises: ~azure.core.exceptions.HttpResponseError
117119
"""
118120
api_version = self._get_api_version('begin_generatevirtualwanvpnserverconfigurationvpnprofile')
119121
if api_version == '2019-08-01':
@@ -158,6 +160,7 @@ def begin_get_active_sessions(
158160
bastion_host_name, # type: str
159161
**kwargs # type: Any
160162
):
163+
# type: (...) -> LROPoller[ItemPaged["_models.BastionActiveSessionListResult"]]
161164
"""Returns the list of currently active sessions on the Bastion.
162165
163166
:param resource_group_name: The name of the resource group.
@@ -166,13 +169,17 @@ def begin_get_active_sessions(
166169
:type bastion_host_name: str
167170
:keyword callable cls: A custom type or function that will be passed the direct response
168171
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
169-
:keyword polling: By default, your polling method will be ARMPolling.
170-
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
172+
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
173+
operation to not poll, or pass in your own initialized polling object for a personal polling
174+
strategy.
171175
:paramtype polling: bool or ~azure.core.polling.PollingMethod
172-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
173-
:return: An instance of LROPoller that returns an iterator like instance of either BastionActiveSessionListResult or the result of cls(response)
174-
:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2021_05_01.models.BastionActiveSessionListResult]]
175-
:raises ~azure.core.exceptions.HttpResponseError:
176+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
177+
Retry-After header is present.
178+
:return: An instance of LROPoller that returns an iterator like instance of either
179+
BastionActiveSessionListResult or the result of cls(response)
180+
:rtype:
181+
~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2021_05_01.models.BastionActiveSessionListResult]]
182+
:raises: ~azure.core.exceptions.HttpResponseError
176183
"""
177184
api_version = self._get_api_version('begin_get_active_sessions')
178185
if api_version == '2019-09-01':
@@ -216,6 +223,7 @@ def begin_put_bastion_shareable_link(
216223
bsl_request, # type: "_models.BastionShareableLinkListRequest"
217224
**kwargs # type: Any
218225
):
226+
# type: (...) -> LROPoller[ItemPaged["_models.BastionShareableLinkListResult"]]
219227
"""Creates a Bastion Shareable Links for all the VMs specified in the request.
220228
221229
:param resource_group_name: The name of the resource group.
@@ -226,13 +234,17 @@ def begin_put_bastion_shareable_link(
226234
:type bsl_request: ~azure.mgmt.network.v2021_05_01.models.BastionShareableLinkListRequest
227235
:keyword callable cls: A custom type or function that will be passed the direct response
228236
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
229-
:keyword polling: By default, your polling method will be ARMPolling.
230-
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
237+
:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
238+
operation to not poll, or pass in your own initialized polling object for a personal polling
239+
strategy.
231240
:paramtype polling: bool or ~azure.core.polling.PollingMethod
232-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
233-
:return: An instance of LROPoller that returns an iterator like instance of either BastionShareableLinkListResult or the result of cls(response)
234-
:rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2021_05_01.models.BastionShareableLinkListResult]]
235-
:raises ~azure.core.exceptions.HttpResponseError:
241+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
242+
Retry-After header is present.
243+
:return: An instance of LROPoller that returns an iterator like instance of either
244+
BastionShareableLinkListResult or the result of cls(response)
245+
:rtype:
246+
~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.network.v2021_05_01.models.BastionShareableLinkListResult]]
247+
:raises: ~azure.core.exceptions.HttpResponseError
236248
"""
237249
api_version = self._get_api_version('begin_put_bastion_shareable_link')
238250
if api_version == '2019-09-01':
@@ -275,6 +287,7 @@ def check_dns_name_availability(
275287
domain_name_label, # type: str
276288
**kwargs # type: Any
277289
):
290+
# type: (...) -> "_models.DnsNameAvailabilityResult"
278291
"""Checks whether a domain name in the cloudapp.azure.com zone is available for use.
279292
280293
:param location: The location of the domain name.
@@ -369,6 +382,7 @@ def disconnect_active_sessions(
369382
session_ids, # type: "_models.SessionIds"
370383
**kwargs # type: Any
371384
):
385+
# type: (...) -> Iterable["_models.BastionSessionDeleteResult"]
372386
"""Returns the list of currently active sessions on the Bastion.
373387
374388
:param resource_group_name: The name of the resource group.
@@ -378,8 +392,10 @@ def disconnect_active_sessions(
378392
:param session_ids: The list of sessionids to disconnect.
379393
:type session_ids: ~azure.mgmt.network.v2021_05_01.models.SessionIds
380394
:keyword callable cls: A custom type or function that will be passed the direct response
381-
:return: An iterator like instance of either BastionSessionDeleteResult or the result of cls(response)
382-
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2021_05_01.models.BastionSessionDeleteResult]
395+
:return: An iterator like instance of either BastionSessionDeleteResult or the result of
396+
cls(response)
397+
:rtype:
398+
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2021_05_01.models.BastionSessionDeleteResult]
383399
:raises: ~azure.core.exceptions.HttpResponseError
384400
"""
385401
api_version = self._get_api_version('disconnect_active_sessions')
@@ -424,6 +440,7 @@ def get_bastion_shareable_link(
424440
bsl_request, # type: "_models.BastionShareableLinkListRequest"
425441
**kwargs # type: Any
426442
):
443+
# type: (...) -> Iterable["_models.BastionShareableLinkListResult"]
427444
"""Return the Bastion Shareable Links for all the VMs specified in the request.
428445
429446
:param resource_group_name: The name of the resource group.
@@ -433,8 +450,10 @@ def get_bastion_shareable_link(
433450
:param bsl_request: Post request for all the Bastion Shareable Link endpoints.
434451
:type bsl_request: ~azure.mgmt.network.v2021_05_01.models.BastionShareableLinkListRequest
435452
:keyword callable cls: A custom type or function that will be passed the direct response
436-
:return: An iterator like instance of either BastionShareableLinkListResult or the result of cls(response)
437-
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2021_05_01.models.BastionShareableLinkListResult]
453+
:return: An iterator like instance of either BastionShareableLinkListResult or the result of
454+
cls(response)
455+
:rtype:
456+
~azure.core.paging.ItemPaged[~azure.mgmt.network.v2021_05_01.models.BastionShareableLinkListResult]
438457
:raises: ~azure.core.exceptions.HttpResponseError
439458
"""
440459
api_version = self._get_api_version('get_bastion_shareable_link')
@@ -478,6 +497,7 @@ def supported_security_providers(
478497
virtual_wan_name, # type: str
479498
**kwargs # type: Any
480499
):
500+
# type: (...) -> "_models.VirtualWanSecurityProviders"
481501
"""Gives the supported security providers for the virtual wan.
482502
483503
:param resource_group_name: The resource group name.

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

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

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
15+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
1616

1717
from .._version import VERSION
1818

@@ -64,4 +64,4 @@ def _configure(
6464
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
6565
self.authentication_policy = kwargs.get('authentication_policy')
6666
if self.credential and not self.authentication_policy:
67-
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
67+
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
from typing import Any, Optional, TYPE_CHECKING
1313

14-
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1514
from azure.mgmt.core import AsyncARMPipelineClient
1615
from azure.profiles import KnownProfiles, ProfileDefinition
1716
from azure.profiles.multiapiclient import MultiApiClientMixin
@@ -22,6 +21,7 @@
2221

2322
if TYPE_CHECKING:
2423
# pylint: disable=unused-import,ungrouped-imports
24+
from azure.core.credentials import TokenCredential
2525
from azure.core.credentials_async import AsyncTokenCredential
2626

2727
class _SDKClient(object):
@@ -91,12 +91,10 @@ def __init__(
9191
credential: "AsyncTokenCredential",
9292
subscription_id: str,
9393
api_version: Optional[str] = None,
94-
base_url: Optional[str] = None,
94+
base_url: str = "https://management.azure.com",
9595
profile: KnownProfiles = KnownProfiles.default,
9696
**kwargs # type: Any
9797
) -> None:
98-
if not base_url:
99-
base_url = 'https://management.azure.com'
10098
self._config = NetworkManagementClientConfiguration(credential, subscription_id, **kwargs)
10199
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
102100
super(NetworkManagementClient, self).__init__(

0 commit comments

Comments
 (0)