Skip to content

Commit 54b2d37

Browse files
azure-sdkmsyyc
andauthored
[AutoRelease] t2-servicenetworking-2024-09-29-89793(can only be merged by SDK owner) (Azure#37627)
* code and test * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: Yuchao Yan <[email protected]>
1 parent ef9641d commit 54b2d37

17 files changed

+136
-107
lines changed

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

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

3-
## 1.1.0b1 (2024-08-19)
3+
## 1.1.0b1 (2024-09-29)
44

55
### Features Added
66

7-
- Added operation group SecurityPoliciesInterfaceOperations
8-
- Model TrafficController has a new parameter security_policies
9-
- Model TrafficController has a new parameter security_policy_configurations
10-
- Model TrafficControllerUpdate has a new parameter security_policy_configurations
7+
- Client `ServiceNetworkingMgmtClient` added operation group `security_policies_interface`
8+
- Model `TrafficController` added property `security_policies`
9+
- Model `TrafficController` added property `security_policy_configurations`
10+
- Model `TrafficControllerUpdate` added property `security_policy_configurations`
11+
- Added enum `PolicyType`
12+
- Added model `SecurityPolicy`
13+
- Added model `SecurityPolicyConfigurations`
14+
- Added model `SecurityPolicyConfigurationsUpdate`
15+
- Added model `SecurityPolicyListResult`
16+
- Added model `SecurityPolicyUpdate`
17+
- Added model `WafPolicy`
18+
- Added model `WafPolicyUpdate`
19+
- Added model `WafSecurityPolicy`
20+
- Added model `WafSecurityPolicyUpdate`
21+
- Added model `SecurityPoliciesInterfaceOperations`
1122

1223
## 1.0.0 (2023-11-20)
1324

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "b8bf9af0df9b688bf2de1eb0972810ac0e0b6185",
2+
"commit": "778fdb20839c487eba95a6b161812ad9d9d6337d",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.15.0",
6+
"@autorest/python@6.19.0",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/servicenetworking/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=2024-05-01-preview --use=@autorest/python@6.15.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/servicenetworking/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=2024-05-01-preview --use=@autorest/python@6.19.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/servicenetworking/resource-manager/readme.md"
1111
}

sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_associations_interface_operations.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
ResourceExistsError,
1919
ResourceNotFoundError,
2020
ResourceNotModifiedError,
21+
StreamClosedError,
22+
StreamConsumedError,
2123
map_error,
2224
)
2325
from azure.core.pipeline import PipelineResponse
@@ -256,6 +258,7 @@ async def _create_or_update_initial(
256258
)
257259
_request.url = self._client.format_url(_request.url)
258260

