Skip to content

Commit 72caecf

Browse files
author
SDKAuto
committed
CodeGen from PR 18432 in Azure/azure-rest-api-specs
Merge 134bcd88a321a91e729f31426a76b492df234637 into c5c5e1d0c31a0ceccda42505d6e872ff303d1c80
1 parent 77a1aba commit 72caecf

File tree

5,122 files changed

+1323751
-1399769
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,122 files changed

+1323751
-1399769
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": "e4b39b7542239e87b0282c859b247ed7c7306a71",
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-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --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: 43 additions & 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):
@@ -78,6 +77,9 @@ class NetworkManagementClient(NetworkManagementClientOperationsMixin, MultiApiCl
7877
'network_manager_effective_security_admin_rules': '2021-02-01-preview',
7978
'network_managers': '2021-02-01-preview',
8079
'network_security_perimeters': '2021-02-01-preview',
80+
'nsp_access_rules': '2021-02-01-preview',
81+
'nsp_associations': '2021-02-01-preview',
82+
'nsp_profiles': '2021-02-01-preview',
8183
'p2_svpn_server_configurations': '2019-07-01',
8284
'perimeter_associable_resource_types': '2021-02-01-preview',
8385
'security_admin_configurations': '2021-02-01-preview',
@@ -93,12 +95,10 @@ def __init__(
9395
credential, # type: "TokenCredential"
9496
subscription_id, # type: str
9597
api_version=None, # type: Optional[str]
96-
base_url=None, # type: Optional[str]
98+
base_url="https://management.azure.com", # type: str
9799
profile=KnownProfiles.default, # type: KnownProfiles
98100
**kwargs # type: Any
99101
):
100-
if not base_url:
101-
base_url = 'https://management.azure.com'
102102
self._config = NetworkManagementClientConfiguration(credential, subscription_id, **kwargs)
103103
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
104104
super(NetworkManagementClient, self).__init__(
@@ -4862,6 +4862,45 @@ def network_watchers(self):
48624862
raise ValueError("API version {} does not have operation group 'network_watchers'".format(api_version))
48634863
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
48644864

4865+
@property
4866+
def nsp_access_rules(self):
4867+
"""Instance depends on the API version:
4868+
4869+
* 2021-02-01-preview: :class:`NspAccessRulesOperations<azure.mgmt.network.v2021_02_01_preview.operations.NspAccessRulesOperations>`
4870+
"""
4871+
api_version = self._get_api_version('nsp_access_rules')
4872+
if api_version == '2021-02-01-preview':
4873+
from .v2021_02_01_preview.operations import NspAccessRulesOperations as OperationClass
4874+
else:
4875+
raise ValueError("API version {} does not have operation group 'nsp_access_rules'".format(api_version))
4876+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
4877+
4878+
@property
4879+
def nsp_associations(self):
4880+
"""Instance depends on the API version:
4881+
4882+
* 2021-02-01-preview: :class:`NspAssociationsOperations<azure.mgmt.network.v2021_02_01_preview.operations.NspAssociationsOperations>`
4883+
"""
4884+
api_version = self._get_api_version('nsp_associations')
4885+
if api_version == '2021-02-01-preview':
4886+
from .v2021_02_01_preview.operations import NspAssociationsOperations as OperationClass
4887+
else:
4888+
raise ValueError("API version {} does not have operation group 'nsp_associations'".format(api_version))
4889+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
4890+
4891+
@property
4892+
def nsp_profiles(self):
4893+
"""Instance depends on the API version:
4894+
4895+
* 2021-02-01-preview: :class:`NspProfilesOperations<azure.mgmt.network.v2021_02_01_preview.operations.NspProfilesOperations>`
4896+
"""
4897+
api_version = self._get_api_version('nsp_profiles')
4898+
if api_version == '2021-02-01-preview':
4899+
from .v2021_02_01_preview.operations import NspProfilesOperations as OperationClass
4900+
else:
4901+
raise ValueError("API version {} does not have operation group 'nsp_profiles'".format(api_version))
4902+
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
4903+
48654904
@property
48664905
def operations(self):
48674906
"""Instance depends on the API version:

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)

0 commit comments

Comments
 (0)