Skip to content

Commit c1f0cec

Browse files
authored
Fix network issue (Azure#30075)
* update * update * review
1 parent 5a50010 commit c1f0cec

File tree

5 files changed

+293
-1
lines changed

5 files changed

+293
-1
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 23.0.1 (2023-04-26)
4+
5+
### Bugs Fixed
6+
7+
- Fix calling failure for those operations which could be called by client directly #30057
8+
39
## 23.0.0 (2023-03-29)
410

511
### Other Changes

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ def __init__(
261261
api_version=api_version,
262262
profile=profile
263263
)
264+
self._serialize = Serializer(self._models_dict())
265+
self._deserialize = Deserializer(self._models_dict())
266+
self._serialize.client_side_validation = False
264267

265268

266269

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "23.0.0"
9+
VERSION = "23.0.1"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration",
5+
"RequestMethod": "GET",
6+
"RequestHeaders": {
7+
"Accept": "*/*",
8+
"Accept-Encoding": "gzip, deflate",
9+
"Connection": "keep-alive",
10+
"User-Agent": "azsdk-python-identity/1.13.0b3 Python/3.8.9 (Windows-10-10.0.23435-SP0)"
11+
},
12+
"RequestBody": null,
13+
"StatusCode": 200,
14+
"ResponseHeaders": {
15+
"Access-Control-Allow-Methods": "GET, OPTIONS",
16+
"Access-Control-Allow-Origin": "*",
17+
"Cache-Control": "max-age=86400, private",
18+
"Content-Length": "1753",
19+
"Content-Type": "application/json; charset=utf-8",
20+
"Date": "Wed, 26 Apr 2023 07:24:33 GMT",
21+
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
22+
"Set-Cookie": "[set-cookie;]",
23+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
24+
"X-Content-Type-Options": "nosniff",
25+
"x-ms-ests-server": "2.1.15256.7 - SEASLR1 ProdSlices",
26+
"X-XSS-Protection": "0"
27+
},
28+
"ResponseBody": {
29+
"token_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token",
30+
"token_endpoint_auth_methods_supported": [
31+
"client_secret_post",
32+
"private_key_jwt",
33+
"client_secret_basic"
34+
],
35+
"jwks_uri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/discovery/v2.0/keys",
36+
"response_modes_supported": [
37+
"query",
38+
"fragment",
39+
"form_post"
40+
],
41+
"subject_types_supported": [
42+
"pairwise"
43+
],
44+
"id_token_signing_alg_values_supported": [
45+
"RS256"
46+
],
47+
"response_types_supported": [
48+
"code",
49+
"id_token",
50+
"code id_token",
51+
"id_token token"
52+
],
53+
"scopes_supported": [
54+
"openid",
55+
"profile",
56+
"email",
57+
"offline_access"
58+
],
59+
"issuer": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0",
60+
"request_uri_parameter_supported": false,
61+
"userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo",
62+
"authorization_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/authorize",
63+
"device_authorization_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/devicecode",
64+
"http_logout_supported": true,
65+
"frontchannel_logout_supported": true,
66+
"end_session_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/logout",
67+
"claims_supported": [
68+
"sub",
69+
"iss",
70+
"cloud_instance_name",
71+
"cloud_instance_host_name",
72+
"cloud_graph_host_name",
73+
"msgraph_host",
74+
"aud",
75+
"exp",
76+
"iat",
77+
"auth_time",
78+
"acr",
79+
"nonce",
80+
"preferred_username",
81+
"name",
82+
"tid",
83+
"ver",
84+
"at_hash",
85+
"c_hash",
86+
"email"
87+
],
88+
"kerberos_endpoint": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/kerberos",
89+
"tenant_region_scope": "WW",
90+
"cloud_instance_name": "microsoftonline.com",
91+
"cloud_graph_host_name": "graph.windows.net",
92+
"msgraph_host": "graph.microsoft.com",
93+
"rbac_url": "https://pas.windows.net"
94+
}
95+
},
96+
{
97+
"RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize",
98+
"RequestMethod": "GET",
99+
"RequestHeaders": {
100+
"Accept": "application/json",
101+
"Accept-Encoding": "gzip, deflate",
102+
"Connection": "keep-alive",
103+
"Cookie": "cookie;",
104+
"User-Agent": "azsdk-python-identity/1.13.0b3 Python/3.8.9 (Windows-10-10.0.23435-SP0)"
105+
},
106+
"RequestBody": null,
107+
"StatusCode": 200,
108+
"ResponseHeaders": {
109+
"Access-Control-Allow-Methods": "GET, OPTIONS",
110+
"Access-Control-Allow-Origin": "*",
111+
"Cache-Control": "max-age=86400, private",
112+
"Content-Length": "945",
113+
"Content-Type": "application/json; charset=utf-8",
114+
"Date": "Wed, 26 Apr 2023 07:24:33 GMT",
115+
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
116+
"Set-Cookie": "[set-cookie;]",
117+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
118+
"X-Content-Type-Options": "nosniff",
119+
"x-ms-ests-server": "2.1.15256.7 - SEASLR2 ProdSlices",
120+
"X-XSS-Protection": "0"
121+
},
122+
"ResponseBody": {
123+
"tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration",
124+
"api-version": "1.1",
125+
"metadata": [
126+
{
127+
"preferred_network": "login.microsoftonline.com",
128+
"preferred_cache": "login.windows.net",
129+
"aliases": [
130+
"login.microsoftonline.com",
131+
"login.windows.net",
132+
"login.microsoft.com",
133+
"sts.windows.net"
134+
]
135+
},
136+
{
137+
"preferred_network": "login.partner.microsoftonline.cn",
138+
"preferred_cache": "login.partner.microsoftonline.cn",
139+
"aliases": [
140+
"login.partner.microsoftonline.cn",
141+
"login.chinacloudapi.cn"
142+
]
143+
},
144+
{
145+
"preferred_network": "login.microsoftonline.de",
146+
"preferred_cache": "login.microsoftonline.de",
147+
"aliases": [
148+
"login.microsoftonline.de"
149+
]
150+
},
151+
{
152+
"preferred_network": "login.microsoftonline.us",
153+
"preferred_cache": "login.microsoftonline.us",
154+
"aliases": [
155+
"login.microsoftonline.us",
156+
"login.usgovcloudapi.net"
157+
]
158+
},
159+
{
160+
"preferred_network": "login-us.microsoftonline.com",
161+
"preferred_cache": "login-us.microsoftonline.com",
162+
"aliases": [
163+
"login-us.microsoftonline.com"
164+
]
165+
}
166+
]
167+
}
168+
},
169+
{
170+
"RequestUri": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/v2.0/token",
171+
"RequestMethod": "POST",
172+
"RequestHeaders": {
173+
"Accept": "application/json",
174+
"Accept-Encoding": "gzip, deflate",
175+
"client-request-id": "1835f604-36d0-4053-a0e4-a514af572cab",
176+
"Connection": "keep-alive",
177+
"Content-Length": "288",
178+
"Content-Type": "application/x-www-form-urlencoded",
179+
"Cookie": "cookie;",
180+
"User-Agent": "azsdk-python-identity/1.13.0b3 Python/3.8.9 (Windows-10-10.0.23435-SP0)",
181+
"x-client-cpu": "x64",
182+
"x-client-current-telemetry": "4|730,0|",
183+
"x-client-last-telemetry": "4|0|||",
184+
"x-client-os": "win32",
185+
"x-client-sku": "MSAL.Python",
186+
"x-client-ver": "1.20.0",
187+
"x-ms-lib-capability": "retry-after, h429"
188+
},
189+
"RequestBody": "client_id=00000000-0000-0000-0000-000000000000\u0026grant_type=client_credentials\u0026client_info=1\u0026client_secret=00000000-0000-0000-0000-000000000000\u0026claims=%7B%22access_token%22%3A\u002B%7B%22xms_cc%22%3A\u002B%7B%22values%22%3A\u002B%5B%22CP1%22%5D%7D%7D%7D\u0026scope=https%3A%2F%2Fmanagement.azure.com%2F.default",
190+
"StatusCode": 200,
191+
"ResponseHeaders": {
192+
"Cache-Control": "no-store, no-cache",
193+
"client-request-id": "1835f604-36d0-4053-a0e4-a514af572cab",
194+
"Content-Length": "114",
195+
"Content-Security-Policy-Report-Only": "script-src \u0027self\u0027 \u0027nonce-jSYYXVkK09BZUURJp6D5gQ\u0027 \u0027unsafe-eval\u0027 \u0027unsafe-inline\u0027 \u0027report-sample\u0027; object-src \u0027none\u0027; base-uri \u0027self\u0027; report-uri https://csp.microsoft.com/report/ESTS-UX-All",
196+
"Content-Type": "application/json; charset=utf-8",
197+
"Date": "Wed, 26 Apr 2023 07:24:33 GMT",
198+
"Expires": "-1",
199+
"P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022",
200+
"Pragma": "no-cache",
201+
"Set-Cookie": "[set-cookie;]",
202+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
203+
"X-Content-Type-Options": "nosniff",
204+
"x-ms-clitelem": "1,0,0,,",
205+
"x-ms-ests-server": "2.1.15256.7 - KRSLR1 ProdSlices",
206+
"X-XSS-Protection": "0"
207+
},
208+
"ResponseBody": {
209+
"token_type": "Bearer",
210+
"expires_in": 86399,
211+
"ext_expires_in": 86399,
212+
"refresh_in": 43199,
213+
"access_token": "access_token"
214+
}
215+
},
216+
{
217+
"RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/virtual_network_name/listNetworkManagerEffectiveConnectivityConfigurations?api-version=2022-09-01",
218+
"RequestMethod": "POST",
219+
"RequestHeaders": {
220+
"Accept": "application/json",
221+
"Accept-Encoding": "gzip, deflate",
222+
"Connection": "keep-alive",
223+
"Content-Length": "2",
224+
"Content-Type": "application/json",
225+
"User-Agent": "azsdk-python-mgmt-network/23.0.1 Python/3.8.9 (Windows-10-10.0.23435-SP0)"
226+
},
227+
"RequestBody": {},
228+
"StatusCode": 404,
229+
"ResponseHeaders": {
230+
"Cache-Control": "no-cache",
231+
"Content-Length": "161",
232+
"Content-Type": "application/json; charset=utf-8",
233+
"Date": "Wed, 26 Apr 2023 07:24:36 GMT",
234+
"Expires": "-1",
235+
"Pragma": "no-cache",
236+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
237+
"X-Content-Type-Options": "nosniff",
238+
"x-ms-correlation-request-id": "a3653708-cf80-4168-ba3c-1dadb73f5f74",
239+
"x-ms-failure-cause": "gateway",
240+
"x-ms-routing-request-id": "SOUTHEASTASIA:20230426T072436Z:a3653708-cf80-4168-ba3c-1dadb73f5f74"
241+
},
242+
"ResponseBody": {
243+
"error": {
244+
"code": "ParentResourceNotFound",
245+
"message": "Can not perform requested operation on nested resource. Parent resource \u0027virtual_network_name\u0027 not found."
246+
}
247+
}
248+
}
249+
],
250+
"Variables": {}
251+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# coding: utf-8
2+
3+
# -------------------------------------------------------------------------
4+
# Copyright (c) Microsoft Corporation. All rights reserved.
5+
# Licensed under the MIT License. See License.txt in the project root for
6+
# license information.
7+
# --------------------------------------------------------------------------
8+
from azure.core.exceptions import ResourceNotFoundError
9+
import azure.mgmt.network
10+
from devtools_testutils import (
11+
AzureMgmtRecordedTestCase,
12+
RandomNameResourceGroupPreparer,
13+
recorded_by_proxy,
14+
)
15+
import pytest
16+
17+
18+
class TestMgmtNetworkMixinOperation(AzureMgmtRecordedTestCase):
19+
def setup_method(self, method):
20+
self.mgmt_client = self.create_mgmt_client(
21+
azure.mgmt.network.NetworkManagementClient
22+
)
23+
24+
@RandomNameResourceGroupPreparer(location="eastus")
25+
@recorded_by_proxy
26+
def test_mixin_operation(self, resource_group):
27+
with pytest.raises(ResourceNotFoundError):
28+
self.mgmt_client.list_network_manager_effective_connectivity_configurations(
29+
resource_group_name=resource_group.name,
30+
virtual_network_name="virtual_network_name",
31+
parameters={},
32+
)

0 commit comments

Comments
 (0)