261+
_decompress = kwargs.pop("decompress", True)
259262
_stream = True
260263
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
261264
_request, stream=_stream, **kwargs
@@ -264,19 +267,19 @@ async def _create_or_update_initial(
264267
response = pipeline_response.http_response
265268

266269
if response.status_code not in [200, 201]:
267-
await response.read() # Load the body in memory and close the socket
270+
try:
271+
await response.read() # Load the body in memory and close the socket
272+
except (StreamConsumedError, StreamClosedError):
273+
pass
268274
map_error(status_code=response.status_code, response=response, error_map=error_map)
269275
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
270276
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
271277

272278
response_headers = {}
273-
if response.status_code == 200:
274-
deserialized = response.stream_download(self._client._pipeline)
275-
276279
if response.status_code == 201:
277280
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
278281

279-
deserialized = response.stream_download(self._client._pipeline)
282+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
280283

281284
if cls:
282285
return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -591,6 +594,7 @@ async def _delete_initial(
591594
)
592595
_request.url = self._client.format_url(_request.url)
593596

597+
_decompress = kwargs.pop("decompress", True)
594598
_stream = True
595599
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
596600
_request, stream=_stream, **kwargs
@@ -599,7 +603,10 @@ async def _delete_initial(
599603
response = pipeline_response.http_response
600604

601605
if response.status_code not in [202, 204]:
602-
await response.read() # Load the body in memory and close the socket
606+
try:
607+
await response.read() # Load the body in memory and close the socket
608+
except (StreamConsumedError, StreamClosedError):
609+
pass
603610
map_error(status_code=response.status_code, response=response, error_map=error_map)
604611
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
605612
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
@@ -609,10 +616,7 @@ async def _delete_initial(
609616
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
610617
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
611618

612-
deserialized = response.stream_download(self._client._pipeline)
613-
614-
if response.status_code == 204:
615-
deserialized = response.stream_download(self._client._pipeline)
619+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
616620

617621
if cls:
618622
return cls(pipeline_response, deserialized, response_headers) # type: ignore

sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_frontends_interface_operations.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
ResourceExistsError,
1919
ResourceNotFoundError,
2020
ResourceNotModifiedError,
21+
StreamClosedError,
22+
StreamConsumedError,
2123
map_error,
2224
)
2325
from azure.core.pipeline import PipelineResponse
@@ -255,6 +257,7 @@ async def _create_or_update_initial(
255257
)
256258
_request.url = self._client.format_url(_request.url)
257259

260+
_decompress = kwargs.pop("decompress", True)
258261
_stream = True
259262
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
260263
_request, stream=_stream, **kwargs
@@ -263,19 +266,19 @@ async def _create_or_update_initial(
263266
response = pipeline_response.http_response
264267

265268
if response.status_code not in [200, 201]:
266-
await response.read() # Load the body in memory and close the socket
269+
try:
270+
await response.read() # Load the body in memory and close the socket
271+
except (StreamConsumedError, StreamClosedError):
272+
pass
267273
map_error(status_code=response.status_code, response=response, error_map=error_map)
268274
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
269275
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
270276

271277
response_headers = {}
272-
if response.status_code == 200:
273-
deserialized = response.stream_download(self._client._pipeline)
274-
275278
if response.status_code == 201:
276279
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
277280

278-
deserialized = response.stream_download(self._client._pipeline)
281+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
279282

280283
if cls:
281284
return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -590,6 +593,7 @@ async def _delete_initial(
590593
)
591594
_request.url = self._client.format_url(_request.url)
592595

596+
_decompress = kwargs.pop("decompress", True)
593597
_stream = True
594598
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
595599
_request, stream=_stream, **kwargs
@@ -598,7 +602,10 @@ async def _delete_initial(
598602
response = pipeline_response.http_response
599603

600604
if response.status_code not in [202, 204]:
601-
await response.read() # Load the body in memory and close the socket
605+
try:
606+
await response.read() # Load the body in memory and close the socket
607+
except (StreamConsumedError, StreamClosedError):
608+
pass
602609
map_error(status_code=response.status_code, response=response, error_map=error_map)
603610
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
604611
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
@@ -608,10 +615,7 @@ async def _delete_initial(
608615
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
609616
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
610617

611-
deserialized = response.stream_download(self._client._pipeline)
612-
613-
if response.status_code == 204:
614-
deserialized = response.stream_download(self._client._pipeline)
618+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
615619

616620
if cls:
617621
return cls(pipeline_response, deserialized, response_headers) # type: ignore

sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_security_policies_interface_operations.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
ResourceExistsError,
1919
ResourceNotFoundError,
2020
ResourceNotModifiedError,
21+
StreamClosedError,
22+
StreamConsumedError,
2123
map_error,
2224
)
2325
from azure.core.pipeline import PipelineResponse
@@ -256,6 +258,7 @@ async def _create_or_update_initial(
256258
)
257259
_request.url = self._client.format_url(_request.url)
258260

261+
_decompress = kwargs.pop("decompress", True)
259262
_stream = True
260263
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
261264
_request, stream=_stream, **kwargs
@@ -264,19 +267,19 @@ async def _create_or_update_initial(
264267
response = pipeline_response.http_response
265268

266269
if response.status_code not in [200, 201]:
267-
await response.read() # Load the body in memory and close the socket
270+
try:
271+
await response.read() # Load the body in memory and close the socket
272+
except (StreamConsumedError, StreamClosedError):
273+
pass
268274
map_error(status_code=response.status_code, response=response, error_map=error_map)
269275
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
270276
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
271277

272278
response_headers = {}
273-
if response.status_code == 200:
274-
deserialized = response.stream_download(self._client._pipeline)
275-
276279
if response.status_code == 201:
277280
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
278281

279-
deserialized = response.stream_download(self._client._pipeline)
282+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
280283

281284
if cls:
282285
return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -591,6 +594,7 @@ async def _delete_initial(
591594
)
592595
_request.url = self._client.format_url(_request.url)
593596

597+
_decompress = kwargs.pop("decompress", True)
594598
_stream = True
595599
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
596600
_request, stream=_stream, **kwargs
@@ -599,7 +603,10 @@ async def _delete_initial(
599603
response = pipeline_response.http_response
600604

601605
if response.status_code not in [202, 204]:
602-
await response.read() # Load the body in memory and close the socket
606+
try:
607+
await response.read() # Load the body in memory and close the socket
608+
except (StreamConsumedError, StreamClosedError):
609+
pass
603610
map_error(status_code=response.status_code, response=response, error_map=error_map)
604611
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
605612
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
@@ -609,10 +616,7 @@ async def _delete_initial(
609616
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
610617
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
611618

612-
deserialized = response.stream_download(self._client._pipeline)
613-
614-
if response.status_code == 204:
615-
deserialized = response.stream_download(self._client._pipeline)
619+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
616620

617621
if cls:
618622
return cls(pipeline_response, deserialized, response_headers) # type: ignore

sdk/servicenetworking/azure-mgmt-servicenetworking/azure/mgmt/servicenetworking/aio/operations/_traffic_controller_interface_operations.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
ResourceExistsError,
1919
ResourceNotFoundError,
2020
ResourceNotModifiedError,
21+
StreamClosedError,
22+
StreamConsumedError,
2123
map_error,
2224
)
2325
from azure.core.pipeline import PipelineResponse
@@ -325,6 +327,7 @@ async def _create_or_update_initial(
325327
)
326328
_request.url = self._client.format_url(_request.url)
327329

330+
_decompress = kwargs.pop("decompress", True)
328331
_stream = True
329332
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
330333
_request, stream=_stream, **kwargs
@@ -333,19 +336,19 @@ async def _create_or_update_initial(
333336
response = pipeline_response.http_response
334337

335338
if response.status_code not in [200, 201]:
336-
await response.read() # Load the body in memory and close the socket
339+
try:
340+
await response.read() # Load the body in memory and close the socket
341+
except (StreamConsumedError, StreamClosedError):
342+
pass
337343
map_error(status_code=response.status_code, response=response, error_map=error_map)
338344
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
339345
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
340346

341347
response_headers = {}
342-
if response.status_code == 200:
343-
deserialized = response.stream_download(self._client._pipeline)
344-
345348
if response.status_code == 201:
346349
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
347350

348-
deserialized = response.stream_download(self._client._pipeline)
351+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
349352

350353
if cls:
351354
return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -642,6 +645,7 @@ async def _delete_initial(
642645
)
643646
_request.url = self._client.format_url(_request.url)
644647

648+
_decompress = kwargs.pop("decompress", True)
645649
_stream = True
646650
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
647651
_request, stream=_stream, **kwargs
@@ -650,7 +654,10 @@ async def _delete_initial(
650654
response = pipeline_response.http_response
651655

652656
if response.status_code not in [202, 204]:
653-
await response.read() # Load the body in memory and close the socket
657+
try:
658+
await response.read() # Load the body in memory and close the socket
659+
except (StreamConsumedError, StreamClosedError):
660+
pass
654661
map_error(status_code=response.status_code, response=response, error_map=error_map)
655662
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
656663
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
@@ -660,10 +667,7 @@ async def _delete_initial(
660667
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
661668
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
662669

663-
deserialized = response.stream_download(self._client._pipeline)
664-
665-
if response.status_code == 204:
666-
deserialized = response.stream_download(self._client._pipeline)
670+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
667671

668672
if cls:
669673
return cls(pipeline_response, deserialized, response_headers) # type: ignore

0 commit comments

Comments
 (0)