diracx-client 0.0.1a12__py3-none-any.whl → 0.0.1a14__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- diracx/client/__init__.py +1 -1
- diracx/client/_client.py +1 -1
- diracx/client/_configuration.py +1 -1
- diracx/client/_vendor.py +1 -1
- diracx/client/aio/__init__.py +1 -1
- diracx/client/aio/_client.py +1 -1
- diracx/client/aio/_configuration.py +1 -1
- diracx/client/aio/_vendor.py +1 -1
- diracx/client/aio/operations/__init__.py +1 -1
- diracx/client/aio/operations/_operations.py +366 -40
- diracx/client/models/__init__.py +5 -3
- diracx/client/models/_enums.py +13 -6
- diracx/client/models/_models.py +1 -1
- diracx/client/operations/__init__.py +1 -1
- diracx/client/operations/_operations.py +473 -40
- {diracx_client-0.0.1a12.dist-info → diracx_client-0.0.1a14.dist-info}/METADATA +1 -1
- diracx_client-0.0.1a14.dist-info/RECORD +26 -0
- diracx_client-0.0.1a12.dist-info/RECORD +0 -26
- {diracx_client-0.0.1a12.dist-info → diracx_client-0.0.1a14.dist-info}/WHEEL +0 -0
- {diracx_client-0.0.1a12.dist-info → diracx_client-0.0.1a14.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,23 @@
|
|
1
1
|
# pylint: disable=too-many-lines,too-many-statements
|
2
2
|
# coding=utf-8
|
3
3
|
# --------------------------------------------------------------------------
|
4
|
-
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.
|
4
|
+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.13.9)
|
5
5
|
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
6
6
|
# --------------------------------------------------------------------------
|
7
7
|
from io import IOBase
|
8
8
|
import sys
|
9
|
-
from typing import
|
9
|
+
from typing import (
|
10
|
+
Any,
|
11
|
+
Callable,
|
12
|
+
Dict,
|
13
|
+
IO,
|
14
|
+
List,
|
15
|
+
Optional,
|
16
|
+
Type,
|
17
|
+
TypeVar,
|
18
|
+
Union,
|
19
|
+
overload,
|
20
|
+
)
|
10
21
|
|
11
22
|
from azure.core import MatchConditions
|
12
23
|
from azure.core.exceptions import (
|
@@ -35,8 +46,11 @@ from ...operations._operations import (
|
|
35
46
|
build_auth_revoke_refresh_token_request,
|
36
47
|
build_auth_userinfo_request,
|
37
48
|
build_config_serve_config_request,
|
49
|
+
build_jobs_assign_sandbox_to_job_request,
|
38
50
|
build_jobs_delete_bulk_jobs_request,
|
39
51
|
build_jobs_delete_single_job_request,
|
52
|
+
build_jobs_get_job_sandbox_request,
|
53
|
+
build_jobs_get_job_sandboxes_request,
|
40
54
|
build_jobs_get_job_status_bulk_request,
|
41
55
|
build_jobs_get_job_status_history_bulk_request,
|
42
56
|
build_jobs_get_sandbox_file_request,
|
@@ -56,6 +70,8 @@ from ...operations._operations import (
|
|
56
70
|
build_jobs_set_single_job_status_request,
|
57
71
|
build_jobs_submit_bulk_jobs_request,
|
58
72
|
build_jobs_summary_request,
|
73
|
+
build_jobs_unassign_bulk_jobs_sandboxes_request,
|
74
|
+
build_jobs_unassign_job_sandboxes_request,
|
59
75
|
build_well_known_installation_metadata_request,
|
60
76
|
build_well_known_openid_configuration_request,
|
61
77
|
)
|
@@ -97,13 +113,13 @@ class WellKnownOperations:
|
|
97
113
|
async def openid_configuration(self, **kwargs: Any) -> Any:
|
98
114
|
"""Openid Configuration.
|
99
115
|
|
100
|
-
|
116
|
+
OpenID Connect discovery endpoint.
|
101
117
|
|
102
118
|
:return: any
|
103
119
|
:rtype: any
|
104
120
|
:raises ~azure.core.exceptions.HttpResponseError:
|
105
121
|
"""
|
106
|
-
error_map = {
|
122
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
107
123
|
401: ClientAuthenticationError,
|
108
124
|
404: ResourceNotFoundError,
|
109
125
|
409: ResourceExistsError,
|
@@ -150,13 +166,13 @@ class WellKnownOperations:
|
|
150
166
|
async def installation_metadata(self, **kwargs: Any) -> _models.Metadata:
|
151
167
|
"""Installation Metadata.
|
152
168
|
|
153
|
-
|
169
|
+
Get metadata about the dirac installation.
|
154
170
|
|
155
171
|
:return: Metadata
|
156
172
|
:rtype: ~client.models.Metadata
|
157
173
|
:raises ~azure.core.exceptions.HttpResponseError:
|
158
174
|
"""
|
159
|
-
error_map = {
|
175
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
160
176
|
401: ClientAuthenticationError,
|
161
177
|
404: ResourceNotFoundError,
|
162
178
|
409: ResourceExistsError,
|
@@ -247,7 +263,7 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
247
263
|
:rtype: any
|
248
264
|
:raises ~azure.core.exceptions.HttpResponseError:
|
249
265
|
"""
|
250
|
-
error_map = {
|
266
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
251
267
|
401: ClientAuthenticationError,
|
252
268
|
404: ResourceNotFoundError,
|
253
269
|
409: ResourceExistsError,
|
@@ -313,7 +329,7 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
313
329
|
:rtype: ~client.models.InitiateDeviceFlowResponse
|
314
330
|
:raises ~azure.core.exceptions.HttpResponseError:
|
315
331
|
"""
|
316
|
-
error_map = {
|
332
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
317
333
|
401: ClientAuthenticationError,
|
318
334
|
404: ResourceNotFoundError,
|
319
335
|
409: ResourceExistsError,
|
@@ -378,7 +394,7 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
378
394
|
:rtype: any
|
379
395
|
:raises ~azure.core.exceptions.HttpResponseError:
|
380
396
|
"""
|
381
|
-
error_map = {
|
397
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
382
398
|
401: ClientAuthenticationError,
|
383
399
|
404: ResourceNotFoundError,
|
384
400
|
409: ResourceExistsError,
|
@@ -427,13 +443,13 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
427
443
|
async def finished(self, **kwargs: Any) -> Any:
|
428
444
|
"""Finished.
|
429
445
|
|
430
|
-
|
446
|
+
This is the final step of the device flow.
|
431
447
|
|
432
448
|
:return: any
|
433
449
|
:rtype: any
|
434
450
|
:raises ~azure.core.exceptions.HttpResponseError:
|
435
451
|
"""
|
436
|
-
error_map = {
|
452
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
437
453
|
401: ClientAuthenticationError,
|
438
454
|
404: ResourceNotFoundError,
|
439
455
|
409: ResourceExistsError,
|
@@ -487,7 +503,7 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
487
503
|
:rtype: list[any]
|
488
504
|
:raises ~azure.core.exceptions.HttpResponseError:
|
489
505
|
"""
|
490
|
-
error_map = {
|
506
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
491
507
|
401: ClientAuthenticationError,
|
492
508
|
404: ResourceNotFoundError,
|
493
509
|
409: ResourceExistsError,
|
@@ -543,7 +559,7 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
543
559
|
:rtype: str
|
544
560
|
:raises ~azure.core.exceptions.HttpResponseError:
|
545
561
|
"""
|
546
|
-
error_map = {
|
562
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
547
563
|
401: ClientAuthenticationError,
|
548
564
|
404: ResourceNotFoundError,
|
549
565
|
409: ResourceExistsError,
|
@@ -597,7 +613,7 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
597
613
|
:rtype: ~client.models.UserInfoResponse
|
598
614
|
:raises ~azure.core.exceptions.HttpResponseError:
|
599
615
|
"""
|
600
|
-
error_map = {
|
616
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
601
617
|
401: ClientAuthenticationError,
|
602
618
|
404: ResourceNotFoundError,
|
603
619
|
409: ResourceExistsError,
|
@@ -655,7 +671,13 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
655
671
|
) -> Any:
|
656
672
|
"""Authorization Flow.
|
657
673
|
|
658
|
-
|
674
|
+
Initiate the authorization flow.
|
675
|
+
It will redirect to the actual OpenID server (IAM, CheckIn) to
|
676
|
+
perform a authorization code flow.
|
677
|
+
|
678
|
+
We set the user details obtained from the user authorize flow in a cookie
|
679
|
+
to be able to map the authorization flow with the corresponding
|
680
|
+
user authorize flow.
|
659
681
|
|
660
682
|
:keyword response_type: "code" Required.
|
661
683
|
:paramtype response_type: str or ~client.models.Enum0
|
@@ -675,7 +697,7 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
675
697
|
:rtype: any
|
676
698
|
:raises ~azure.core.exceptions.HttpResponseError:
|
677
699
|
"""
|
678
|
-
error_map = {
|
700
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
679
701
|
401: ClientAuthenticationError,
|
680
702
|
404: ResourceNotFoundError,
|
681
703
|
409: ResourceExistsError,
|
@@ -731,7 +753,13 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
731
753
|
) -> Any:
|
732
754
|
"""Authorization Flow Complete.
|
733
755
|
|
734
|
-
|
756
|
+
Complete the authorization flow.
|
757
|
+
|
758
|
+
The user is redirected back to the DIRAC auth service after completing the IAM's authorization
|
759
|
+
flow.
|
760
|
+
We retrieve the original flow details from the decrypted state and store the ID token requested
|
761
|
+
from the IAM.
|
762
|
+
The user is then redirected to the client's redirect URI.
|
735
763
|
|
736
764
|
:keyword code: Required.
|
737
765
|
:paramtype code: str
|
@@ -741,7 +769,7 @@ class AuthOperations: # pylint: disable=abstract-class-instantiated
|
|
741
769
|
:rtype: any
|
742
770
|
:raises ~azure.core.exceptions.HttpResponseError:
|
743
771
|
"""
|
744
|
-
error_map = {
|
772
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
745
773
|
401: ClientAuthenticationError,
|
746
774
|
404: ResourceNotFoundError,
|
747
775
|
409: ResourceExistsError,
|
@@ -837,7 +865,7 @@ class ConfigOperations:
|
|
837
865
|
:rtype: any
|
838
866
|
:raises ~azure.core.exceptions.HttpResponseError:
|
839
867
|
"""
|
840
|
-
error_map = {
|
868
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
841
869
|
401: ClientAuthenticationError,
|
842
870
|
404: ResourceNotFoundError,
|
843
871
|
409: ResourceExistsError,
|
@@ -931,7 +959,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
931
959
|
:rtype: ~client.models.SandboxDownloadResponse
|
932
960
|
:raises ~azure.core.exceptions.HttpResponseError:
|
933
961
|
"""
|
934
|
-
error_map = {
|
962
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
935
963
|
401: ClientAuthenticationError,
|
936
964
|
404: ResourceNotFoundError,
|
937
965
|
409: ResourceExistsError,
|
@@ -1047,7 +1075,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1047
1075
|
:rtype: ~client.models.SandboxUploadResponse
|
1048
1076
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1049
1077
|
"""
|
1050
|
-
error_map = {
|
1078
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1051
1079
|
401: ClientAuthenticationError,
|
1052
1080
|
404: ResourceNotFoundError,
|
1053
1081
|
409: ResourceExistsError,
|
@@ -1104,6 +1132,304 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1104
1132
|
|
1105
1133
|
return deserialized # type: ignore
|
1106
1134
|
|
1135
|
+
@distributed_trace_async
|
1136
|
+
async def unassign_bulk_jobs_sandboxes(
|
1137
|
+
self, *, jobs_ids: List[int], **kwargs: Any
|
1138
|
+
) -> Any:
|
1139
|
+
"""Unassign Bulk Jobs Sandboxes.
|
1140
|
+
|
1141
|
+
Delete bulk jobs sandbox mapping.
|
1142
|
+
|
1143
|
+
:keyword jobs_ids: Required.
|
1144
|
+
:paramtype jobs_ids: list[int]
|
1145
|
+
:return: any
|
1146
|
+
:rtype: any
|
1147
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
1148
|
+
"""
|
1149
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1150
|
+
401: ClientAuthenticationError,
|
1151
|
+
404: ResourceNotFoundError,
|
1152
|
+
409: ResourceExistsError,
|
1153
|
+
304: ResourceNotModifiedError,
|
1154
|
+
}
|
1155
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
1156
|
+
|
1157
|
+
_headers = kwargs.pop("headers", {}) or {}
|
1158
|
+
_params = kwargs.pop("params", {}) or {}
|
1159
|
+
|
1160
|
+
cls: ClsType[Any] = kwargs.pop("cls", None)
|
1161
|
+
|
1162
|
+
_request = build_jobs_unassign_bulk_jobs_sandboxes_request(
|
1163
|
+
jobs_ids=jobs_ids,
|
1164
|
+
headers=_headers,
|
1165
|
+
params=_params,
|
1166
|
+
)
|
1167
|
+
_request.url = self._client.format_url(_request.url)
|
1168
|
+
|
1169
|
+
_stream = False
|
1170
|
+
pipeline_response: PipelineResponse = (
|
1171
|
+
await self._client._pipeline.run( # pylint: disable=protected-access
|
1172
|
+
_request, stream=_stream, **kwargs
|
1173
|
+
)
|
1174
|
+
)
|
1175
|
+
|
1176
|
+
response = pipeline_response.http_response
|
1177
|
+
|
1178
|
+
if response.status_code not in [200]:
|
1179
|
+
if _stream:
|
1180
|
+
await response.read() # Load the body in memory and close the socket
|
1181
|
+
map_error(
|
1182
|
+
status_code=response.status_code, response=response, error_map=error_map
|
1183
|
+
)
|
1184
|
+
raise HttpResponseError(response=response)
|
1185
|
+
|
1186
|
+
deserialized = self._deserialize("object", pipeline_response)
|
1187
|
+
|
1188
|
+
if cls:
|
1189
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
1190
|
+
|
1191
|
+
return deserialized # type: ignore
|
1192
|
+
|
1193
|
+
@distributed_trace_async
|
1194
|
+
async def get_job_sandboxes(
|
1195
|
+
self, job_id: int, **kwargs: Any
|
1196
|
+
) -> Dict[str, List[Any]]:
|
1197
|
+
"""Get Job Sandboxes.
|
1198
|
+
|
1199
|
+
Get input and output sandboxes of given job.
|
1200
|
+
|
1201
|
+
:param job_id: Required.
|
1202
|
+
:type job_id: int
|
1203
|
+
:return: dict mapping str to list of any
|
1204
|
+
:rtype: dict[str, list[any]]
|
1205
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
1206
|
+
"""
|
1207
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1208
|
+
401: ClientAuthenticationError,
|
1209
|
+
404: ResourceNotFoundError,
|
1210
|
+
409: ResourceExistsError,
|
1211
|
+
304: ResourceNotModifiedError,
|
1212
|
+
}
|
1213
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
1214
|
+
|
1215
|
+
_headers = kwargs.pop("headers", {}) or {}
|
1216
|
+
_params = kwargs.pop("params", {}) or {}
|
1217
|
+
|
1218
|
+
cls: ClsType[Dict[str, List[Any]]] = kwargs.pop("cls", None)
|
1219
|
+
|
1220
|
+
_request = build_jobs_get_job_sandboxes_request(
|
1221
|
+
job_id=job_id,
|
1222
|
+
headers=_headers,
|
1223
|
+
params=_params,
|
1224
|
+
)
|
1225
|
+
_request.url = self._client.format_url(_request.url)
|
1226
|
+
|
1227
|
+
_stream = False
|
1228
|
+
pipeline_response: PipelineResponse = (
|
1229
|
+
await self._client._pipeline.run( # pylint: disable=protected-access
|
1230
|
+
_request, stream=_stream, **kwargs
|
1231
|
+
)
|
1232
|
+
)
|
1233
|
+
|
1234
|
+
response = pipeline_response.http_response
|
1235
|
+
|
1236
|
+
if response.status_code not in [200]:
|
1237
|
+
if _stream:
|
1238
|
+
await response.read() # Load the body in memory and close the socket
|
1239
|
+
map_error(
|
1240
|
+
status_code=response.status_code, response=response, error_map=error_map
|
1241
|
+
)
|
1242
|
+
raise HttpResponseError(response=response)
|
1243
|
+
|
1244
|
+
deserialized = self._deserialize("{[object]}", pipeline_response)
|
1245
|
+
|
1246
|
+
if cls:
|
1247
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
1248
|
+
|
1249
|
+
return deserialized # type: ignore
|
1250
|
+
|
1251
|
+
@distributed_trace_async
|
1252
|
+
async def unassign_job_sandboxes(self, job_id: int, **kwargs: Any) -> Any:
|
1253
|
+
"""Unassign Job Sandboxes.
|
1254
|
+
|
1255
|
+
Delete single job sandbox mapping.
|
1256
|
+
|
1257
|
+
:param job_id: Required.
|
1258
|
+
:type job_id: int
|
1259
|
+
:return: any
|
1260
|
+
:rtype: any
|
1261
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
1262
|
+
"""
|
1263
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1264
|
+
401: ClientAuthenticationError,
|
1265
|
+
404: ResourceNotFoundError,
|
1266
|
+
409: ResourceExistsError,
|
1267
|
+
304: ResourceNotModifiedError,
|
1268
|
+
}
|
1269
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
1270
|
+
|
1271
|
+
_headers = kwargs.pop("headers", {}) or {}
|
1272
|
+
_params = kwargs.pop("params", {}) or {}
|
1273
|
+
|
1274
|
+
cls: ClsType[Any] = kwargs.pop("cls", None)
|
1275
|
+
|
1276
|
+
_request = build_jobs_unassign_job_sandboxes_request(
|
1277
|
+
job_id=job_id,
|
1278
|
+
headers=_headers,
|
1279
|
+
params=_params,
|
1280
|
+
)
|
1281
|
+
_request.url = self._client.format_url(_request.url)
|
1282
|
+
|
1283
|
+
_stream = False
|
1284
|
+
pipeline_response: PipelineResponse = (
|
1285
|
+
await self._client._pipeline.run( # pylint: disable=protected-access
|
1286
|
+
_request, stream=_stream, **kwargs
|
1287
|
+
)
|
1288
|
+
)
|
1289
|
+
|
1290
|
+
response = pipeline_response.http_response
|
1291
|
+
|
1292
|
+
if response.status_code not in [200]:
|
1293
|
+
if _stream:
|
1294
|
+
await response.read() # Load the body in memory and close the socket
|
1295
|
+
map_error(
|
1296
|
+
status_code=response.status_code, response=response, error_map=error_map
|
1297
|
+
)
|
1298
|
+
raise HttpResponseError(response=response)
|
1299
|
+
|
1300
|
+
deserialized = self._deserialize("object", pipeline_response)
|
1301
|
+
|
1302
|
+
if cls:
|
1303
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
1304
|
+
|
1305
|
+
return deserialized # type: ignore
|
1306
|
+
|
1307
|
+
@distributed_trace_async
|
1308
|
+
async def get_job_sandbox(
|
1309
|
+
self, job_id: int, sandbox_type: Union[str, _models.SandboxType], **kwargs: Any
|
1310
|
+
) -> List[Any]:
|
1311
|
+
"""Get Job Sandbox.
|
1312
|
+
|
1313
|
+
Get input or output sandbox of given job.
|
1314
|
+
|
1315
|
+
:param job_id: Required.
|
1316
|
+
:type job_id: int
|
1317
|
+
:param sandbox_type: Known values are: "input" and "output". Required.
|
1318
|
+
:type sandbox_type: str or ~client.models.SandboxType
|
1319
|
+
:return: list of any
|
1320
|
+
:rtype: list[any]
|
1321
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
1322
|
+
"""
|
1323
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1324
|
+
401: ClientAuthenticationError,
|
1325
|
+
404: ResourceNotFoundError,
|
1326
|
+
409: ResourceExistsError,
|
1327
|
+
304: ResourceNotModifiedError,
|
1328
|
+
}
|
1329
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
1330
|
+
|
1331
|
+
_headers = kwargs.pop("headers", {}) or {}
|
1332
|
+
_params = kwargs.pop("params", {}) or {}
|
1333
|
+
|
1334
|
+
cls: ClsType[List[Any]] = kwargs.pop("cls", None)
|
1335
|
+
|
1336
|
+
_request = build_jobs_get_job_sandbox_request(
|
1337
|
+
job_id=job_id,
|
1338
|
+
sandbox_type=sandbox_type,
|
1339
|
+
headers=_headers,
|
1340
|
+
params=_params,
|
1341
|
+
)
|
1342
|
+
_request.url = self._client.format_url(_request.url)
|
1343
|
+
|
1344
|
+
_stream = False
|
1345
|
+
pipeline_response: PipelineResponse = (
|
1346
|
+
await self._client._pipeline.run( # pylint: disable=protected-access
|
1347
|
+
_request, stream=_stream, **kwargs
|
1348
|
+
)
|
1349
|
+
)
|
1350
|
+
|
1351
|
+
response = pipeline_response.http_response
|
1352
|
+
|
1353
|
+
if response.status_code not in [200]:
|
1354
|
+
if _stream:
|
1355
|
+
await response.read() # Load the body in memory and close the socket
|
1356
|
+
map_error(
|
1357
|
+
status_code=response.status_code, response=response, error_map=error_map
|
1358
|
+
)
|
1359
|
+
raise HttpResponseError(response=response)
|
1360
|
+
|
1361
|
+
deserialized = self._deserialize("[object]", pipeline_response)
|
1362
|
+
|
1363
|
+
if cls:
|
1364
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
1365
|
+
|
1366
|
+
return deserialized # type: ignore
|
1367
|
+
|
1368
|
+
@distributed_trace_async
|
1369
|
+
async def assign_sandbox_to_job(self, job_id: int, body: str, **kwargs: Any) -> Any:
|
1370
|
+
"""Assign Sandbox To Job.
|
1371
|
+
|
1372
|
+
Mapp the pfn as output sandbox to job.
|
1373
|
+
|
1374
|
+
:param job_id: Required.
|
1375
|
+
:type job_id: int
|
1376
|
+
:param body: Required.
|
1377
|
+
:type body: str
|
1378
|
+
:return: any
|
1379
|
+
:rtype: any
|
1380
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
1381
|
+
"""
|
1382
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1383
|
+
401: ClientAuthenticationError,
|
1384
|
+
404: ResourceNotFoundError,
|
1385
|
+
409: ResourceExistsError,
|
1386
|
+
304: ResourceNotModifiedError,
|
1387
|
+
}
|
1388
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
1389
|
+
|
1390
|
+
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
1391
|
+
_params = kwargs.pop("params", {}) or {}
|
1392
|
+
|
1393
|
+
content_type: str = kwargs.pop(
|
1394
|
+
"content_type", _headers.pop("Content-Type", "application/json")
|
1395
|
+
)
|
1396
|
+
cls: ClsType[Any] = kwargs.pop("cls", None)
|
1397
|
+
|
1398
|
+
_content = self._serialize.body(body, "str")
|
1399
|
+
|
1400
|
+
_request = build_jobs_assign_sandbox_to_job_request(
|
1401
|
+
job_id=job_id,
|
1402
|
+
content_type=content_type,
|
1403
|
+
content=_content,
|
1404
|
+
headers=_headers,
|
1405
|
+
params=_params,
|
1406
|
+
)
|
1407
|
+
_request.url = self._client.format_url(_request.url)
|
1408
|
+
|
1409
|
+
_stream = False
|
1410
|
+
pipeline_response: PipelineResponse = (
|
1411
|
+
await self._client._pipeline.run( # pylint: disable=protected-access
|
1412
|
+
_request, stream=_stream, **kwargs
|
1413
|
+
)
|
1414
|
+
)
|
1415
|
+
|
1416
|
+
response = pipeline_response.http_response
|
1417
|
+
|
1418
|
+
if response.status_code not in [200]:
|
1419
|
+
if _stream:
|
1420
|
+
await response.read() # Load the body in memory and close the socket
|
1421
|
+
map_error(
|
1422
|
+
status_code=response.status_code, response=response, error_map=error_map
|
1423
|
+
)
|
1424
|
+
raise HttpResponseError(response=response)
|
1425
|
+
|
1426
|
+
deserialized = self._deserialize("object", pipeline_response)
|
1427
|
+
|
1428
|
+
if cls:
|
1429
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
1430
|
+
|
1431
|
+
return deserialized # type: ignore
|
1432
|
+
|
1107
1433
|
@overload
|
1108
1434
|
async def submit_bulk_jobs(
|
1109
1435
|
self, body: List[str], *, content_type: str = "application/json", **kwargs: Any
|
@@ -1154,7 +1480,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1154
1480
|
:rtype: list[~client.models.InsertedJob]
|
1155
1481
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1156
1482
|
"""
|
1157
|
-
error_map = {
|
1483
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1158
1484
|
401: ClientAuthenticationError,
|
1159
1485
|
404: ResourceNotFoundError,
|
1160
1486
|
409: ResourceExistsError,
|
@@ -1223,7 +1549,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1223
1549
|
:rtype: any
|
1224
1550
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1225
1551
|
"""
|
1226
|
-
error_map = {
|
1552
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1227
1553
|
401: ClientAuthenticationError,
|
1228
1554
|
404: ResourceNotFoundError,
|
1229
1555
|
409: ResourceExistsError,
|
@@ -1279,7 +1605,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1279
1605
|
:rtype: any
|
1280
1606
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1281
1607
|
"""
|
1282
|
-
error_map = {
|
1608
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1283
1609
|
401: ClientAuthenticationError,
|
1284
1610
|
404: ResourceNotFoundError,
|
1285
1611
|
409: ResourceExistsError,
|
@@ -1339,7 +1665,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1339
1665
|
:rtype: any
|
1340
1666
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1341
1667
|
"""
|
1342
|
-
error_map = {
|
1668
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1343
1669
|
401: ClientAuthenticationError,
|
1344
1670
|
404: ResourceNotFoundError,
|
1345
1671
|
409: ResourceExistsError,
|
@@ -1397,7 +1723,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1397
1723
|
:rtype: dict[str, ~client.models.LimitedJobStatusReturn]
|
1398
1724
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1399
1725
|
"""
|
1400
|
-
error_map = {
|
1726
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1401
1727
|
401: ClientAuthenticationError,
|
1402
1728
|
404: ResourceNotFoundError,
|
1403
1729
|
409: ResourceExistsError,
|
@@ -1513,7 +1839,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1513
1839
|
:rtype: dict[str, ~client.models.SetJobStatusReturn]
|
1514
1840
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1515
1841
|
"""
|
1516
|
-
error_map = {
|
1842
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1517
1843
|
401: ClientAuthenticationError,
|
1518
1844
|
404: ResourceNotFoundError,
|
1519
1845
|
409: ResourceExistsError,
|
@@ -1585,7 +1911,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1585
1911
|
:rtype: dict[str, list[~client.models.JobStatusReturn]]
|
1586
1912
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1587
1913
|
"""
|
1588
|
-
error_map = {
|
1914
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1589
1915
|
401: ClientAuthenticationError,
|
1590
1916
|
404: ResourceNotFoundError,
|
1591
1917
|
409: ResourceExistsError,
|
@@ -1641,7 +1967,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1641
1967
|
:rtype: any
|
1642
1968
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1643
1969
|
"""
|
1644
|
-
error_map = {
|
1970
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1645
1971
|
401: ClientAuthenticationError,
|
1646
1972
|
404: ResourceNotFoundError,
|
1647
1973
|
409: ResourceExistsError,
|
@@ -1697,7 +2023,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1697
2023
|
:rtype: any
|
1698
2024
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1699
2025
|
"""
|
1700
|
-
error_map = {
|
2026
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1701
2027
|
401: ClientAuthenticationError,
|
1702
2028
|
404: ResourceNotFoundError,
|
1703
2029
|
409: ResourceExistsError,
|
@@ -1826,7 +2152,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1826
2152
|
:rtype: list[JSON]
|
1827
2153
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1828
2154
|
"""
|
1829
|
-
error_map = {
|
2155
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1830
2156
|
401: ClientAuthenticationError,
|
1831
2157
|
404: ResourceNotFoundError,
|
1832
2158
|
409: ResourceExistsError,
|
@@ -1942,7 +2268,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
1942
2268
|
:rtype: any
|
1943
2269
|
:raises ~azure.core.exceptions.HttpResponseError:
|
1944
2270
|
"""
|
1945
|
-
error_map = {
|
2271
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
1946
2272
|
401: ClientAuthenticationError,
|
1947
2273
|
404: ResourceNotFoundError,
|
1948
2274
|
409: ResourceExistsError,
|
@@ -2011,7 +2337,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
2011
2337
|
:rtype: any
|
2012
2338
|
:raises ~azure.core.exceptions.HttpResponseError:
|
2013
2339
|
"""
|
2014
|
-
error_map = {
|
2340
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
2015
2341
|
401: ClientAuthenticationError,
|
2016
2342
|
404: ResourceNotFoundError,
|
2017
2343
|
409: ResourceExistsError,
|
@@ -2067,7 +2393,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
2067
2393
|
:rtype: any
|
2068
2394
|
:raises ~azure.core.exceptions.HttpResponseError:
|
2069
2395
|
"""
|
2070
|
-
error_map = {
|
2396
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
2071
2397
|
401: ClientAuthenticationError,
|
2072
2398
|
404: ResourceNotFoundError,
|
2073
2399
|
409: ResourceExistsError,
|
@@ -2129,7 +2455,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
2129
2455
|
:rtype: any
|
2130
2456
|
:raises ~azure.core.exceptions.HttpResponseError:
|
2131
2457
|
"""
|
2132
|
-
error_map = {
|
2458
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
2133
2459
|
401: ClientAuthenticationError,
|
2134
2460
|
404: ResourceNotFoundError,
|
2135
2461
|
409: ResourceExistsError,
|
@@ -2193,7 +2519,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
2193
2519
|
:rtype: any
|
2194
2520
|
:raises ~azure.core.exceptions.HttpResponseError:
|
2195
2521
|
"""
|
2196
|
-
error_map = {
|
2522
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
2197
2523
|
401: ClientAuthenticationError,
|
2198
2524
|
404: ResourceNotFoundError,
|
2199
2525
|
409: ResourceExistsError,
|
@@ -2253,7 +2579,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
2253
2579
|
:rtype: any
|
2254
2580
|
:raises ~azure.core.exceptions.HttpResponseError:
|
2255
2581
|
"""
|
2256
|
-
error_map = {
|
2582
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
2257
2583
|
401: ClientAuthenticationError,
|
2258
2584
|
404: ResourceNotFoundError,
|
2259
2585
|
409: ResourceExistsError,
|
@@ -2311,7 +2637,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
2311
2637
|
:rtype: dict[str, ~client.models.LimitedJobStatusReturn]
|
2312
2638
|
:raises ~azure.core.exceptions.HttpResponseError:
|
2313
2639
|
"""
|
2314
|
-
error_map = {
|
2640
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
2315
2641
|
401: ClientAuthenticationError,
|
2316
2642
|
404: ResourceNotFoundError,
|
2317
2643
|
409: ResourceExistsError,
|
@@ -2436,7 +2762,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
2436
2762
|
:rtype: dict[str, ~client.models.SetJobStatusReturn]
|
2437
2763
|
:raises ~azure.core.exceptions.HttpResponseError:
|
2438
2764
|
"""
|
2439
|
-
error_map = {
|
2765
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
2440
2766
|
401: ClientAuthenticationError,
|
2441
2767
|
404: ResourceNotFoundError,
|
2442
2768
|
409: ResourceExistsError,
|
@@ -2509,7 +2835,7 @@ class JobsOperations: # pylint: disable=too-many-public-methods
|
|
2509
2835
|
:rtype: dict[str, list[~client.models.JobStatusReturn]]
|
2510
2836
|
:raises ~azure.core.exceptions.HttpResponseError:
|
2511
2837
|
"""
|
2512
|
-
error_map = {
|
2838
|
+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
|
2513
2839
|
401: ClientAuthenticationError,
|
2514
2840
|
404: ResourceNotFoundError,
|
2515
2841
|
409: ResourceExistsError,
|