latitudesh-python-sdk 2.3.0__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.
- latitudesh_python_sdk/__init__.py +18 -0
- latitudesh_python_sdk/_hooks/__init__.py +5 -0
- latitudesh_python_sdk/_hooks/registration.py +13 -0
- latitudesh_python_sdk/_hooks/sdkhooks.py +76 -0
- latitudesh_python_sdk/_hooks/types.py +113 -0
- latitudesh_python_sdk/_version.py +17 -0
- latitudesh_python_sdk/apikeys.py +703 -0
- latitudesh_python_sdk/basesdk.py +374 -0
- latitudesh_python_sdk/billing.py +197 -0
- latitudesh_python_sdk/events_sdk.py +298 -0
- latitudesh_python_sdk/firewalls_sdk.py +1786 -0
- latitudesh_python_sdk/httpclient.py +125 -0
- latitudesh_python_sdk/ipaddresses_sdk.py +470 -0
- latitudesh_python_sdk/models/__init__.py +3581 -0
- latitudesh_python_sdk/models/api_key.py +81 -0
- latitudesh_python_sdk/models/apierror.py +40 -0
- latitudesh_python_sdk/models/assign_server_virtual_networkop.py +43 -0
- latitudesh_python_sdk/models/bandwidth_packages.py +67 -0
- latitudesh_python_sdk/models/bandwidth_plan_data.py +72 -0
- latitudesh_python_sdk/models/bandwidth_plans.py +26 -0
- latitudesh_python_sdk/models/billing_usage.py +249 -0
- latitudesh_python_sdk/models/container_plan_data.py +163 -0
- latitudesh_python_sdk/models/create_api_key.py +40 -0
- latitudesh_python_sdk/models/create_firewall_assignmentop.py +61 -0
- latitudesh_python_sdk/models/create_firewallop.py +73 -0
- latitudesh_python_sdk/models/create_ipmi_sessionop.py +16 -0
- latitudesh_python_sdk/models/create_projectop.py +79 -0
- latitudesh_python_sdk/models/create_server_actionop.py +69 -0
- latitudesh_python_sdk/models/create_server_out_of_bandop.py +61 -0
- latitudesh_python_sdk/models/create_server_reinstallop.py +140 -0
- latitudesh_python_sdk/models/create_serverop.py +173 -0
- latitudesh_python_sdk/models/create_tagop.py +50 -0
- latitudesh_python_sdk/models/create_virtual_machine_actionop.py +63 -0
- latitudesh_python_sdk/models/create_virtual_networkop.py +72 -0
- latitudesh_python_sdk/models/custom_tag.py +26 -0
- latitudesh_python_sdk/models/custom_tag_data.py +54 -0
- latitudesh_python_sdk/models/custom_tags.py +26 -0
- latitudesh_python_sdk/models/delete_api_keyop.py +16 -0
- latitudesh_python_sdk/models/delete_firewall_assignmentop.py +25 -0
- latitudesh_python_sdk/models/delete_firewallop.py +18 -0
- latitudesh_python_sdk/models/delete_project_ssh_keyop.py +23 -0
- latitudesh_python_sdk/models/delete_project_user_dataop.py +23 -0
- latitudesh_python_sdk/models/delete_projectop.py +18 -0
- latitudesh_python_sdk/models/delete_ssh_keyop.py +16 -0
- latitudesh_python_sdk/models/delete_storage_filesystemsop.py +16 -0
- latitudesh_python_sdk/models/delete_storage_volumesop.py +16 -0
- latitudesh_python_sdk/models/delete_user_dataop.py +16 -0
- latitudesh_python_sdk/models/delete_virtual_networks_assignmentsop.py +16 -0
- latitudesh_python_sdk/models/delete_vpn_sessionop.py +16 -0
- latitudesh_python_sdk/models/deploy_config.py +62 -0
- latitudesh_python_sdk/models/destroy_serverop.py +31 -0
- latitudesh_python_sdk/models/destroy_tagop.py +16 -0
- latitudesh_python_sdk/models/destroy_team_memberop.py +18 -0
- latitudesh_python_sdk/models/destroy_virtual_machineop.py +16 -0
- latitudesh_python_sdk/models/destroy_virtual_networkop.py +18 -0
- latitudesh_python_sdk/models/event_data.py +98 -0
- latitudesh_python_sdk/models/events.py +26 -0
- latitudesh_python_sdk/models/filesystem_data.py +57 -0
- latitudesh_python_sdk/models/firewall.py +26 -0
- latitudesh_python_sdk/models/firewall_assignment_data.py +50 -0
- latitudesh_python_sdk/models/firewall_assignments.py +29 -0
- latitudesh_python_sdk/models/firewall_data.py +75 -0
- latitudesh_python_sdk/models/firewall_server.py +36 -0
- latitudesh_python_sdk/models/firewalls.py +26 -0
- latitudesh_python_sdk/models/get_all_firewall_assignmentsop.py +51 -0
- latitudesh_python_sdk/models/get_bandwidth_plansop.py +62 -0
- latitudesh_python_sdk/models/get_billing_usageop.py +46 -0
- latitudesh_python_sdk/models/get_containers_planop.py +18 -0
- latitudesh_python_sdk/models/get_eventsop.py +126 -0
- latitudesh_python_sdk/models/get_firewall_assignmentsop.py +53 -0
- latitudesh_python_sdk/models/get_firewallop.py +18 -0
- latitudesh_python_sdk/models/get_ipop.py +33 -0
- latitudesh_python_sdk/models/get_ipsop.py +120 -0
- latitudesh_python_sdk/models/get_planop.py +16 -0
- latitudesh_python_sdk/models/get_plans_operating_systemop.py +54 -0
- latitudesh_python_sdk/models/get_plansop.py +125 -0
- latitudesh_python_sdk/models/get_project_ssh_keyop.py +37 -0
- latitudesh_python_sdk/models/get_project_ssh_keysop.py +33 -0
- latitudesh_python_sdk/models/get_project_user_dataop.py +38 -0
- latitudesh_python_sdk/models/get_project_users_dataop.py +46 -0
- latitudesh_python_sdk/models/get_projectsop.py +105 -0
- latitudesh_python_sdk/models/get_regionop.py +18 -0
- latitudesh_python_sdk/models/get_regionsop.py +42 -0
- latitudesh_python_sdk/models/get_role_idop.py +16 -0
- latitudesh_python_sdk/models/get_rolesop.py +54 -0
- latitudesh_python_sdk/models/get_server_deploy_configop.py +18 -0
- latitudesh_python_sdk/models/get_server_out_of_bandop.py +18 -0
- latitudesh_python_sdk/models/get_serverop.py +33 -0
- latitudesh_python_sdk/models/get_serversop.py +185 -0
- latitudesh_python_sdk/models/get_ssh_keyop.py +30 -0
- latitudesh_python_sdk/models/get_ssh_keysop.py +31 -0
- latitudesh_python_sdk/models/get_storage_filesystemsop.py +22 -0
- latitudesh_python_sdk/models/get_storage_volumeop.py +32 -0
- latitudesh_python_sdk/models/get_storage_volumesop.py +35 -0
- latitudesh_python_sdk/models/get_team_membersop.py +42 -0
- latitudesh_python_sdk/models/get_traffic_consumptionop.py +49 -0
- latitudesh_python_sdk/models/get_traffic_quotaop.py +20 -0
- latitudesh_python_sdk/models/get_user_dataop.py +31 -0
- latitudesh_python_sdk/models/get_user_profileop.py +19 -0
- latitudesh_python_sdk/models/get_users_dataop.py +44 -0
- latitudesh_python_sdk/models/get_virtual_networkop.py +32 -0
- latitudesh_python_sdk/models/get_virtual_networks_assignmentsop.py +72 -0
- latitudesh_python_sdk/models/get_virtual_networksop.py +69 -0
- latitudesh_python_sdk/models/get_vpn_sessionsop.py +70 -0
- latitudesh_python_sdk/models/index_virtual_machineop.py +31 -0
- latitudesh_python_sdk/models/ip_address.py +122 -0
- latitudesh_python_sdk/models/ip_addresses.py +15 -0
- latitudesh_python_sdk/models/ipmi_session.py +53 -0
- latitudesh_python_sdk/models/latitudesherror.py +30 -0
- latitudesh_python_sdk/models/list_firewallsop.py +49 -0
- latitudesh_python_sdk/models/membership.py +63 -0
- latitudesh_python_sdk/models/no_response_error.py +17 -0
- latitudesh_python_sdk/models/operating_system_data.py +65 -0
- latitudesh_python_sdk/models/operating_systems.py +26 -0
- latitudesh_python_sdk/models/out_of_band_connection.py +88 -0
- latitudesh_python_sdk/models/patch_current_teamop.py +91 -0
- latitudesh_python_sdk/models/patch_storage_filesystemsop.py +79 -0
- latitudesh_python_sdk/models/patch_user_dataop.py +69 -0
- latitudesh_python_sdk/models/patch_user_profileop.py +88 -0
- latitudesh_python_sdk/models/plan.py +15 -0
- latitudesh_python_sdk/models/plan_data.py +210 -0
- latitudesh_python_sdk/models/post_api_keyop.py +19 -0
- latitudesh_python_sdk/models/post_project_ssh_keyop.py +81 -0
- latitudesh_python_sdk/models/post_project_user_dataop.py +68 -0
- latitudesh_python_sdk/models/post_ssh_keyop.py +63 -0
- latitudesh_python_sdk/models/post_storage_filesystemsop.py +63 -0
- latitudesh_python_sdk/models/post_storage_volumes_mountop.py +62 -0
- latitudesh_python_sdk/models/post_storage_volumesop.py +63 -0
- latitudesh_python_sdk/models/post_team_membersop.py +54 -0
- latitudesh_python_sdk/models/post_teamop.py +67 -0
- latitudesh_python_sdk/models/post_user_dataop.py +50 -0
- latitudesh_python_sdk/models/post_vpn_sessionop.py +63 -0
- latitudesh_python_sdk/models/project.py +131 -0
- latitudesh_python_sdk/models/project_include.py +75 -0
- latitudesh_python_sdk/models/projects.py +15 -0
- latitudesh_python_sdk/models/put_project_ssh_keyop.py +87 -0
- latitudesh_python_sdk/models/put_project_user_dataop.py +76 -0
- latitudesh_python_sdk/models/put_ssh_keyop.py +80 -0
- latitudesh_python_sdk/models/put_vpn_sessionop.py +16 -0
- latitudesh_python_sdk/models/region.py +50 -0
- latitudesh_python_sdk/models/region_resource_data.py +37 -0
- latitudesh_python_sdk/models/regions.py +50 -0
- latitudesh_python_sdk/models/responsevalidationerror.py +27 -0
- latitudesh_python_sdk/models/role.py +26 -0
- latitudesh_python_sdk/models/role_data.py +35 -0
- latitudesh_python_sdk/models/security.py +25 -0
- latitudesh_python_sdk/models/server.py +26 -0
- latitudesh_python_sdk/models/server_action.py +52 -0
- latitudesh_python_sdk/models/server_data.py +280 -0
- latitudesh_python_sdk/models/server_exit_rescue_modeop.py +16 -0
- latitudesh_python_sdk/models/server_lockop.py +16 -0
- latitudesh_python_sdk/models/server_region_resource_data.py +40 -0
- latitudesh_python_sdk/models/server_rescue.py +22 -0
- latitudesh_python_sdk/models/server_schedule_deletion.py +44 -0
- latitudesh_python_sdk/models/server_schedule_deletionop.py +16 -0
- latitudesh_python_sdk/models/server_start_rescue_modeop.py +16 -0
- latitudesh_python_sdk/models/server_unlockop.py +16 -0
- latitudesh_python_sdk/models/server_unschedule_deletionop.py +16 -0
- latitudesh_python_sdk/models/servers.py +26 -0
- latitudesh_python_sdk/models/show_virtual_machineop.py +16 -0
- latitudesh_python_sdk/models/ssh_key_data.py +55 -0
- latitudesh_python_sdk/models/ssh_keys.py +26 -0
- latitudesh_python_sdk/models/storage_plan_data.py +47 -0
- latitudesh_python_sdk/models/storage_plans.py +26 -0
- latitudesh_python_sdk/models/team.py +74 -0
- latitudesh_python_sdk/models/team_include.py +43 -0
- latitudesh_python_sdk/models/team_members.py +51 -0
- latitudesh_python_sdk/models/teams.py +26 -0
- latitudesh_python_sdk/models/traffic.py +133 -0
- latitudesh_python_sdk/models/traffic_quota.py +106 -0
- latitudesh_python_sdk/models/update_api_key.py +48 -0
- latitudesh_python_sdk/models/update_api_keyop.py +41 -0
- latitudesh_python_sdk/models/update_firewallop.py +89 -0
- latitudesh_python_sdk/models/update_plans_bandwidthop.py +50 -0
- latitudesh_python_sdk/models/update_projectop.py +95 -0
- latitudesh_python_sdk/models/update_server_deploy_configop.py +122 -0
- latitudesh_python_sdk/models/update_serverop.py +85 -0
- latitudesh_python_sdk/models/update_tagop.py +74 -0
- latitudesh_python_sdk/models/update_virtual_networkop.py +67 -0
- latitudesh_python_sdk/models/user.py +59 -0
- latitudesh_python_sdk/models/user_data.py +26 -0
- latitudesh_python_sdk/models/user_data_properties.py +46 -0
- latitudesh_python_sdk/models/user_include.py +52 -0
- latitudesh_python_sdk/models/user_team.py +61 -0
- latitudesh_python_sdk/models/user_teams.py +26 -0
- latitudesh_python_sdk/models/user_update.py +37 -0
- latitudesh_python_sdk/models/virtual_machine.py +29 -0
- latitudesh_python_sdk/models/virtual_machine_attributes.py +115 -0
- latitudesh_python_sdk/models/virtual_machine_payload.py +47 -0
- latitudesh_python_sdk/models/virtual_machine_plans.py +181 -0
- latitudesh_python_sdk/models/virtual_network.py +26 -0
- latitudesh_python_sdk/models/virtual_network_assignment.py +29 -0
- latitudesh_python_sdk/models/virtual_network_assignment_data.py +65 -0
- latitudesh_python_sdk/models/virtual_network_assignments.py +29 -0
- latitudesh_python_sdk/models/virtual_network_data.py +114 -0
- latitudesh_python_sdk/models/virtual_networks.py +26 -0
- latitudesh_python_sdk/models/volume_data.py +111 -0
- latitudesh_python_sdk/models/vpn_session_data_with_password.py +77 -0
- latitudesh_python_sdk/models/vpn_session_with_password.py +18 -0
- latitudesh_python_sdk/operatingsystems_sdk.py +238 -0
- latitudesh_python_sdk/plans.py +1304 -0
- latitudesh_python_sdk/privatenetworks.py +1612 -0
- latitudesh_python_sdk/projects_sdk.py +830 -0
- latitudesh_python_sdk/py.typed +1 -0
- latitudesh_python_sdk/regions_sdk.py +398 -0
- latitudesh_python_sdk/roles.py +398 -0
- latitudesh_python_sdk/sdk.py +264 -0
- latitudesh_python_sdk/sdkconfiguration.py +50 -0
- latitudesh_python_sdk/servers_sdk.py +3414 -0
- latitudesh_python_sdk/sshkeys_sdk.py +1882 -0
- latitudesh_python_sdk/storage.py +1651 -0
- latitudesh_python_sdk/tags.py +715 -0
- latitudesh_python_sdk/teams_sdk.py +527 -0
- latitudesh_python_sdk/teamsmembers.py +576 -0
- latitudesh_python_sdk/traffic_sdk.py +357 -0
- latitudesh_python_sdk/types/__init__.py +21 -0
- latitudesh_python_sdk/types/basemodel.py +39 -0
- latitudesh_python_sdk/userdata_sdk.py +1888 -0
- latitudesh_python_sdk/userprofile.py +531 -0
- latitudesh_python_sdk/utils/__init__.py +200 -0
- latitudesh_python_sdk/utils/annotations.py +79 -0
- latitudesh_python_sdk/utils/datetimes.py +23 -0
- latitudesh_python_sdk/utils/enums.py +74 -0
- latitudesh_python_sdk/utils/eventstreaming.py +248 -0
- latitudesh_python_sdk/utils/forms.py +234 -0
- latitudesh_python_sdk/utils/headers.py +136 -0
- latitudesh_python_sdk/utils/logger.py +27 -0
- latitudesh_python_sdk/utils/metadata.py +118 -0
- latitudesh_python_sdk/utils/queryparams.py +217 -0
- latitudesh_python_sdk/utils/requestbodies.py +66 -0
- latitudesh_python_sdk/utils/retries.py +281 -0
- latitudesh_python_sdk/utils/security.py +192 -0
- latitudesh_python_sdk/utils/serializers.py +249 -0
- latitudesh_python_sdk/utils/unmarshal_json_response.py +38 -0
- latitudesh_python_sdk/utils/url.py +155 -0
- latitudesh_python_sdk/utils/values.py +137 -0
- latitudesh_python_sdk/virtualmachines.py +941 -0
- latitudesh_python_sdk/vpnsessions.py +715 -0
- latitudesh_python_sdk-2.3.0.dist-info/METADATA +787 -0
- latitudesh_python_sdk-2.3.0.dist-info/RECORD +242 -0
- latitudesh_python_sdk-2.3.0.dist-info/WHEEL +4 -0
- latitudesh_python_sdk-2.3.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
# pyright: reportReturnType = false
|
|
4
|
+
import asyncio
|
|
5
|
+
from typing_extensions import Protocol, runtime_checkable
|
|
6
|
+
import httpx
|
|
7
|
+
from typing import Any, Optional, Union
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@runtime_checkable
|
|
11
|
+
class HttpClient(Protocol):
|
|
12
|
+
def send(
|
|
13
|
+
self,
|
|
14
|
+
request: httpx.Request,
|
|
15
|
+
*,
|
|
16
|
+
stream: bool = False,
|
|
17
|
+
auth: Union[
|
|
18
|
+
httpx._types.AuthTypes, httpx._client.UseClientDefault, None
|
|
19
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
20
|
+
follow_redirects: Union[
|
|
21
|
+
bool, httpx._client.UseClientDefault
|
|
22
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
23
|
+
) -> httpx.Response:
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
def build_request(
|
|
27
|
+
self,
|
|
28
|
+
method: str,
|
|
29
|
+
url: httpx._types.URLTypes,
|
|
30
|
+
*,
|
|
31
|
+
content: Optional[httpx._types.RequestContent] = None,
|
|
32
|
+
data: Optional[httpx._types.RequestData] = None,
|
|
33
|
+
files: Optional[httpx._types.RequestFiles] = None,
|
|
34
|
+
json: Optional[Any] = None,
|
|
35
|
+
params: Optional[httpx._types.QueryParamTypes] = None,
|
|
36
|
+
headers: Optional[httpx._types.HeaderTypes] = None,
|
|
37
|
+
cookies: Optional[httpx._types.CookieTypes] = None,
|
|
38
|
+
timeout: Union[
|
|
39
|
+
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
|
|
40
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
41
|
+
extensions: Optional[httpx._types.RequestExtensions] = None,
|
|
42
|
+
) -> httpx.Request:
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
def close(self) -> None:
|
|
46
|
+
pass
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@runtime_checkable
|
|
50
|
+
class AsyncHttpClient(Protocol):
|
|
51
|
+
async def send(
|
|
52
|
+
self,
|
|
53
|
+
request: httpx.Request,
|
|
54
|
+
*,
|
|
55
|
+
stream: bool = False,
|
|
56
|
+
auth: Union[
|
|
57
|
+
httpx._types.AuthTypes, httpx._client.UseClientDefault, None
|
|
58
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
59
|
+
follow_redirects: Union[
|
|
60
|
+
bool, httpx._client.UseClientDefault
|
|
61
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
62
|
+
) -> httpx.Response:
|
|
63
|
+
pass
|
|
64
|
+
|
|
65
|
+
def build_request(
|
|
66
|
+
self,
|
|
67
|
+
method: str,
|
|
68
|
+
url: httpx._types.URLTypes,
|
|
69
|
+
*,
|
|
70
|
+
content: Optional[httpx._types.RequestContent] = None,
|
|
71
|
+
data: Optional[httpx._types.RequestData] = None,
|
|
72
|
+
files: Optional[httpx._types.RequestFiles] = None,
|
|
73
|
+
json: Optional[Any] = None,
|
|
74
|
+
params: Optional[httpx._types.QueryParamTypes] = None,
|
|
75
|
+
headers: Optional[httpx._types.HeaderTypes] = None,
|
|
76
|
+
cookies: Optional[httpx._types.CookieTypes] = None,
|
|
77
|
+
timeout: Union[
|
|
78
|
+
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
|
|
79
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
80
|
+
extensions: Optional[httpx._types.RequestExtensions] = None,
|
|
81
|
+
) -> httpx.Request:
|
|
82
|
+
pass
|
|
83
|
+
|
|
84
|
+
async def aclose(self) -> None:
|
|
85
|
+
pass
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class ClientOwner(Protocol):
|
|
89
|
+
client: Union[HttpClient, None]
|
|
90
|
+
async_client: Union[AsyncHttpClient, None]
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def close_clients(
|
|
94
|
+
owner: ClientOwner,
|
|
95
|
+
sync_client: Union[HttpClient, None],
|
|
96
|
+
sync_client_supplied: bool,
|
|
97
|
+
async_client: Union[AsyncHttpClient, None],
|
|
98
|
+
async_client_supplied: bool,
|
|
99
|
+
) -> None:
|
|
100
|
+
"""
|
|
101
|
+
A finalizer function that is meant to be used with weakref.finalize to close
|
|
102
|
+
httpx clients used by an SDK so that underlying resources can be garbage
|
|
103
|
+
collected.
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
# Unset the client/async_client properties so there are no more references
|
|
107
|
+
# to them from the owning SDK instance and they can be reaped.
|
|
108
|
+
owner.client = None
|
|
109
|
+
owner.async_client = None
|
|
110
|
+
if sync_client is not None and not sync_client_supplied:
|
|
111
|
+
try:
|
|
112
|
+
sync_client.close()
|
|
113
|
+
except Exception:
|
|
114
|
+
pass
|
|
115
|
+
|
|
116
|
+
if async_client is not None and not async_client_supplied:
|
|
117
|
+
try:
|
|
118
|
+
loop = asyncio.get_running_loop()
|
|
119
|
+
asyncio.run_coroutine_threadsafe(async_client.aclose(), loop)
|
|
120
|
+
except RuntimeError:
|
|
121
|
+
try:
|
|
122
|
+
asyncio.run(async_client.aclose())
|
|
123
|
+
except RuntimeError:
|
|
124
|
+
# best effort
|
|
125
|
+
pass
|
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from jsonpath import JSONPath
|
|
5
|
+
from latitudesh_python_sdk import models, utils
|
|
6
|
+
from latitudesh_python_sdk._hooks import HookContext
|
|
7
|
+
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
8
|
+
from latitudesh_python_sdk.utils import get_security_from_env
|
|
9
|
+
from latitudesh_python_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
10
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class IPAddressesSDK(BaseSDK):
|
|
14
|
+
def list(
|
|
15
|
+
self,
|
|
16
|
+
*,
|
|
17
|
+
filter_server: Optional[str] = None,
|
|
18
|
+
filter_project: Optional[str] = None,
|
|
19
|
+
filter_family: Optional[models.FilterFamily] = None,
|
|
20
|
+
filter_type: Optional[models.FilterType] = None,
|
|
21
|
+
filter_location: Optional[str] = None,
|
|
22
|
+
filter_address: Optional[str] = None,
|
|
23
|
+
extra_fields_ip_addresses: Optional[str] = None,
|
|
24
|
+
page_size: Optional[int] = 20,
|
|
25
|
+
page_number: Optional[int] = 1,
|
|
26
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
27
|
+
server_url: Optional[str] = None,
|
|
28
|
+
timeout_ms: Optional[int] = None,
|
|
29
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
30
|
+
) -> Optional[models.GetIpsResponse]:
|
|
31
|
+
r"""List IPs
|
|
32
|
+
|
|
33
|
+
List all Management and Additional IP Addresses.
|
|
34
|
+
• Management IPs are IPs that are used for the management IP of a device.
|
|
35
|
+
This is a public IP address that a device is born and dies with. It never changes during the lifecycle of the device.
|
|
36
|
+
• Additional IPs are individual IPs that can be added to a device as an additional IP that can be used.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
:param filter_server: The server ID to filter by
|
|
40
|
+
:param filter_project: The project ID or Slug to filter by
|
|
41
|
+
:param filter_family: The protocol family to filter by
|
|
42
|
+
:param filter_type: The protocol type to filter by
|
|
43
|
+
:param filter_location: The site slug to filter by
|
|
44
|
+
:param filter_address: The address of IP to filter by starts_with
|
|
45
|
+
:param extra_fields_ip_addresses: The `region` and `server` are provided as extra attributes that are lazy loaded. To request it, just set `extra_fields[ip_addresses]=region,server` in the query string.
|
|
46
|
+
:param page_size: Number of items to return per page
|
|
47
|
+
:param page_number: Page number to return (starts at 1)
|
|
48
|
+
:param retries: Override the default retry configuration for this method
|
|
49
|
+
:param server_url: Override the default server URL for this method
|
|
50
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
51
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
52
|
+
"""
|
|
53
|
+
base_url = None
|
|
54
|
+
url_variables = None
|
|
55
|
+
if timeout_ms is None:
|
|
56
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
57
|
+
|
|
58
|
+
if server_url is not None:
|
|
59
|
+
base_url = server_url
|
|
60
|
+
else:
|
|
61
|
+
base_url = self._get_url(base_url, url_variables)
|
|
62
|
+
|
|
63
|
+
request = models.GetIpsRequest(
|
|
64
|
+
filter_server=filter_server,
|
|
65
|
+
filter_project=filter_project,
|
|
66
|
+
filter_family=filter_family,
|
|
67
|
+
filter_type=filter_type,
|
|
68
|
+
filter_location=filter_location,
|
|
69
|
+
filter_address=filter_address,
|
|
70
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
71
|
+
page_size=page_size,
|
|
72
|
+
page_number=page_number,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
req = self._build_request(
|
|
76
|
+
method="GET",
|
|
77
|
+
path="/ips",
|
|
78
|
+
base_url=base_url,
|
|
79
|
+
url_variables=url_variables,
|
|
80
|
+
request=request,
|
|
81
|
+
request_body_required=False,
|
|
82
|
+
request_has_path_params=False,
|
|
83
|
+
request_has_query_params=True,
|
|
84
|
+
user_agent_header="user-agent",
|
|
85
|
+
accept_header_value="application/vnd.api+json",
|
|
86
|
+
http_headers=http_headers,
|
|
87
|
+
security=self.sdk_configuration.security,
|
|
88
|
+
allow_empty_value=None,
|
|
89
|
+
timeout_ms=timeout_ms,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
if retries == UNSET:
|
|
93
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
94
|
+
retries = self.sdk_configuration.retry_config
|
|
95
|
+
|
|
96
|
+
retry_config = None
|
|
97
|
+
if isinstance(retries, utils.RetryConfig):
|
|
98
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
99
|
+
|
|
100
|
+
http_res = self.do_request(
|
|
101
|
+
hook_ctx=HookContext(
|
|
102
|
+
config=self.sdk_configuration,
|
|
103
|
+
base_url=base_url or "",
|
|
104
|
+
operation_id="get-ips",
|
|
105
|
+
oauth2_scopes=None,
|
|
106
|
+
security_source=get_security_from_env(
|
|
107
|
+
self.sdk_configuration.security, models.Security
|
|
108
|
+
),
|
|
109
|
+
),
|
|
110
|
+
request=req,
|
|
111
|
+
error_status_codes=["4XX", "5XX"],
|
|
112
|
+
retry_config=retry_config,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
def next_func() -> Optional[models.GetIpsResponse]:
|
|
116
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
117
|
+
page = request.page_number if not request.page_number is None else 1
|
|
118
|
+
next_page = page + 1
|
|
119
|
+
|
|
120
|
+
if not http_res.text:
|
|
121
|
+
return None
|
|
122
|
+
results = JSONPath("$.data").parse(body)
|
|
123
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
124
|
+
return None
|
|
125
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
126
|
+
if len(results[0]) < limit:
|
|
127
|
+
return None
|
|
128
|
+
|
|
129
|
+
return self.list(
|
|
130
|
+
filter_server=filter_server,
|
|
131
|
+
filter_project=filter_project,
|
|
132
|
+
filter_family=filter_family,
|
|
133
|
+
filter_type=filter_type,
|
|
134
|
+
filter_location=filter_location,
|
|
135
|
+
filter_address=filter_address,
|
|
136
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
137
|
+
page_size=page_size,
|
|
138
|
+
page_number=next_page,
|
|
139
|
+
retries=retries,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
143
|
+
return models.GetIpsResponse(
|
|
144
|
+
result=unmarshal_json_response(models.IPAddresses, http_res),
|
|
145
|
+
next=next_func,
|
|
146
|
+
)
|
|
147
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
148
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
149
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
150
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
151
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
152
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
153
|
+
|
|
154
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
155
|
+
|
|
156
|
+
async def list_async(
|
|
157
|
+
self,
|
|
158
|
+
*,
|
|
159
|
+
filter_server: Optional[str] = None,
|
|
160
|
+
filter_project: Optional[str] = None,
|
|
161
|
+
filter_family: Optional[models.FilterFamily] = None,
|
|
162
|
+
filter_type: Optional[models.FilterType] = None,
|
|
163
|
+
filter_location: Optional[str] = None,
|
|
164
|
+
filter_address: Optional[str] = None,
|
|
165
|
+
extra_fields_ip_addresses: Optional[str] = None,
|
|
166
|
+
page_size: Optional[int] = 20,
|
|
167
|
+
page_number: Optional[int] = 1,
|
|
168
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
169
|
+
server_url: Optional[str] = None,
|
|
170
|
+
timeout_ms: Optional[int] = None,
|
|
171
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
172
|
+
) -> Optional[models.GetIpsResponse]:
|
|
173
|
+
r"""List IPs
|
|
174
|
+
|
|
175
|
+
List all Management and Additional IP Addresses.
|
|
176
|
+
• Management IPs are IPs that are used for the management IP of a device.
|
|
177
|
+
This is a public IP address that a device is born and dies with. It never changes during the lifecycle of the device.
|
|
178
|
+
• Additional IPs are individual IPs that can be added to a device as an additional IP that can be used.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
:param filter_server: The server ID to filter by
|
|
182
|
+
:param filter_project: The project ID or Slug to filter by
|
|
183
|
+
:param filter_family: The protocol family to filter by
|
|
184
|
+
:param filter_type: The protocol type to filter by
|
|
185
|
+
:param filter_location: The site slug to filter by
|
|
186
|
+
:param filter_address: The address of IP to filter by starts_with
|
|
187
|
+
:param extra_fields_ip_addresses: The `region` and `server` are provided as extra attributes that are lazy loaded. To request it, just set `extra_fields[ip_addresses]=region,server` in the query string.
|
|
188
|
+
:param page_size: Number of items to return per page
|
|
189
|
+
:param page_number: Page number to return (starts at 1)
|
|
190
|
+
:param retries: Override the default retry configuration for this method
|
|
191
|
+
:param server_url: Override the default server URL for this method
|
|
192
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
193
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
194
|
+
"""
|
|
195
|
+
base_url = None
|
|
196
|
+
url_variables = None
|
|
197
|
+
if timeout_ms is None:
|
|
198
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
199
|
+
|
|
200
|
+
if server_url is not None:
|
|
201
|
+
base_url = server_url
|
|
202
|
+
else:
|
|
203
|
+
base_url = self._get_url(base_url, url_variables)
|
|
204
|
+
|
|
205
|
+
request = models.GetIpsRequest(
|
|
206
|
+
filter_server=filter_server,
|
|
207
|
+
filter_project=filter_project,
|
|
208
|
+
filter_family=filter_family,
|
|
209
|
+
filter_type=filter_type,
|
|
210
|
+
filter_location=filter_location,
|
|
211
|
+
filter_address=filter_address,
|
|
212
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
213
|
+
page_size=page_size,
|
|
214
|
+
page_number=page_number,
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
req = self._build_request_async(
|
|
218
|
+
method="GET",
|
|
219
|
+
path="/ips",
|
|
220
|
+
base_url=base_url,
|
|
221
|
+
url_variables=url_variables,
|
|
222
|
+
request=request,
|
|
223
|
+
request_body_required=False,
|
|
224
|
+
request_has_path_params=False,
|
|
225
|
+
request_has_query_params=True,
|
|
226
|
+
user_agent_header="user-agent",
|
|
227
|
+
accept_header_value="application/vnd.api+json",
|
|
228
|
+
http_headers=http_headers,
|
|
229
|
+
security=self.sdk_configuration.security,
|
|
230
|
+
allow_empty_value=None,
|
|
231
|
+
timeout_ms=timeout_ms,
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
if retries == UNSET:
|
|
235
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
236
|
+
retries = self.sdk_configuration.retry_config
|
|
237
|
+
|
|
238
|
+
retry_config = None
|
|
239
|
+
if isinstance(retries, utils.RetryConfig):
|
|
240
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
241
|
+
|
|
242
|
+
http_res = await self.do_request_async(
|
|
243
|
+
hook_ctx=HookContext(
|
|
244
|
+
config=self.sdk_configuration,
|
|
245
|
+
base_url=base_url or "",
|
|
246
|
+
operation_id="get-ips",
|
|
247
|
+
oauth2_scopes=None,
|
|
248
|
+
security_source=get_security_from_env(
|
|
249
|
+
self.sdk_configuration.security, models.Security
|
|
250
|
+
),
|
|
251
|
+
),
|
|
252
|
+
request=req,
|
|
253
|
+
error_status_codes=["4XX", "5XX"],
|
|
254
|
+
retry_config=retry_config,
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
def next_func() -> Optional[models.GetIpsResponse]:
|
|
258
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
259
|
+
page = request.page_number if not request.page_number is None else 1
|
|
260
|
+
next_page = page + 1
|
|
261
|
+
|
|
262
|
+
if not http_res.text:
|
|
263
|
+
return None
|
|
264
|
+
results = JSONPath("$.data").parse(body)
|
|
265
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
266
|
+
return None
|
|
267
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
268
|
+
if len(results[0]) < limit:
|
|
269
|
+
return None
|
|
270
|
+
|
|
271
|
+
return self.list(
|
|
272
|
+
filter_server=filter_server,
|
|
273
|
+
filter_project=filter_project,
|
|
274
|
+
filter_family=filter_family,
|
|
275
|
+
filter_type=filter_type,
|
|
276
|
+
filter_location=filter_location,
|
|
277
|
+
filter_address=filter_address,
|
|
278
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
279
|
+
page_size=page_size,
|
|
280
|
+
page_number=next_page,
|
|
281
|
+
retries=retries,
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
285
|
+
return models.GetIpsResponse(
|
|
286
|
+
result=unmarshal_json_response(models.IPAddresses, http_res),
|
|
287
|
+
next=next_func,
|
|
288
|
+
)
|
|
289
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
290
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
291
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
292
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
293
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
294
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
295
|
+
|
|
296
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
297
|
+
|
|
298
|
+
def get(
|
|
299
|
+
self,
|
|
300
|
+
*,
|
|
301
|
+
ip_id: str,
|
|
302
|
+
extra_fields_ip_addresses: Optional[str] = None,
|
|
303
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
304
|
+
server_url: Optional[str] = None,
|
|
305
|
+
timeout_ms: Optional[int] = None,
|
|
306
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
307
|
+
) -> models.IPAddress:
|
|
308
|
+
r"""Retrieve an IP
|
|
309
|
+
|
|
310
|
+
Retrieve an IP Address
|
|
311
|
+
|
|
312
|
+
:param ip_id: The IP Address ID
|
|
313
|
+
:param extra_fields_ip_addresses: The `region` and `server` are provided as extra attributes that are lazy loaded. To request it, just set `extra_fields[ip_addresses]=region,server` in the query string.
|
|
314
|
+
:param retries: Override the default retry configuration for this method
|
|
315
|
+
:param server_url: Override the default server URL for this method
|
|
316
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
317
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
318
|
+
"""
|
|
319
|
+
base_url = None
|
|
320
|
+
url_variables = None
|
|
321
|
+
if timeout_ms is None:
|
|
322
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
323
|
+
|
|
324
|
+
if server_url is not None:
|
|
325
|
+
base_url = server_url
|
|
326
|
+
else:
|
|
327
|
+
base_url = self._get_url(base_url, url_variables)
|
|
328
|
+
|
|
329
|
+
request = models.GetIPRequest(
|
|
330
|
+
ip_id=ip_id,
|
|
331
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
req = self._build_request(
|
|
335
|
+
method="GET",
|
|
336
|
+
path="/ips/{ip_id}",
|
|
337
|
+
base_url=base_url,
|
|
338
|
+
url_variables=url_variables,
|
|
339
|
+
request=request,
|
|
340
|
+
request_body_required=False,
|
|
341
|
+
request_has_path_params=True,
|
|
342
|
+
request_has_query_params=True,
|
|
343
|
+
user_agent_header="user-agent",
|
|
344
|
+
accept_header_value="application/vnd.api+json",
|
|
345
|
+
http_headers=http_headers,
|
|
346
|
+
security=self.sdk_configuration.security,
|
|
347
|
+
allow_empty_value=None,
|
|
348
|
+
timeout_ms=timeout_ms,
|
|
349
|
+
)
|
|
350
|
+
|
|
351
|
+
if retries == UNSET:
|
|
352
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
353
|
+
retries = self.sdk_configuration.retry_config
|
|
354
|
+
|
|
355
|
+
retry_config = None
|
|
356
|
+
if isinstance(retries, utils.RetryConfig):
|
|
357
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
358
|
+
|
|
359
|
+
http_res = self.do_request(
|
|
360
|
+
hook_ctx=HookContext(
|
|
361
|
+
config=self.sdk_configuration,
|
|
362
|
+
base_url=base_url or "",
|
|
363
|
+
operation_id="get-ip",
|
|
364
|
+
oauth2_scopes=None,
|
|
365
|
+
security_source=get_security_from_env(
|
|
366
|
+
self.sdk_configuration.security, models.Security
|
|
367
|
+
),
|
|
368
|
+
),
|
|
369
|
+
request=req,
|
|
370
|
+
error_status_codes=["4XX", "5XX"],
|
|
371
|
+
retry_config=retry_config,
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
375
|
+
return unmarshal_json_response(models.IPAddress, http_res)
|
|
376
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
377
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
378
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
379
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
380
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
381
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
382
|
+
|
|
383
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
384
|
+
|
|
385
|
+
async def get_async(
|
|
386
|
+
self,
|
|
387
|
+
*,
|
|
388
|
+
ip_id: str,
|
|
389
|
+
extra_fields_ip_addresses: Optional[str] = None,
|
|
390
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
391
|
+
server_url: Optional[str] = None,
|
|
392
|
+
timeout_ms: Optional[int] = None,
|
|
393
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
394
|
+
) -> models.IPAddress:
|
|
395
|
+
r"""Retrieve an IP
|
|
396
|
+
|
|
397
|
+
Retrieve an IP Address
|
|
398
|
+
|
|
399
|
+
:param ip_id: The IP Address ID
|
|
400
|
+
:param extra_fields_ip_addresses: The `region` and `server` are provided as extra attributes that are lazy loaded. To request it, just set `extra_fields[ip_addresses]=region,server` in the query string.
|
|
401
|
+
:param retries: Override the default retry configuration for this method
|
|
402
|
+
:param server_url: Override the default server URL for this method
|
|
403
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
404
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
405
|
+
"""
|
|
406
|
+
base_url = None
|
|
407
|
+
url_variables = None
|
|
408
|
+
if timeout_ms is None:
|
|
409
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
410
|
+
|
|
411
|
+
if server_url is not None:
|
|
412
|
+
base_url = server_url
|
|
413
|
+
else:
|
|
414
|
+
base_url = self._get_url(base_url, url_variables)
|
|
415
|
+
|
|
416
|
+
request = models.GetIPRequest(
|
|
417
|
+
ip_id=ip_id,
|
|
418
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
419
|
+
)
|
|
420
|
+
|
|
421
|
+
req = self._build_request_async(
|
|
422
|
+
method="GET",
|
|
423
|
+
path="/ips/{ip_id}",
|
|
424
|
+
base_url=base_url,
|
|
425
|
+
url_variables=url_variables,
|
|
426
|
+
request=request,
|
|
427
|
+
request_body_required=False,
|
|
428
|
+
request_has_path_params=True,
|
|
429
|
+
request_has_query_params=True,
|
|
430
|
+
user_agent_header="user-agent",
|
|
431
|
+
accept_header_value="application/vnd.api+json",
|
|
432
|
+
http_headers=http_headers,
|
|
433
|
+
security=self.sdk_configuration.security,
|
|
434
|
+
allow_empty_value=None,
|
|
435
|
+
timeout_ms=timeout_ms,
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
if retries == UNSET:
|
|
439
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
440
|
+
retries = self.sdk_configuration.retry_config
|
|
441
|
+
|
|
442
|
+
retry_config = None
|
|
443
|
+
if isinstance(retries, utils.RetryConfig):
|
|
444
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
445
|
+
|
|
446
|
+
http_res = await self.do_request_async(
|
|
447
|
+
hook_ctx=HookContext(
|
|
448
|
+
config=self.sdk_configuration,
|
|
449
|
+
base_url=base_url or "",
|
|
450
|
+
operation_id="get-ip",
|
|
451
|
+
oauth2_scopes=None,
|
|
452
|
+
security_source=get_security_from_env(
|
|
453
|
+
self.sdk_configuration.security, models.Security
|
|
454
|
+
),
|
|
455
|
+
),
|
|
456
|
+
request=req,
|
|
457
|
+
error_status_codes=["4XX", "5XX"],
|
|
458
|
+
retry_config=retry_config,
|
|
459
|
+
)
|
|
460
|
+
|
|
461
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
462
|
+
return unmarshal_json_response(models.IPAddress, http_res)
|
|
463
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
464
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
465
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
466
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
467
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
468
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
469
|
+
|
|
470
|
+
raise models.APIError("Unexpected response received", http_res)
|