latitudesh-python-sdk 2.0.0__py3-none-any.whl → 2.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of latitudesh-python-sdk might be problematic. Click here for more details.
- latitudesh_python_sdk/_version.py +3 -3
- latitudesh_python_sdk/apikeys.py +51 -138
- latitudesh_python_sdk/basesdk.py +4 -4
- latitudesh_python_sdk/billing.py +11 -32
- latitudesh_python_sdk/events_sdk.py +9 -34
- latitudesh_python_sdk/firewalls_sdk.py +89 -264
- latitudesh_python_sdk/ipaddresses_sdk.py +25 -68
- latitudesh_python_sdk/models/__init__.py +27 -4
- latitudesh_python_sdk/models/apierror.py +30 -14
- latitudesh_python_sdk/models/deploy_config.py +11 -6
- latitudesh_python_sdk/models/error_object.py +11 -6
- latitudesh_python_sdk/models/latitudesherror.py +26 -0
- latitudesh_python_sdk/models/no_response_error.py +13 -0
- latitudesh_python_sdk/models/region_resource_data.py +4 -4
- latitudesh_python_sdk/models/responsevalidationerror.py +25 -0
- latitudesh_python_sdk/models/server.py +11 -6
- latitudesh_python_sdk/models/server_data.py +6 -3
- latitudesh_python_sdk/models/server_region_resource_data.py +40 -0
- latitudesh_python_sdk/models/update_serverop.py +1 -3
- latitudesh_python_sdk/models/virtual_network.py +11 -6
- latitudesh_python_sdk/operatingsystems_sdk.py +11 -32
- latitudesh_python_sdk/plans.py +57 -188
- latitudesh_python_sdk/privatenetworks.py +87 -262
- latitudesh_python_sdk/projects_sdk.py +43 -130
- latitudesh_python_sdk/regions_sdk.py +21 -66
- latitudesh_python_sdk/roles.py +21 -64
- latitudesh_python_sdk/servers_sdk.py +207 -604
- latitudesh_python_sdk/sshkeys_sdk.py +85 -304
- latitudesh_python_sdk/storage.py +33 -120
- latitudesh_python_sdk/tags.py +39 -126
- latitudesh_python_sdk/teams_sdk.py +35 -100
- latitudesh_python_sdk/teamsmembers.py +31 -96
- latitudesh_python_sdk/traffic_sdk.py +25 -68
- latitudesh_python_sdk/userdata_sdk.py +79 -298
- latitudesh_python_sdk/userprofile.py +31 -100
- latitudesh_python_sdk/utils/serializers.py +3 -2
- latitudesh_python_sdk/utils/unmarshal_json_response.py +24 -0
- latitudesh_python_sdk/virtualmachines.py +35 -122
- latitudesh_python_sdk/vpnsessions.py +55 -146
- {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/METADATA +47 -24
- {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/RECORD +43 -38
- {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/LICENSE +0 -0
- {latitudesh_python_sdk-2.0.0.dist-info → latitudesh_python_sdk-2.0.1.dist-info}/WHEEL +0 -0
|
@@ -6,6 +6,7 @@ from latitudesh_python_sdk import models, utils
|
|
|
6
6
|
from latitudesh_python_sdk._hooks import HookContext
|
|
7
7
|
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
8
8
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
9
|
+
from latitudesh_python_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
10
|
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
10
11
|
|
|
11
12
|
|
|
@@ -169,31 +170,19 @@ class ServersSDK(BaseSDK):
|
|
|
169
170
|
response_data: Any = None
|
|
170
171
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
171
172
|
return models.GetServersResponse(
|
|
172
|
-
result=
|
|
173
|
-
next=next_func,
|
|
173
|
+
result=unmarshal_json_response(models.Servers, http_res), next=next_func
|
|
174
174
|
)
|
|
175
175
|
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
176
|
-
response_data =
|
|
177
|
-
raise models.ErrorObject(
|
|
176
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
177
|
+
raise models.ErrorObject(response_data, http_res)
|
|
178
178
|
if utils.match_response(http_res, "4XX", "*"):
|
|
179
179
|
http_res_text = utils.stream_to_text(http_res)
|
|
180
|
-
raise models.APIError(
|
|
181
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
182
|
-
)
|
|
180
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
183
181
|
if utils.match_response(http_res, "5XX", "*"):
|
|
184
182
|
http_res_text = utils.stream_to_text(http_res)
|
|
185
|
-
raise models.APIError(
|
|
186
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
187
|
-
)
|
|
183
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
188
184
|
|
|
189
|
-
|
|
190
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
191
|
-
raise models.APIError(
|
|
192
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
193
|
-
http_res.status_code,
|
|
194
|
-
http_res_text,
|
|
195
|
-
http_res,
|
|
196
|
-
)
|
|
185
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
197
186
|
|
|
198
187
|
async def list_async(
|
|
199
188
|
self,
|
|
@@ -354,31 +343,19 @@ class ServersSDK(BaseSDK):
|
|
|
354
343
|
response_data: Any = None
|
|
355
344
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
356
345
|
return models.GetServersResponse(
|
|
357
|
-
result=
|
|
358
|
-
next=next_func,
|
|
346
|
+
result=unmarshal_json_response(models.Servers, http_res), next=next_func
|
|
359
347
|
)
|
|
360
348
|
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
361
|
-
response_data =
|
|
362
|
-
raise models.ErrorObject(
|
|
349
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
350
|
+
raise models.ErrorObject(response_data, http_res)
|
|
363
351
|
if utils.match_response(http_res, "4XX", "*"):
|
|
364
352
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
365
|
-
raise models.APIError(
|
|
366
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
367
|
-
)
|
|
353
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
368
354
|
if utils.match_response(http_res, "5XX", "*"):
|
|
369
355
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
370
|
-
raise models.APIError(
|
|
371
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
372
|
-
)
|
|
356
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
373
357
|
|
|
374
|
-
|
|
375
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
376
|
-
raise models.APIError(
|
|
377
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
378
|
-
http_res.status_code,
|
|
379
|
-
http_res_text,
|
|
380
|
-
http_res,
|
|
381
|
-
)
|
|
358
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
382
359
|
|
|
383
360
|
def create(
|
|
384
361
|
self,
|
|
@@ -461,31 +438,20 @@ class ServersSDK(BaseSDK):
|
|
|
461
438
|
|
|
462
439
|
response_data: Any = None
|
|
463
440
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
464
|
-
return
|
|
441
|
+
return unmarshal_json_response(models.Server, http_res)
|
|
465
442
|
if utils.match_response(
|
|
466
443
|
http_res, ["400", "402", "422"], "application/vnd.api+json"
|
|
467
444
|
):
|
|
468
|
-
response_data =
|
|
469
|
-
raise models.ErrorObject(
|
|
445
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
446
|
+
raise models.ErrorObject(response_data, http_res)
|
|
470
447
|
if utils.match_response(http_res, "4XX", "*"):
|
|
471
448
|
http_res_text = utils.stream_to_text(http_res)
|
|
472
|
-
raise models.APIError(
|
|
473
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
474
|
-
)
|
|
449
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
475
450
|
if utils.match_response(http_res, "5XX", "*"):
|
|
476
451
|
http_res_text = utils.stream_to_text(http_res)
|
|
477
|
-
raise models.APIError(
|
|
478
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
479
|
-
)
|
|
452
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
480
453
|
|
|
481
|
-
|
|
482
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
483
|
-
raise models.APIError(
|
|
484
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
485
|
-
http_res.status_code,
|
|
486
|
-
http_res_text,
|
|
487
|
-
http_res,
|
|
488
|
-
)
|
|
454
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
489
455
|
|
|
490
456
|
async def create_async(
|
|
491
457
|
self,
|
|
@@ -568,31 +534,20 @@ class ServersSDK(BaseSDK):
|
|
|
568
534
|
|
|
569
535
|
response_data: Any = None
|
|
570
536
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
571
|
-
return
|
|
537
|
+
return unmarshal_json_response(models.Server, http_res)
|
|
572
538
|
if utils.match_response(
|
|
573
539
|
http_res, ["400", "402", "422"], "application/vnd.api+json"
|
|
574
540
|
):
|
|
575
|
-
response_data =
|
|
576
|
-
raise models.ErrorObject(
|
|
541
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
542
|
+
raise models.ErrorObject(response_data, http_res)
|
|
577
543
|
if utils.match_response(http_res, "4XX", "*"):
|
|
578
544
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
579
|
-
raise models.APIError(
|
|
580
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
581
|
-
)
|
|
545
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
582
546
|
if utils.match_response(http_res, "5XX", "*"):
|
|
583
547
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
584
|
-
raise models.APIError(
|
|
585
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
586
|
-
)
|
|
548
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
587
549
|
|
|
588
|
-
|
|
589
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
590
|
-
raise models.APIError(
|
|
591
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
592
|
-
http_res.status_code,
|
|
593
|
-
http_res_text,
|
|
594
|
-
http_res,
|
|
595
|
-
)
|
|
550
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
596
551
|
|
|
597
552
|
def get(
|
|
598
553
|
self,
|
|
@@ -671,26 +626,15 @@ class ServersSDK(BaseSDK):
|
|
|
671
626
|
)
|
|
672
627
|
|
|
673
628
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
674
|
-
return
|
|
629
|
+
return unmarshal_json_response(models.Server, http_res)
|
|
675
630
|
if utils.match_response(http_res, "4XX", "*"):
|
|
676
631
|
http_res_text = utils.stream_to_text(http_res)
|
|
677
|
-
raise models.APIError(
|
|
678
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
679
|
-
)
|
|
632
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
680
633
|
if utils.match_response(http_res, "5XX", "*"):
|
|
681
634
|
http_res_text = utils.stream_to_text(http_res)
|
|
682
|
-
raise models.APIError(
|
|
683
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
684
|
-
)
|
|
635
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
685
636
|
|
|
686
|
-
|
|
687
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
688
|
-
raise models.APIError(
|
|
689
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
690
|
-
http_res.status_code,
|
|
691
|
-
http_res_text,
|
|
692
|
-
http_res,
|
|
693
|
-
)
|
|
637
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
694
638
|
|
|
695
639
|
async def get_async(
|
|
696
640
|
self,
|
|
@@ -769,26 +713,15 @@ class ServersSDK(BaseSDK):
|
|
|
769
713
|
)
|
|
770
714
|
|
|
771
715
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
772
|
-
return
|
|
716
|
+
return unmarshal_json_response(models.Server, http_res)
|
|
773
717
|
if utils.match_response(http_res, "4XX", "*"):
|
|
774
718
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
775
|
-
raise models.APIError(
|
|
776
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
777
|
-
)
|
|
719
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
778
720
|
if utils.match_response(http_res, "5XX", "*"):
|
|
779
721
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
780
|
-
raise models.APIError(
|
|
781
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
782
|
-
)
|
|
722
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
783
723
|
|
|
784
|
-
|
|
785
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
786
|
-
raise models.APIError(
|
|
787
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
788
|
-
http_res.status_code,
|
|
789
|
-
http_res_text,
|
|
790
|
-
http_res,
|
|
791
|
-
)
|
|
724
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
792
725
|
|
|
793
726
|
def update(
|
|
794
727
|
self,
|
|
@@ -898,30 +831,19 @@ class ServersSDK(BaseSDK):
|
|
|
898
831
|
if utils.match_response(http_res, "200", "*"):
|
|
899
832
|
return
|
|
900
833
|
if utils.match_response(http_res, ["400", "422"], "application/vnd.api+json"):
|
|
901
|
-
response_data =
|
|
902
|
-
raise models.ServerError(
|
|
834
|
+
response_data = unmarshal_json_response(models.ServerErrorData, http_res)
|
|
835
|
+
raise models.ServerError(response_data, http_res)
|
|
903
836
|
if utils.match_response(http_res, ["402", "423"], "application/vnd.api+json"):
|
|
904
|
-
response_data =
|
|
905
|
-
raise models.ErrorObject(
|
|
837
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
838
|
+
raise models.ErrorObject(response_data, http_res)
|
|
906
839
|
if utils.match_response(http_res, "4XX", "*"):
|
|
907
840
|
http_res_text = utils.stream_to_text(http_res)
|
|
908
|
-
raise models.APIError(
|
|
909
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
910
|
-
)
|
|
841
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
911
842
|
if utils.match_response(http_res, "5XX", "*"):
|
|
912
843
|
http_res_text = utils.stream_to_text(http_res)
|
|
913
|
-
raise models.APIError(
|
|
914
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
915
|
-
)
|
|
844
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
916
845
|
|
|
917
|
-
|
|
918
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
919
|
-
raise models.APIError(
|
|
920
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
921
|
-
http_res.status_code,
|
|
922
|
-
http_res_text,
|
|
923
|
-
http_res,
|
|
924
|
-
)
|
|
846
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
925
847
|
|
|
926
848
|
async def update_async(
|
|
927
849
|
self,
|
|
@@ -1031,30 +953,19 @@ class ServersSDK(BaseSDK):
|
|
|
1031
953
|
if utils.match_response(http_res, "200", "*"):
|
|
1032
954
|
return
|
|
1033
955
|
if utils.match_response(http_res, ["400", "422"], "application/vnd.api+json"):
|
|
1034
|
-
response_data =
|
|
1035
|
-
raise models.ServerError(
|
|
956
|
+
response_data = unmarshal_json_response(models.ServerErrorData, http_res)
|
|
957
|
+
raise models.ServerError(response_data, http_res)
|
|
1036
958
|
if utils.match_response(http_res, ["402", "423"], "application/vnd.api+json"):
|
|
1037
|
-
response_data =
|
|
1038
|
-
raise models.ErrorObject(
|
|
959
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
960
|
+
raise models.ErrorObject(response_data, http_res)
|
|
1039
961
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1040
962
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1041
|
-
raise models.APIError(
|
|
1042
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1043
|
-
)
|
|
963
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1044
964
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1045
965
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1046
|
-
raise models.APIError(
|
|
1047
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1048
|
-
)
|
|
966
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1049
967
|
|
|
1050
|
-
|
|
1051
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1052
|
-
raise models.APIError(
|
|
1053
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1054
|
-
http_res.status_code,
|
|
1055
|
-
http_res_text,
|
|
1056
|
-
http_res,
|
|
1057
|
-
)
|
|
968
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1058
969
|
|
|
1059
970
|
def delete(
|
|
1060
971
|
self,
|
|
@@ -1135,27 +1046,16 @@ class ServersSDK(BaseSDK):
|
|
|
1135
1046
|
if utils.match_response(
|
|
1136
1047
|
http_res, ["403", "406", "422"], "application/vnd.api+json"
|
|
1137
1048
|
):
|
|
1138
|
-
response_data =
|
|
1139
|
-
raise models.ErrorObject(
|
|
1049
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
1050
|
+
raise models.ErrorObject(response_data, http_res)
|
|
1140
1051
|
if utils.match_response(http_res, ["423", "4XX"], "*"):
|
|
1141
1052
|
http_res_text = utils.stream_to_text(http_res)
|
|
1142
|
-
raise models.APIError(
|
|
1143
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1144
|
-
)
|
|
1053
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1145
1054
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1146
1055
|
http_res_text = utils.stream_to_text(http_res)
|
|
1147
|
-
raise models.APIError(
|
|
1148
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1149
|
-
)
|
|
1056
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1150
1057
|
|
|
1151
|
-
|
|
1152
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1153
|
-
raise models.APIError(
|
|
1154
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1155
|
-
http_res.status_code,
|
|
1156
|
-
http_res_text,
|
|
1157
|
-
http_res,
|
|
1158
|
-
)
|
|
1058
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1159
1059
|
|
|
1160
1060
|
async def delete_async(
|
|
1161
1061
|
self,
|
|
@@ -1236,27 +1136,16 @@ class ServersSDK(BaseSDK):
|
|
|
1236
1136
|
if utils.match_response(
|
|
1237
1137
|
http_res, ["403", "406", "422"], "application/vnd.api+json"
|
|
1238
1138
|
):
|
|
1239
|
-
response_data =
|
|
1240
|
-
raise models.ErrorObject(
|
|
1139
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
1140
|
+
raise models.ErrorObject(response_data, http_res)
|
|
1241
1141
|
if utils.match_response(http_res, ["423", "4XX"], "*"):
|
|
1242
1142
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1243
|
-
raise models.APIError(
|
|
1244
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1245
|
-
)
|
|
1143
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1246
1144
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1247
1145
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1248
|
-
raise models.APIError(
|
|
1249
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1250
|
-
)
|
|
1146
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1251
1147
|
|
|
1252
|
-
|
|
1253
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1254
|
-
raise models.APIError(
|
|
1255
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1256
|
-
http_res.status_code,
|
|
1257
|
-
http_res_text,
|
|
1258
|
-
http_res,
|
|
1259
|
-
)
|
|
1148
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1260
1149
|
|
|
1261
1150
|
def get_deploy_config(
|
|
1262
1151
|
self,
|
|
@@ -1329,26 +1218,15 @@ class ServersSDK(BaseSDK):
|
|
|
1329
1218
|
)
|
|
1330
1219
|
|
|
1331
1220
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1332
|
-
return
|
|
1221
|
+
return unmarshal_json_response(models.DeployConfig, http_res)
|
|
1333
1222
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1334
1223
|
http_res_text = utils.stream_to_text(http_res)
|
|
1335
|
-
raise models.APIError(
|
|
1336
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1337
|
-
)
|
|
1224
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1338
1225
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1339
1226
|
http_res_text = utils.stream_to_text(http_res)
|
|
1340
|
-
raise models.APIError(
|
|
1341
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1342
|
-
)
|
|
1227
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1343
1228
|
|
|
1344
|
-
|
|
1345
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1346
|
-
raise models.APIError(
|
|
1347
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1348
|
-
http_res.status_code,
|
|
1349
|
-
http_res_text,
|
|
1350
|
-
http_res,
|
|
1351
|
-
)
|
|
1229
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1352
1230
|
|
|
1353
1231
|
async def get_deploy_config_async(
|
|
1354
1232
|
self,
|
|
@@ -1421,26 +1299,15 @@ class ServersSDK(BaseSDK):
|
|
|
1421
1299
|
)
|
|
1422
1300
|
|
|
1423
1301
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1424
|
-
return
|
|
1302
|
+
return unmarshal_json_response(models.DeployConfig, http_res)
|
|
1425
1303
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1426
1304
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1427
|
-
raise models.APIError(
|
|
1428
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1429
|
-
)
|
|
1305
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1430
1306
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1431
1307
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1432
|
-
raise models.APIError(
|
|
1433
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1434
|
-
)
|
|
1308
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1435
1309
|
|
|
1436
|
-
|
|
1437
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1438
|
-
raise models.APIError(
|
|
1439
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1440
|
-
http_res.status_code,
|
|
1441
|
-
http_res_text,
|
|
1442
|
-
http_res,
|
|
1443
|
-
)
|
|
1310
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1444
1311
|
|
|
1445
1312
|
def update_deploy_config(
|
|
1446
1313
|
self,
|
|
@@ -1537,34 +1404,23 @@ class ServersSDK(BaseSDK):
|
|
|
1537
1404
|
|
|
1538
1405
|
response_data: Any = None
|
|
1539
1406
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1540
|
-
return
|
|
1407
|
+
return unmarshal_json_response(models.DeployConfig, http_res)
|
|
1541
1408
|
if utils.match_response(http_res, ["403", "406"], "application/vnd.api+json"):
|
|
1542
|
-
response_data =
|
|
1543
|
-
raise models.ErrorObject(
|
|
1409
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
1410
|
+
raise models.ErrorObject(response_data, http_res)
|
|
1544
1411
|
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
1545
|
-
response_data =
|
|
1546
|
-
|
|
1412
|
+
response_data = unmarshal_json_response(
|
|
1413
|
+
models.DeployConfigErrorData, http_res
|
|
1547
1414
|
)
|
|
1548
|
-
raise models.DeployConfigError(
|
|
1415
|
+
raise models.DeployConfigError(response_data, http_res)
|
|
1549
1416
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1550
1417
|
http_res_text = utils.stream_to_text(http_res)
|
|
1551
|
-
raise models.APIError(
|
|
1552
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1553
|
-
)
|
|
1418
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1554
1419
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1555
1420
|
http_res_text = utils.stream_to_text(http_res)
|
|
1556
|
-
raise models.APIError(
|
|
1557
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1558
|
-
)
|
|
1421
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1559
1422
|
|
|
1560
|
-
|
|
1561
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1562
|
-
raise models.APIError(
|
|
1563
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1564
|
-
http_res.status_code,
|
|
1565
|
-
http_res_text,
|
|
1566
|
-
http_res,
|
|
1567
|
-
)
|
|
1423
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1568
1424
|
|
|
1569
1425
|
async def update_deploy_config_async(
|
|
1570
1426
|
self,
|
|
@@ -1661,34 +1517,23 @@ class ServersSDK(BaseSDK):
|
|
|
1661
1517
|
|
|
1662
1518
|
response_data: Any = None
|
|
1663
1519
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1664
|
-
return
|
|
1520
|
+
return unmarshal_json_response(models.DeployConfig, http_res)
|
|
1665
1521
|
if utils.match_response(http_res, ["403", "406"], "application/vnd.api+json"):
|
|
1666
|
-
response_data =
|
|
1667
|
-
raise models.ErrorObject(
|
|
1522
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
1523
|
+
raise models.ErrorObject(response_data, http_res)
|
|
1668
1524
|
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
1669
|
-
response_data =
|
|
1670
|
-
|
|
1525
|
+
response_data = unmarshal_json_response(
|
|
1526
|
+
models.DeployConfigErrorData, http_res
|
|
1671
1527
|
)
|
|
1672
|
-
raise models.DeployConfigError(
|
|
1528
|
+
raise models.DeployConfigError(response_data, http_res)
|
|
1673
1529
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1674
1530
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1675
|
-
raise models.APIError(
|
|
1676
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1677
|
-
)
|
|
1531
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1678
1532
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1679
1533
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1680
|
-
raise models.APIError(
|
|
1681
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1682
|
-
)
|
|
1534
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1683
1535
|
|
|
1684
|
-
|
|
1685
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1686
|
-
raise models.APIError(
|
|
1687
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1688
|
-
http_res.status_code,
|
|
1689
|
-
http_res_text,
|
|
1690
|
-
http_res,
|
|
1691
|
-
)
|
|
1536
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1692
1537
|
|
|
1693
1538
|
def lock(
|
|
1694
1539
|
self,
|
|
@@ -1763,26 +1608,15 @@ class ServersSDK(BaseSDK):
|
|
|
1763
1608
|
)
|
|
1764
1609
|
|
|
1765
1610
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1766
|
-
return
|
|
1611
|
+
return unmarshal_json_response(models.Server1, http_res)
|
|
1767
1612
|
if utils.match_response(http_res, ["403", "404", "4XX"], "*"):
|
|
1768
1613
|
http_res_text = utils.stream_to_text(http_res)
|
|
1769
|
-
raise models.APIError(
|
|
1770
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1771
|
-
)
|
|
1614
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1772
1615
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1773
1616
|
http_res_text = utils.stream_to_text(http_res)
|
|
1774
|
-
raise models.APIError(
|
|
1775
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1776
|
-
)
|
|
1617
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1777
1618
|
|
|
1778
|
-
|
|
1779
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1780
|
-
raise models.APIError(
|
|
1781
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1782
|
-
http_res.status_code,
|
|
1783
|
-
http_res_text,
|
|
1784
|
-
http_res,
|
|
1785
|
-
)
|
|
1619
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1786
1620
|
|
|
1787
1621
|
async def lock_async(
|
|
1788
1622
|
self,
|
|
@@ -1857,26 +1691,15 @@ class ServersSDK(BaseSDK):
|
|
|
1857
1691
|
)
|
|
1858
1692
|
|
|
1859
1693
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1860
|
-
return
|
|
1694
|
+
return unmarshal_json_response(models.Server1, http_res)
|
|
1861
1695
|
if utils.match_response(http_res, ["403", "404", "4XX"], "*"):
|
|
1862
1696
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1863
|
-
raise models.APIError(
|
|
1864
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1865
|
-
)
|
|
1697
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1866
1698
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1867
1699
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1868
|
-
raise models.APIError(
|
|
1869
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1870
|
-
)
|
|
1700
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1871
1701
|
|
|
1872
|
-
|
|
1873
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1874
|
-
raise models.APIError(
|
|
1875
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1876
|
-
http_res.status_code,
|
|
1877
|
-
http_res_text,
|
|
1878
|
-
http_res,
|
|
1879
|
-
)
|
|
1702
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1880
1703
|
|
|
1881
1704
|
def unlock(
|
|
1882
1705
|
self,
|
|
@@ -1951,26 +1774,15 @@ class ServersSDK(BaseSDK):
|
|
|
1951
1774
|
)
|
|
1952
1775
|
|
|
1953
1776
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
1954
|
-
return
|
|
1777
|
+
return unmarshal_json_response(models.Server1, http_res)
|
|
1955
1778
|
if utils.match_response(http_res, ["403", "404", "4XX"], "*"):
|
|
1956
1779
|
http_res_text = utils.stream_to_text(http_res)
|
|
1957
|
-
raise models.APIError(
|
|
1958
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1959
|
-
)
|
|
1780
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1960
1781
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1961
1782
|
http_res_text = utils.stream_to_text(http_res)
|
|
1962
|
-
raise models.APIError(
|
|
1963
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1964
|
-
)
|
|
1783
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
1965
1784
|
|
|
1966
|
-
|
|
1967
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1968
|
-
raise models.APIError(
|
|
1969
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1970
|
-
http_res.status_code,
|
|
1971
|
-
http_res_text,
|
|
1972
|
-
http_res,
|
|
1973
|
-
)
|
|
1785
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
1974
1786
|
|
|
1975
1787
|
async def unlock_async(
|
|
1976
1788
|
self,
|
|
@@ -2045,26 +1857,15 @@ class ServersSDK(BaseSDK):
|
|
|
2045
1857
|
)
|
|
2046
1858
|
|
|
2047
1859
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
2048
|
-
return
|
|
1860
|
+
return unmarshal_json_response(models.Server1, http_res)
|
|
2049
1861
|
if utils.match_response(http_res, ["403", "404", "4XX"], "*"):
|
|
2050
1862
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2051
|
-
raise models.APIError(
|
|
2052
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2053
|
-
)
|
|
1863
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2054
1864
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2055
1865
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2056
|
-
raise models.APIError(
|
|
2057
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2058
|
-
)
|
|
1866
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2059
1867
|
|
|
2060
|
-
|
|
2061
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2062
|
-
raise models.APIError(
|
|
2063
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2064
|
-
http_res.status_code,
|
|
2065
|
-
http_res_text,
|
|
2066
|
-
http_res,
|
|
2067
|
-
)
|
|
1868
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
2068
1869
|
|
|
2069
1870
|
def create_out_of_band_connection(
|
|
2070
1871
|
self,
|
|
@@ -2155,29 +1956,18 @@ class ServersSDK(BaseSDK):
|
|
|
2155
1956
|
|
|
2156
1957
|
response_data: Any = None
|
|
2157
1958
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
2158
|
-
return
|
|
1959
|
+
return unmarshal_json_response(models.OutOfBandConnection, http_res)
|
|
2159
1960
|
if utils.match_response(http_res, ["403", "404"], "application/vnd.api+json"):
|
|
2160
|
-
response_data =
|
|
2161
|
-
raise models.ErrorObject(
|
|
1961
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
1962
|
+
raise models.ErrorObject(response_data, http_res)
|
|
2162
1963
|
if utils.match_response(http_res, ["406", "4XX"], "*"):
|
|
2163
1964
|
http_res_text = utils.stream_to_text(http_res)
|
|
2164
|
-
raise models.APIError(
|
|
2165
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2166
|
-
)
|
|
1965
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2167
1966
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2168
1967
|
http_res_text = utils.stream_to_text(http_res)
|
|
2169
|
-
raise models.APIError(
|
|
2170
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2171
|
-
)
|
|
1968
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2172
1969
|
|
|
2173
|
-
|
|
2174
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2175
|
-
raise models.APIError(
|
|
2176
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2177
|
-
http_res.status_code,
|
|
2178
|
-
http_res_text,
|
|
2179
|
-
http_res,
|
|
2180
|
-
)
|
|
1970
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
2181
1971
|
|
|
2182
1972
|
async def create_out_of_band_connection_async(
|
|
2183
1973
|
self,
|
|
@@ -2268,29 +2058,18 @@ class ServersSDK(BaseSDK):
|
|
|
2268
2058
|
|
|
2269
2059
|
response_data: Any = None
|
|
2270
2060
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
2271
|
-
return
|
|
2061
|
+
return unmarshal_json_response(models.OutOfBandConnection, http_res)
|
|
2272
2062
|
if utils.match_response(http_res, ["403", "404"], "application/vnd.api+json"):
|
|
2273
|
-
response_data =
|
|
2274
|
-
raise models.ErrorObject(
|
|
2063
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2064
|
+
raise models.ErrorObject(response_data, http_res)
|
|
2275
2065
|
if utils.match_response(http_res, ["406", "4XX"], "*"):
|
|
2276
2066
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2277
|
-
raise models.APIError(
|
|
2278
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2279
|
-
)
|
|
2067
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2280
2068
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2281
2069
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2282
|
-
raise models.APIError(
|
|
2283
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2284
|
-
)
|
|
2070
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2285
2071
|
|
|
2286
|
-
|
|
2287
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2288
|
-
raise models.APIError(
|
|
2289
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2290
|
-
http_res.status_code,
|
|
2291
|
-
http_res_text,
|
|
2292
|
-
http_res,
|
|
2293
|
-
)
|
|
2072
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
2294
2073
|
|
|
2295
2074
|
def list_out_of_band_connections(
|
|
2296
2075
|
self,
|
|
@@ -2364,29 +2143,18 @@ class ServersSDK(BaseSDK):
|
|
|
2364
2143
|
|
|
2365
2144
|
response_data: Any = None
|
|
2366
2145
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
2367
|
-
return
|
|
2146
|
+
return unmarshal_json_response(models.OutOfBandConnection, http_res)
|
|
2368
2147
|
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
2369
|
-
response_data =
|
|
2370
|
-
raise models.ErrorObject(
|
|
2148
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2149
|
+
raise models.ErrorObject(response_data, http_res)
|
|
2371
2150
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2372
2151
|
http_res_text = utils.stream_to_text(http_res)
|
|
2373
|
-
raise models.APIError(
|
|
2374
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2375
|
-
)
|
|
2152
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2376
2153
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2377
2154
|
http_res_text = utils.stream_to_text(http_res)
|
|
2378
|
-
raise models.APIError(
|
|
2379
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2380
|
-
)
|
|
2155
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2381
2156
|
|
|
2382
|
-
|
|
2383
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2384
|
-
raise models.APIError(
|
|
2385
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2386
|
-
http_res.status_code,
|
|
2387
|
-
http_res_text,
|
|
2388
|
-
http_res,
|
|
2389
|
-
)
|
|
2157
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
2390
2158
|
|
|
2391
2159
|
async def list_out_of_band_connections_async(
|
|
2392
2160
|
self,
|
|
@@ -2460,29 +2228,18 @@ class ServersSDK(BaseSDK):
|
|
|
2460
2228
|
|
|
2461
2229
|
response_data: Any = None
|
|
2462
2230
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
2463
|
-
return
|
|
2231
|
+
return unmarshal_json_response(models.OutOfBandConnection, http_res)
|
|
2464
2232
|
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
2465
|
-
response_data =
|
|
2466
|
-
raise models.ErrorObject(
|
|
2233
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2234
|
+
raise models.ErrorObject(response_data, http_res)
|
|
2467
2235
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2468
2236
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2469
|
-
raise models.APIError(
|
|
2470
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2471
|
-
)
|
|
2237
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2472
2238
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2473
2239
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2474
|
-
raise models.APIError(
|
|
2475
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2476
|
-
)
|
|
2240
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2477
2241
|
|
|
2478
|
-
|
|
2479
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2480
|
-
raise models.APIError(
|
|
2481
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2482
|
-
http_res.status_code,
|
|
2483
|
-
http_res_text,
|
|
2484
|
-
http_res,
|
|
2485
|
-
)
|
|
2242
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
2486
2243
|
|
|
2487
2244
|
def actions(
|
|
2488
2245
|
self,
|
|
@@ -2579,29 +2336,18 @@ class ServersSDK(BaseSDK):
|
|
|
2579
2336
|
|
|
2580
2337
|
response_data: Any = None
|
|
2581
2338
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
2582
|
-
return
|
|
2339
|
+
return unmarshal_json_response(models.ServerAction, http_res)
|
|
2583
2340
|
if utils.match_response(http_res, "403", "application/vnd.api+json"):
|
|
2584
|
-
response_data =
|
|
2585
|
-
raise models.ErrorObject(
|
|
2341
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2342
|
+
raise models.ErrorObject(response_data, http_res)
|
|
2586
2343
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2587
2344
|
http_res_text = utils.stream_to_text(http_res)
|
|
2588
|
-
raise models.APIError(
|
|
2589
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2590
|
-
)
|
|
2345
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2591
2346
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2592
2347
|
http_res_text = utils.stream_to_text(http_res)
|
|
2593
|
-
raise models.APIError(
|
|
2594
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2595
|
-
)
|
|
2348
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2596
2349
|
|
|
2597
|
-
|
|
2598
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2599
|
-
raise models.APIError(
|
|
2600
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2601
|
-
http_res.status_code,
|
|
2602
|
-
http_res_text,
|
|
2603
|
-
http_res,
|
|
2604
|
-
)
|
|
2350
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
2605
2351
|
|
|
2606
2352
|
async def actions_async(
|
|
2607
2353
|
self,
|
|
@@ -2698,29 +2444,18 @@ class ServersSDK(BaseSDK):
|
|
|
2698
2444
|
|
|
2699
2445
|
response_data: Any = None
|
|
2700
2446
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
2701
|
-
return
|
|
2447
|
+
return unmarshal_json_response(models.ServerAction, http_res)
|
|
2702
2448
|
if utils.match_response(http_res, "403", "application/vnd.api+json"):
|
|
2703
|
-
response_data =
|
|
2704
|
-
raise models.ErrorObject(
|
|
2449
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2450
|
+
raise models.ErrorObject(response_data, http_res)
|
|
2705
2451
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2706
2452
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2707
|
-
raise models.APIError(
|
|
2708
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2709
|
-
)
|
|
2453
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2710
2454
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2711
2455
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2712
|
-
raise models.APIError(
|
|
2713
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2714
|
-
)
|
|
2456
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2715
2457
|
|
|
2716
|
-
|
|
2717
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2718
|
-
raise models.APIError(
|
|
2719
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2720
|
-
http_res.status_code,
|
|
2721
|
-
http_res_text,
|
|
2722
|
-
http_res,
|
|
2723
|
-
)
|
|
2458
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
2724
2459
|
|
|
2725
2460
|
def create_ipmi_session(
|
|
2726
2461
|
self,
|
|
@@ -2800,31 +2535,20 @@ class ServersSDK(BaseSDK):
|
|
|
2800
2535
|
|
|
2801
2536
|
response_data: Any = None
|
|
2802
2537
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
2803
|
-
return
|
|
2538
|
+
return unmarshal_json_response(models.IpmiSession, http_res)
|
|
2804
2539
|
if utils.match_response(
|
|
2805
2540
|
http_res, ["403", "404", "422"], "application/vnd.api+json"
|
|
2806
2541
|
):
|
|
2807
|
-
response_data =
|
|
2808
|
-
raise models.ErrorObject(
|
|
2542
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2543
|
+
raise models.ErrorObject(response_data, http_res)
|
|
2809
2544
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2810
2545
|
http_res_text = utils.stream_to_text(http_res)
|
|
2811
|
-
raise models.APIError(
|
|
2812
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2813
|
-
)
|
|
2546
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2814
2547
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2815
2548
|
http_res_text = utils.stream_to_text(http_res)
|
|
2816
|
-
raise models.APIError(
|
|
2817
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2818
|
-
)
|
|
2549
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2819
2550
|
|
|
2820
|
-
|
|
2821
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2822
|
-
raise models.APIError(
|
|
2823
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2824
|
-
http_res.status_code,
|
|
2825
|
-
http_res_text,
|
|
2826
|
-
http_res,
|
|
2827
|
-
)
|
|
2551
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
2828
2552
|
|
|
2829
2553
|
async def create_ipmi_session_async(
|
|
2830
2554
|
self,
|
|
@@ -2904,31 +2628,20 @@ class ServersSDK(BaseSDK):
|
|
|
2904
2628
|
|
|
2905
2629
|
response_data: Any = None
|
|
2906
2630
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
2907
|
-
return
|
|
2631
|
+
return unmarshal_json_response(models.IpmiSession, http_res)
|
|
2908
2632
|
if utils.match_response(
|
|
2909
2633
|
http_res, ["403", "404", "422"], "application/vnd.api+json"
|
|
2910
2634
|
):
|
|
2911
|
-
response_data =
|
|
2912
|
-
raise models.ErrorObject(
|
|
2635
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2636
|
+
raise models.ErrorObject(response_data, http_res)
|
|
2913
2637
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2914
2638
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2915
|
-
raise models.APIError(
|
|
2916
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2917
|
-
)
|
|
2639
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2918
2640
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2919
2641
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2920
|
-
raise models.APIError(
|
|
2921
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2922
|
-
)
|
|
2642
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
2923
2643
|
|
|
2924
|
-
|
|
2925
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2926
|
-
raise models.APIError(
|
|
2927
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2928
|
-
http_res.status_code,
|
|
2929
|
-
http_res_text,
|
|
2930
|
-
http_res,
|
|
2931
|
-
)
|
|
2644
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
2932
2645
|
|
|
2933
2646
|
def start_rescue_mode(
|
|
2934
2647
|
self,
|
|
@@ -3004,29 +2717,18 @@ class ServersSDK(BaseSDK):
|
|
|
3004
2717
|
|
|
3005
2718
|
response_data: Any = None
|
|
3006
2719
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
3007
|
-
return
|
|
2720
|
+
return unmarshal_json_response(models.ServerRescue, http_res)
|
|
3008
2721
|
if utils.match_response(http_res, ["403", "406"], "application/vnd.api+json"):
|
|
3009
|
-
response_data =
|
|
3010
|
-
raise models.ErrorObject(
|
|
2722
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2723
|
+
raise models.ErrorObject(response_data, http_res)
|
|
3011
2724
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3012
2725
|
http_res_text = utils.stream_to_text(http_res)
|
|
3013
|
-
raise models.APIError(
|
|
3014
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3015
|
-
)
|
|
2726
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3016
2727
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3017
2728
|
http_res_text = utils.stream_to_text(http_res)
|
|
3018
|
-
raise models.APIError(
|
|
3019
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3020
|
-
)
|
|
2729
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3021
2730
|
|
|
3022
|
-
|
|
3023
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
3024
|
-
raise models.APIError(
|
|
3025
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3026
|
-
http_res.status_code,
|
|
3027
|
-
http_res_text,
|
|
3028
|
-
http_res,
|
|
3029
|
-
)
|
|
2731
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
3030
2732
|
|
|
3031
2733
|
async def start_rescue_mode_async(
|
|
3032
2734
|
self,
|
|
@@ -3102,29 +2804,18 @@ class ServersSDK(BaseSDK):
|
|
|
3102
2804
|
|
|
3103
2805
|
response_data: Any = None
|
|
3104
2806
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
3105
|
-
return
|
|
2807
|
+
return unmarshal_json_response(models.ServerRescue, http_res)
|
|
3106
2808
|
if utils.match_response(http_res, ["403", "406"], "application/vnd.api+json"):
|
|
3107
|
-
response_data =
|
|
3108
|
-
raise models.ErrorObject(
|
|
2809
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2810
|
+
raise models.ErrorObject(response_data, http_res)
|
|
3109
2811
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3110
2812
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3111
|
-
raise models.APIError(
|
|
3112
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3113
|
-
)
|
|
2813
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3114
2814
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3115
2815
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3116
|
-
raise models.APIError(
|
|
3117
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3118
|
-
)
|
|
2816
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3119
2817
|
|
|
3120
|
-
|
|
3121
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3122
|
-
raise models.APIError(
|
|
3123
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3124
|
-
http_res.status_code,
|
|
3125
|
-
http_res_text,
|
|
3126
|
-
http_res,
|
|
3127
|
-
)
|
|
2818
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
3128
2819
|
|
|
3129
2820
|
def exit_rescue_mode(
|
|
3130
2821
|
self,
|
|
@@ -3200,29 +2891,18 @@ class ServersSDK(BaseSDK):
|
|
|
3200
2891
|
|
|
3201
2892
|
response_data: Any = None
|
|
3202
2893
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
3203
|
-
return
|
|
2894
|
+
return unmarshal_json_response(models.ServerRescue, http_res)
|
|
3204
2895
|
if utils.match_response(http_res, ["403", "406"], "application/vnd.api+json"):
|
|
3205
|
-
response_data =
|
|
3206
|
-
raise models.ErrorObject(
|
|
2896
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2897
|
+
raise models.ErrorObject(response_data, http_res)
|
|
3207
2898
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3208
2899
|
http_res_text = utils.stream_to_text(http_res)
|
|
3209
|
-
raise models.APIError(
|
|
3210
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3211
|
-
)
|
|
2900
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3212
2901
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3213
2902
|
http_res_text = utils.stream_to_text(http_res)
|
|
3214
|
-
raise models.APIError(
|
|
3215
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3216
|
-
)
|
|
2903
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3217
2904
|
|
|
3218
|
-
|
|
3219
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
3220
|
-
raise models.APIError(
|
|
3221
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3222
|
-
http_res.status_code,
|
|
3223
|
-
http_res_text,
|
|
3224
|
-
http_res,
|
|
3225
|
-
)
|
|
2905
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
3226
2906
|
|
|
3227
2907
|
async def exit_rescue_mode_async(
|
|
3228
2908
|
self,
|
|
@@ -3298,29 +2978,18 @@ class ServersSDK(BaseSDK):
|
|
|
3298
2978
|
|
|
3299
2979
|
response_data: Any = None
|
|
3300
2980
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
3301
|
-
return
|
|
2981
|
+
return unmarshal_json_response(models.ServerRescue, http_res)
|
|
3302
2982
|
if utils.match_response(http_res, ["403", "406"], "application/vnd.api+json"):
|
|
3303
|
-
response_data =
|
|
3304
|
-
raise models.ErrorObject(
|
|
2983
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
2984
|
+
raise models.ErrorObject(response_data, http_res)
|
|
3305
2985
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3306
2986
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3307
|
-
raise models.APIError(
|
|
3308
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3309
|
-
)
|
|
2987
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3310
2988
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3311
2989
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3312
|
-
raise models.APIError(
|
|
3313
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3314
|
-
)
|
|
2990
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3315
2991
|
|
|
3316
|
-
|
|
3317
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3318
|
-
raise models.APIError(
|
|
3319
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3320
|
-
http_res.status_code,
|
|
3321
|
-
http_res_text,
|
|
3322
|
-
http_res,
|
|
3323
|
-
)
|
|
2992
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
3324
2993
|
|
|
3325
2994
|
def schedule_deletion(
|
|
3326
2995
|
self,
|
|
@@ -3396,31 +3065,20 @@ class ServersSDK(BaseSDK):
|
|
|
3396
3065
|
|
|
3397
3066
|
response_data: Any = None
|
|
3398
3067
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
3399
|
-
return
|
|
3068
|
+
return unmarshal_json_response(models.ServerScheduleDeletion, http_res)
|
|
3400
3069
|
if utils.match_response(
|
|
3401
3070
|
http_res, ["403", "406", "423"], "application/vnd.api+json"
|
|
3402
3071
|
):
|
|
3403
|
-
response_data =
|
|
3404
|
-
raise models.ErrorObject(
|
|
3072
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
3073
|
+
raise models.ErrorObject(response_data, http_res)
|
|
3405
3074
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3406
3075
|
http_res_text = utils.stream_to_text(http_res)
|
|
3407
|
-
raise models.APIError(
|
|
3408
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3409
|
-
)
|
|
3076
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3410
3077
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3411
3078
|
http_res_text = utils.stream_to_text(http_res)
|
|
3412
|
-
raise models.APIError(
|
|
3413
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3414
|
-
)
|
|
3079
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3415
3080
|
|
|
3416
|
-
|
|
3417
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
3418
|
-
raise models.APIError(
|
|
3419
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3420
|
-
http_res.status_code,
|
|
3421
|
-
http_res_text,
|
|
3422
|
-
http_res,
|
|
3423
|
-
)
|
|
3081
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
3424
3082
|
|
|
3425
3083
|
async def schedule_deletion_async(
|
|
3426
3084
|
self,
|
|
@@ -3496,31 +3154,20 @@ class ServersSDK(BaseSDK):
|
|
|
3496
3154
|
|
|
3497
3155
|
response_data: Any = None
|
|
3498
3156
|
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
3499
|
-
return
|
|
3157
|
+
return unmarshal_json_response(models.ServerScheduleDeletion, http_res)
|
|
3500
3158
|
if utils.match_response(
|
|
3501
3159
|
http_res, ["403", "406", "423"], "application/vnd.api+json"
|
|
3502
3160
|
):
|
|
3503
|
-
response_data =
|
|
3504
|
-
raise models.ErrorObject(
|
|
3161
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
3162
|
+
raise models.ErrorObject(response_data, http_res)
|
|
3505
3163
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3506
3164
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3507
|
-
raise models.APIError(
|
|
3508
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3509
|
-
)
|
|
3165
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3510
3166
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3511
3167
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3512
|
-
raise models.APIError(
|
|
3513
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3514
|
-
)
|
|
3168
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3515
3169
|
|
|
3516
|
-
|
|
3517
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3518
|
-
raise models.APIError(
|
|
3519
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3520
|
-
http_res.status_code,
|
|
3521
|
-
http_res_text,
|
|
3522
|
-
http_res,
|
|
3523
|
-
)
|
|
3170
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
3524
3171
|
|
|
3525
3172
|
def unschedule_deletion(
|
|
3526
3173
|
self,
|
|
@@ -3598,27 +3245,16 @@ class ServersSDK(BaseSDK):
|
|
|
3598
3245
|
if utils.match_response(http_res, "204", "*"):
|
|
3599
3246
|
return
|
|
3600
3247
|
if utils.match_response(http_res, "403", "application/vnd.api+json"):
|
|
3601
|
-
response_data =
|
|
3602
|
-
raise models.ErrorObject(
|
|
3248
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
3249
|
+
raise models.ErrorObject(response_data, http_res)
|
|
3603
3250
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3604
3251
|
http_res_text = utils.stream_to_text(http_res)
|
|
3605
|
-
raise models.APIError(
|
|
3606
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3607
|
-
)
|
|
3252
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3608
3253
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3609
3254
|
http_res_text = utils.stream_to_text(http_res)
|
|
3610
|
-
raise models.APIError(
|
|
3611
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3612
|
-
)
|
|
3255
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3613
3256
|
|
|
3614
|
-
|
|
3615
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
3616
|
-
raise models.APIError(
|
|
3617
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3618
|
-
http_res.status_code,
|
|
3619
|
-
http_res_text,
|
|
3620
|
-
http_res,
|
|
3621
|
-
)
|
|
3257
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
3622
3258
|
|
|
3623
3259
|
async def unschedule_deletion_async(
|
|
3624
3260
|
self,
|
|
@@ -3696,27 +3332,16 @@ class ServersSDK(BaseSDK):
|
|
|
3696
3332
|
if utils.match_response(http_res, "204", "*"):
|
|
3697
3333
|
return
|
|
3698
3334
|
if utils.match_response(http_res, "403", "application/vnd.api+json"):
|
|
3699
|
-
response_data =
|
|
3700
|
-
raise models.ErrorObject(
|
|
3335
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
3336
|
+
raise models.ErrorObject(response_data, http_res)
|
|
3701
3337
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3702
3338
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3703
|
-
raise models.APIError(
|
|
3704
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3705
|
-
)
|
|
3339
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3706
3340
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3707
3341
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3708
|
-
raise models.APIError(
|
|
3709
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3710
|
-
)
|
|
3342
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3711
3343
|
|
|
3712
|
-
|
|
3713
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3714
|
-
raise models.APIError(
|
|
3715
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3716
|
-
http_res.status_code,
|
|
3717
|
-
http_res_text,
|
|
3718
|
-
http_res,
|
|
3719
|
-
)
|
|
3344
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
3720
3345
|
|
|
3721
3346
|
def reinstall(
|
|
3722
3347
|
self,
|
|
@@ -3811,30 +3436,19 @@ class ServersSDK(BaseSDK):
|
|
|
3811
3436
|
if utils.match_response(
|
|
3812
3437
|
http_res, ["403", "404", "422"], "application/vnd.api+json"
|
|
3813
3438
|
):
|
|
3814
|
-
response_data =
|
|
3815
|
-
raise models.ErrorObject(
|
|
3439
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
3440
|
+
raise models.ErrorObject(response_data, http_res)
|
|
3816
3441
|
if utils.match_response(http_res, "423", "application/vnd.api+json"):
|
|
3817
|
-
response_data =
|
|
3818
|
-
raise models.ServerError(
|
|
3442
|
+
response_data = unmarshal_json_response(models.ServerErrorData, http_res)
|
|
3443
|
+
raise models.ServerError(response_data, http_res)
|
|
3819
3444
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3820
3445
|
http_res_text = utils.stream_to_text(http_res)
|
|
3821
|
-
raise models.APIError(
|
|
3822
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3823
|
-
)
|
|
3446
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3824
3447
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3825
3448
|
http_res_text = utils.stream_to_text(http_res)
|
|
3826
|
-
raise models.APIError(
|
|
3827
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3828
|
-
)
|
|
3449
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3829
3450
|
|
|
3830
|
-
|
|
3831
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
3832
|
-
raise models.APIError(
|
|
3833
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3834
|
-
http_res.status_code,
|
|
3835
|
-
http_res_text,
|
|
3836
|
-
http_res,
|
|
3837
|
-
)
|
|
3451
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
3838
3452
|
|
|
3839
3453
|
async def reinstall_async(
|
|
3840
3454
|
self,
|
|
@@ -3929,27 +3543,16 @@ class ServersSDK(BaseSDK):
|
|
|
3929
3543
|
if utils.match_response(
|
|
3930
3544
|
http_res, ["403", "404", "422"], "application/vnd.api+json"
|
|
3931
3545
|
):
|
|
3932
|
-
response_data =
|
|
3933
|
-
raise models.ErrorObject(
|
|
3546
|
+
response_data = unmarshal_json_response(models.ErrorObjectData, http_res)
|
|
3547
|
+
raise models.ErrorObject(response_data, http_res)
|
|
3934
3548
|
if utils.match_response(http_res, "423", "application/vnd.api+json"):
|
|
3935
|
-
response_data =
|
|
3936
|
-
raise models.ServerError(
|
|
3549
|
+
response_data = unmarshal_json_response(models.ServerErrorData, http_res)
|
|
3550
|
+
raise models.ServerError(response_data, http_res)
|
|
3937
3551
|
if utils.match_response(http_res, "4XX", "*"):
|
|
3938
3552
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3939
|
-
raise models.APIError(
|
|
3940
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3941
|
-
)
|
|
3553
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3942
3554
|
if utils.match_response(http_res, "5XX", "*"):
|
|
3943
3555
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3944
|
-
raise models.APIError(
|
|
3945
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
3946
|
-
)
|
|
3556
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
3947
3557
|
|
|
3948
|
-
|
|
3949
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3950
|
-
raise models.APIError(
|
|
3951
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
3952
|
-
http_res.status_code,
|
|
3953
|
-
http_res_text,
|
|
3954
|
-
http_res,
|
|
3955
|
-
)
|
|
3558
|
+
raise models.APIError("Unexpected response received", http_res)
|