latitudesh-python-sdk 0.0.6__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/__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 +106 -0
- latitudesh_python_sdk/_version.py +15 -0
- latitudesh_python_sdk/apikeys.py +802 -0
- latitudesh_python_sdk/basesdk.py +366 -0
- latitudesh_python_sdk/billing.py +210 -0
- latitudesh_python_sdk/events_sdk.py +240 -0
- latitudesh_python_sdk/firewalls_sdk.py +1640 -0
- latitudesh_python_sdk/httpclient.py +136 -0
- latitudesh_python_sdk/ipaddresses_sdk.py +448 -0
- latitudesh_python_sdk/models/__init__.py +1927 -0
- latitudesh_python_sdk/models/api_key.py +81 -0
- latitudesh_python_sdk/models/apierror.py +22 -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.py +72 -0
- latitudesh_python_sdk/models/bandwidth_plans.py +15 -0
- latitudesh_python_sdk/models/billing_usage.py +158 -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 +69 -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_networkop.py +72 -0
- latitudesh_python_sdk/models/custom_tag.py +54 -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_storage_filesystemsop.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 +74 -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/error_object.py +49 -0
- latitudesh_python_sdk/models/events.py +90 -0
- latitudesh_python_sdk/models/filesystem_data.py +53 -0
- latitudesh_python_sdk/models/firewall.py +71 -0
- latitudesh_python_sdk/models/firewall_server.py +50 -0
- latitudesh_python_sdk/models/firewalls.py +26 -0
- latitudesh_python_sdk/models/get_bandwidth_plansop.py +33 -0
- latitudesh_python_sdk/models/get_billing_usageop.py +46 -0
- latitudesh_python_sdk/models/get_eventsop.py +98 -0
- latitudesh_python_sdk/models/get_firewall_assignmentsop.py +18 -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 +91 -0
- latitudesh_python_sdk/models/get_planop.py +16 -0
- latitudesh_python_sdk/models/get_plans_operating_systemop.py +19 -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 +76 -0
- latitudesh_python_sdk/models/get_regionop.py +18 -0
- latitudesh_python_sdk/models/get_role_idop.py +16 -0
- latitudesh_python_sdk/models/get_rolesop.py +19 -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 +156 -0
- latitudesh_python_sdk/models/get_storage_filesystemsop.py +22 -0
- latitudesh_python_sdk/models/get_traffic_consumptionop.py +45 -0
- latitudesh_python_sdk/models/get_traffic_quotaop.py +20 -0
- latitudesh_python_sdk/models/get_user_profileop.py +19 -0
- latitudesh_python_sdk/models/get_virtual_networkop.py +32 -0
- latitudesh_python_sdk/models/get_virtual_networks_assignmentsop.py +40 -0
- latitudesh_python_sdk/models/get_virtual_networksop.py +40 -0
- latitudesh_python_sdk/models/get_vpn_sessionsop.py +70 -0
- latitudesh_python_sdk/models/index_virtual_machineop.py +22 -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/list_firewallsop.py +20 -0
- latitudesh_python_sdk/models/membership.py +63 -0
- latitudesh_python_sdk/models/operating_systems.py +57 -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_profileop.py +88 -0
- latitudesh_python_sdk/models/plan.py +15 -0
- latitudesh_python_sdk/models/plan_data.py +206 -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_storage_filesystemsop.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_vpn_sessionop.py +63 -0
- latitudesh_python_sdk/models/project.py +130 -0
- latitudesh_python_sdk/models/project_include.py +72 -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_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/role.py +15 -0
- latitudesh_python_sdk/models/role_data.py +35 -0
- latitudesh_python_sdk/models/security.py +25 -0
- latitudesh_python_sdk/models/server.py +54 -0
- latitudesh_python_sdk/models/server_action.py +52 -0
- latitudesh_python_sdk/models/server_data.py +219 -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_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.py +15 -0
- latitudesh_python_sdk/models/ssh_key_data.py +55 -0
- latitudesh_python_sdk/models/storage_plan.py +36 -0
- latitudesh_python_sdk/models/storage_plans.py +15 -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 +69 -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 +15 -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 +25 -0
- latitudesh_python_sdk/models/virtual_machine_payload.py +41 -0
- latitudesh_python_sdk/models/virtual_machine_plans.py +180 -0
- latitudesh_python_sdk/models/virtual_network.py +103 -0
- latitudesh_python_sdk/models/virtual_network1.py +84 -0
- latitudesh_python_sdk/models/virtual_network_assignment.py +37 -0
- latitudesh_python_sdk/models/virtual_network_assignments.py +29 -0
- latitudesh_python_sdk/models/virtual_networks.py +26 -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 +188 -0
- latitudesh_python_sdk/plans.py +1178 -0
- latitudesh_python_sdk/privatenetworks.py +1672 -0
- latitudesh_python_sdk/projects_sdk.py +864 -0
- latitudesh_python_sdk/py.typed +1 -0
- latitudesh_python_sdk/regions_sdk.py +376 -0
- latitudesh_python_sdk/roles.py +374 -0
- latitudesh_python_sdk/sdk.py +214 -0
- latitudesh_python_sdk/sdkconfiguration.py +57 -0
- latitudesh_python_sdk/servers_sdk.py +3810 -0
- latitudesh_python_sdk/sshkeys.py +1050 -0
- latitudesh_python_sdk/storage.py +820 -0
- latitudesh_python_sdk/tags.py +786 -0
- latitudesh_python_sdk/teams_sdk.py +596 -0
- latitudesh_python_sdk/teamsmembers.py +578 -0
- latitudesh_python_sdk/traffic_sdk.py +400 -0
- latitudesh_python_sdk/types/__init__.py +21 -0
- latitudesh_python_sdk/types/basemodel.py +39 -0
- latitudesh_python_sdk/userdata_sdk.py +1052 -0
- latitudesh_python_sdk/userprofile.py +596 -0
- latitudesh_python_sdk/utils/__init__.py +101 -0
- latitudesh_python_sdk/utils/annotations.py +55 -0
- latitudesh_python_sdk/utils/enums.py +34 -0
- latitudesh_python_sdk/utils/eventstreaming.py +238 -0
- latitudesh_python_sdk/utils/forms.py +202 -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 +205 -0
- latitudesh_python_sdk/utils/requestbodies.py +66 -0
- latitudesh_python_sdk/utils/retries.py +217 -0
- latitudesh_python_sdk/utils/security.py +192 -0
- latitudesh_python_sdk/utils/serializers.py +219 -0
- latitudesh_python_sdk/utils/url.py +155 -0
- latitudesh_python_sdk/utils/values.py +137 -0
- latitudesh_python_sdk/virtualmachines.py +772 -0
- latitudesh_python_sdk/vpnsessions.py +818 -0
- latitudesh_python_sdk-0.0.6.dist-info/LICENSE +21 -0
- latitudesh_python_sdk-0.0.6.dist-info/METADATA +730 -0
- latitudesh_python_sdk-0.0.6.dist-info/RECORD +206 -0
- latitudesh_python_sdk-0.0.6.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
# pyright: reportReturnType = false
|
|
4
|
+
import asyncio
|
|
5
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
6
|
+
from typing_extensions import Protocol, runtime_checkable
|
|
7
|
+
import httpx
|
|
8
|
+
from typing import Any, Optional, Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@runtime_checkable
|
|
12
|
+
class HttpClient(Protocol):
|
|
13
|
+
def send(
|
|
14
|
+
self,
|
|
15
|
+
request: httpx.Request,
|
|
16
|
+
*,
|
|
17
|
+
stream: bool = False,
|
|
18
|
+
auth: Union[
|
|
19
|
+
httpx._types.AuthTypes, httpx._client.UseClientDefault, None
|
|
20
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
21
|
+
follow_redirects: Union[
|
|
22
|
+
bool, httpx._client.UseClientDefault
|
|
23
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
24
|
+
) -> httpx.Response:
|
|
25
|
+
pass
|
|
26
|
+
|
|
27
|
+
def build_request(
|
|
28
|
+
self,
|
|
29
|
+
method: str,
|
|
30
|
+
url: httpx._types.URLTypes,
|
|
31
|
+
*,
|
|
32
|
+
content: Optional[httpx._types.RequestContent] = None,
|
|
33
|
+
data: Optional[httpx._types.RequestData] = None,
|
|
34
|
+
files: Optional[httpx._types.RequestFiles] = None,
|
|
35
|
+
json: Optional[Any] = None,
|
|
36
|
+
params: Optional[httpx._types.QueryParamTypes] = None,
|
|
37
|
+
headers: Optional[httpx._types.HeaderTypes] = None,
|
|
38
|
+
cookies: Optional[httpx._types.CookieTypes] = None,
|
|
39
|
+
timeout: Union[
|
|
40
|
+
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
|
|
41
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
42
|
+
extensions: Optional[httpx._types.RequestExtensions] = None,
|
|
43
|
+
) -> httpx.Request:
|
|
44
|
+
pass
|
|
45
|
+
|
|
46
|
+
def close(self) -> None:
|
|
47
|
+
pass
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@runtime_checkable
|
|
51
|
+
class AsyncHttpClient(Protocol):
|
|
52
|
+
async def send(
|
|
53
|
+
self,
|
|
54
|
+
request: httpx.Request,
|
|
55
|
+
*,
|
|
56
|
+
stream: bool = False,
|
|
57
|
+
auth: Union[
|
|
58
|
+
httpx._types.AuthTypes, httpx._client.UseClientDefault, None
|
|
59
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
60
|
+
follow_redirects: Union[
|
|
61
|
+
bool, httpx._client.UseClientDefault
|
|
62
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
63
|
+
) -> httpx.Response:
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
def build_request(
|
|
67
|
+
self,
|
|
68
|
+
method: str,
|
|
69
|
+
url: httpx._types.URLTypes,
|
|
70
|
+
*,
|
|
71
|
+
content: Optional[httpx._types.RequestContent] = None,
|
|
72
|
+
data: Optional[httpx._types.RequestData] = None,
|
|
73
|
+
files: Optional[httpx._types.RequestFiles] = None,
|
|
74
|
+
json: Optional[Any] = None,
|
|
75
|
+
params: Optional[httpx._types.QueryParamTypes] = None,
|
|
76
|
+
headers: Optional[httpx._types.HeaderTypes] = None,
|
|
77
|
+
cookies: Optional[httpx._types.CookieTypes] = None,
|
|
78
|
+
timeout: Union[
|
|
79
|
+
httpx._types.TimeoutTypes, httpx._client.UseClientDefault
|
|
80
|
+
] = httpx.USE_CLIENT_DEFAULT,
|
|
81
|
+
extensions: Optional[httpx._types.RequestExtensions] = None,
|
|
82
|
+
) -> httpx.Request:
|
|
83
|
+
pass
|
|
84
|
+
|
|
85
|
+
async def aclose(self) -> None:
|
|
86
|
+
pass
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class ClientOwner(Protocol):
|
|
90
|
+
client: Union[HttpClient, None]
|
|
91
|
+
async_client: Union[AsyncHttpClient, None]
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def close_clients(
|
|
95
|
+
owner: ClientOwner,
|
|
96
|
+
sync_client: Union[HttpClient, None],
|
|
97
|
+
sync_client_supplied: bool,
|
|
98
|
+
async_client: Union[AsyncHttpClient, None],
|
|
99
|
+
async_client_supplied: bool,
|
|
100
|
+
) -> None:
|
|
101
|
+
"""
|
|
102
|
+
A finalizer function that is meant to be used with weakref.finalize to close
|
|
103
|
+
httpx clients used by an SDK so that underlying resources can be garbage
|
|
104
|
+
collected.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
# Unset the client/async_client properties so there are no more references
|
|
108
|
+
# to them from the owning SDK instance and they can be reaped.
|
|
109
|
+
owner.client = None
|
|
110
|
+
owner.async_client = None
|
|
111
|
+
|
|
112
|
+
if sync_client is not None and not sync_client_supplied:
|
|
113
|
+
try:
|
|
114
|
+
sync_client.close()
|
|
115
|
+
except Exception:
|
|
116
|
+
pass
|
|
117
|
+
|
|
118
|
+
if async_client is not None and not async_client_supplied:
|
|
119
|
+
is_async = False
|
|
120
|
+
try:
|
|
121
|
+
asyncio.get_running_loop()
|
|
122
|
+
is_async = True
|
|
123
|
+
except RuntimeError:
|
|
124
|
+
pass
|
|
125
|
+
|
|
126
|
+
try:
|
|
127
|
+
# If this function is called in an async loop then start another
|
|
128
|
+
# loop in a separate thread to close the async http client.
|
|
129
|
+
if is_async:
|
|
130
|
+
with ThreadPoolExecutor(max_workers=1) as executor:
|
|
131
|
+
future = executor.submit(asyncio.run, async_client.aclose())
|
|
132
|
+
future.result()
|
|
133
|
+
else:
|
|
134
|
+
asyncio.run(async_client.aclose())
|
|
135
|
+
except Exception:
|
|
136
|
+
pass
|
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from latitudesh_python_sdk import models, utils
|
|
5
|
+
from latitudesh_python_sdk._hooks import HookContext
|
|
6
|
+
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
7
|
+
from latitudesh_python_sdk.utils import get_security_from_env
|
|
8
|
+
from typing import Any, Mapping, Optional
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class IPAddressesSDK(BaseSDK):
|
|
12
|
+
def list(
|
|
13
|
+
self,
|
|
14
|
+
*,
|
|
15
|
+
filter_server: Optional[str] = None,
|
|
16
|
+
filter_project: Optional[str] = None,
|
|
17
|
+
filter_family: Optional[models.FilterFamily] = None,
|
|
18
|
+
filter_type: Optional[models.FilterType] = None,
|
|
19
|
+
filter_location: Optional[str] = None,
|
|
20
|
+
filter_address: Optional[str] = None,
|
|
21
|
+
extra_fields_ip_addresses: Optional[str] = None,
|
|
22
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
23
|
+
server_url: Optional[str] = None,
|
|
24
|
+
timeout_ms: Optional[int] = None,
|
|
25
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
26
|
+
) -> models.IPAddresses:
|
|
27
|
+
r"""List IPs
|
|
28
|
+
|
|
29
|
+
List all Management and Additional IP Addresses.
|
|
30
|
+
• Management IPs are IPs that are used for the management IP of a device.
|
|
31
|
+
This is a public IP address that a device is born and dies with. It never changes during the lifecycle of the device.
|
|
32
|
+
• Additional IPs are individual IPs that can be added to a device as an additional IP that can be used.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
:param filter_server: The server ID to filter by
|
|
36
|
+
:param filter_project: The project ID or Slug to filter by
|
|
37
|
+
:param filter_family: The protocol family to filter by
|
|
38
|
+
:param filter_type: The protocol type to filter by
|
|
39
|
+
:param filter_location: The site slug to filter by
|
|
40
|
+
:param filter_address: The address of IP to filter by starts_with
|
|
41
|
+
:param extra_fields_ip_addresses: The `region` and `server` are provided as extra attributes that is lazy loaded. To request it, just set `extra_fields[ip_addresses]=region,server` in the query string.
|
|
42
|
+
:param retries: Override the default retry configuration for this method
|
|
43
|
+
:param server_url: Override the default server URL for this method
|
|
44
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
45
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
46
|
+
"""
|
|
47
|
+
base_url = None
|
|
48
|
+
url_variables = None
|
|
49
|
+
if timeout_ms is None:
|
|
50
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
51
|
+
|
|
52
|
+
if server_url is not None:
|
|
53
|
+
base_url = server_url
|
|
54
|
+
else:
|
|
55
|
+
base_url = self._get_url(base_url, url_variables)
|
|
56
|
+
|
|
57
|
+
request = models.GetIpsRequest(
|
|
58
|
+
filter_server=filter_server,
|
|
59
|
+
filter_project=filter_project,
|
|
60
|
+
filter_family=filter_family,
|
|
61
|
+
filter_type=filter_type,
|
|
62
|
+
filter_location=filter_location,
|
|
63
|
+
filter_address=filter_address,
|
|
64
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
req = self._build_request(
|
|
68
|
+
method="GET",
|
|
69
|
+
path="/ips",
|
|
70
|
+
base_url=base_url,
|
|
71
|
+
url_variables=url_variables,
|
|
72
|
+
request=request,
|
|
73
|
+
request_body_required=False,
|
|
74
|
+
request_has_path_params=False,
|
|
75
|
+
request_has_query_params=True,
|
|
76
|
+
user_agent_header="user-agent",
|
|
77
|
+
accept_header_value="application/vnd.api+json",
|
|
78
|
+
http_headers=http_headers,
|
|
79
|
+
security=self.sdk_configuration.security,
|
|
80
|
+
timeout_ms=timeout_ms,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
if retries == UNSET:
|
|
84
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
85
|
+
retries = self.sdk_configuration.retry_config
|
|
86
|
+
|
|
87
|
+
retry_config = None
|
|
88
|
+
if isinstance(retries, utils.RetryConfig):
|
|
89
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
90
|
+
|
|
91
|
+
http_res = self.do_request(
|
|
92
|
+
hook_ctx=HookContext(
|
|
93
|
+
base_url=base_url or "",
|
|
94
|
+
operation_id="get-ips",
|
|
95
|
+
oauth2_scopes=[],
|
|
96
|
+
security_source=get_security_from_env(
|
|
97
|
+
self.sdk_configuration.security, models.Security
|
|
98
|
+
),
|
|
99
|
+
),
|
|
100
|
+
request=req,
|
|
101
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
102
|
+
retry_config=retry_config,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
response_data: Any = None
|
|
106
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
107
|
+
return utils.unmarshal_json(http_res.text, models.IPAddresses)
|
|
108
|
+
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
109
|
+
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
110
|
+
raise models.ErrorObject(data=response_data)
|
|
111
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
112
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
113
|
+
raise models.APIError(
|
|
114
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
115
|
+
)
|
|
116
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
117
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
118
|
+
raise models.APIError(
|
|
119
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
content_type = http_res.headers.get("Content-Type")
|
|
123
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
124
|
+
raise models.APIError(
|
|
125
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
126
|
+
http_res.status_code,
|
|
127
|
+
http_res_text,
|
|
128
|
+
http_res,
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
async def list_async(
|
|
132
|
+
self,
|
|
133
|
+
*,
|
|
134
|
+
filter_server: Optional[str] = None,
|
|
135
|
+
filter_project: Optional[str] = None,
|
|
136
|
+
filter_family: Optional[models.FilterFamily] = None,
|
|
137
|
+
filter_type: Optional[models.FilterType] = None,
|
|
138
|
+
filter_location: Optional[str] = None,
|
|
139
|
+
filter_address: Optional[str] = None,
|
|
140
|
+
extra_fields_ip_addresses: Optional[str] = None,
|
|
141
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
142
|
+
server_url: Optional[str] = None,
|
|
143
|
+
timeout_ms: Optional[int] = None,
|
|
144
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
145
|
+
) -> models.IPAddresses:
|
|
146
|
+
r"""List IPs
|
|
147
|
+
|
|
148
|
+
List all Management and Additional IP Addresses.
|
|
149
|
+
• Management IPs are IPs that are used for the management IP of a device.
|
|
150
|
+
This is a public IP address that a device is born and dies with. It never changes during the lifecycle of the device.
|
|
151
|
+
• Additional IPs are individual IPs that can be added to a device as an additional IP that can be used.
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
:param filter_server: The server ID to filter by
|
|
155
|
+
:param filter_project: The project ID or Slug to filter by
|
|
156
|
+
:param filter_family: The protocol family to filter by
|
|
157
|
+
:param filter_type: The protocol type to filter by
|
|
158
|
+
:param filter_location: The site slug to filter by
|
|
159
|
+
:param filter_address: The address of IP to filter by starts_with
|
|
160
|
+
:param extra_fields_ip_addresses: The `region` and `server` are provided as extra attributes that is lazy loaded. To request it, just set `extra_fields[ip_addresses]=region,server` in the query string.
|
|
161
|
+
:param retries: Override the default retry configuration for this method
|
|
162
|
+
:param server_url: Override the default server URL for this method
|
|
163
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
164
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
165
|
+
"""
|
|
166
|
+
base_url = None
|
|
167
|
+
url_variables = None
|
|
168
|
+
if timeout_ms is None:
|
|
169
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
170
|
+
|
|
171
|
+
if server_url is not None:
|
|
172
|
+
base_url = server_url
|
|
173
|
+
else:
|
|
174
|
+
base_url = self._get_url(base_url, url_variables)
|
|
175
|
+
|
|
176
|
+
request = models.GetIpsRequest(
|
|
177
|
+
filter_server=filter_server,
|
|
178
|
+
filter_project=filter_project,
|
|
179
|
+
filter_family=filter_family,
|
|
180
|
+
filter_type=filter_type,
|
|
181
|
+
filter_location=filter_location,
|
|
182
|
+
filter_address=filter_address,
|
|
183
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
req = self._build_request_async(
|
|
187
|
+
method="GET",
|
|
188
|
+
path="/ips",
|
|
189
|
+
base_url=base_url,
|
|
190
|
+
url_variables=url_variables,
|
|
191
|
+
request=request,
|
|
192
|
+
request_body_required=False,
|
|
193
|
+
request_has_path_params=False,
|
|
194
|
+
request_has_query_params=True,
|
|
195
|
+
user_agent_header="user-agent",
|
|
196
|
+
accept_header_value="application/vnd.api+json",
|
|
197
|
+
http_headers=http_headers,
|
|
198
|
+
security=self.sdk_configuration.security,
|
|
199
|
+
timeout_ms=timeout_ms,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
if retries == UNSET:
|
|
203
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
204
|
+
retries = self.sdk_configuration.retry_config
|
|
205
|
+
|
|
206
|
+
retry_config = None
|
|
207
|
+
if isinstance(retries, utils.RetryConfig):
|
|
208
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
209
|
+
|
|
210
|
+
http_res = await self.do_request_async(
|
|
211
|
+
hook_ctx=HookContext(
|
|
212
|
+
base_url=base_url or "",
|
|
213
|
+
operation_id="get-ips",
|
|
214
|
+
oauth2_scopes=[],
|
|
215
|
+
security_source=get_security_from_env(
|
|
216
|
+
self.sdk_configuration.security, models.Security
|
|
217
|
+
),
|
|
218
|
+
),
|
|
219
|
+
request=req,
|
|
220
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
221
|
+
retry_config=retry_config,
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
response_data: Any = None
|
|
225
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
226
|
+
return utils.unmarshal_json(http_res.text, models.IPAddresses)
|
|
227
|
+
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
228
|
+
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
229
|
+
raise models.ErrorObject(data=response_data)
|
|
230
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
231
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
232
|
+
raise models.APIError(
|
|
233
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
234
|
+
)
|
|
235
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
236
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
237
|
+
raise models.APIError(
|
|
238
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
content_type = http_res.headers.get("Content-Type")
|
|
242
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
243
|
+
raise models.APIError(
|
|
244
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
245
|
+
http_res.status_code,
|
|
246
|
+
http_res_text,
|
|
247
|
+
http_res,
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
def get(
|
|
251
|
+
self,
|
|
252
|
+
*,
|
|
253
|
+
ip_id: str,
|
|
254
|
+
extra_fields_ip_addresses: Optional[str] = None,
|
|
255
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
256
|
+
server_url: Optional[str] = None,
|
|
257
|
+
timeout_ms: Optional[int] = None,
|
|
258
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
259
|
+
) -> models.IPAddress:
|
|
260
|
+
r"""Retrieve an IP
|
|
261
|
+
|
|
262
|
+
Retrieve an IP Address
|
|
263
|
+
|
|
264
|
+
:param ip_id: The IP Address ID
|
|
265
|
+
:param extra_fields_ip_addresses: The `region` and `server` are provided as extra attributes that is lazy loaded. To request it, just set `extra_fields[ip_addresses]=region,server` in the query string.
|
|
266
|
+
:param retries: Override the default retry configuration for this method
|
|
267
|
+
:param server_url: Override the default server URL for this method
|
|
268
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
269
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
270
|
+
"""
|
|
271
|
+
base_url = None
|
|
272
|
+
url_variables = None
|
|
273
|
+
if timeout_ms is None:
|
|
274
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
275
|
+
|
|
276
|
+
if server_url is not None:
|
|
277
|
+
base_url = server_url
|
|
278
|
+
else:
|
|
279
|
+
base_url = self._get_url(base_url, url_variables)
|
|
280
|
+
|
|
281
|
+
request = models.GetIPRequest(
|
|
282
|
+
ip_id=ip_id,
|
|
283
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
req = self._build_request(
|
|
287
|
+
method="GET",
|
|
288
|
+
path="/ips/{ip_id}",
|
|
289
|
+
base_url=base_url,
|
|
290
|
+
url_variables=url_variables,
|
|
291
|
+
request=request,
|
|
292
|
+
request_body_required=False,
|
|
293
|
+
request_has_path_params=True,
|
|
294
|
+
request_has_query_params=True,
|
|
295
|
+
user_agent_header="user-agent",
|
|
296
|
+
accept_header_value="application/vnd.api+json",
|
|
297
|
+
http_headers=http_headers,
|
|
298
|
+
security=self.sdk_configuration.security,
|
|
299
|
+
timeout_ms=timeout_ms,
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
if retries == UNSET:
|
|
303
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
304
|
+
retries = self.sdk_configuration.retry_config
|
|
305
|
+
|
|
306
|
+
retry_config = None
|
|
307
|
+
if isinstance(retries, utils.RetryConfig):
|
|
308
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
309
|
+
|
|
310
|
+
http_res = self.do_request(
|
|
311
|
+
hook_ctx=HookContext(
|
|
312
|
+
base_url=base_url or "",
|
|
313
|
+
operation_id="get-ip",
|
|
314
|
+
oauth2_scopes=[],
|
|
315
|
+
security_source=get_security_from_env(
|
|
316
|
+
self.sdk_configuration.security, models.Security
|
|
317
|
+
),
|
|
318
|
+
),
|
|
319
|
+
request=req,
|
|
320
|
+
error_status_codes=["404", "4XX", "5XX"],
|
|
321
|
+
retry_config=retry_config,
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
response_data: Any = None
|
|
325
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
326
|
+
return utils.unmarshal_json(http_res.text, models.IPAddress)
|
|
327
|
+
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
328
|
+
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
329
|
+
raise models.ErrorObject(data=response_data)
|
|
330
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
331
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
332
|
+
raise models.APIError(
|
|
333
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
334
|
+
)
|
|
335
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
336
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
337
|
+
raise models.APIError(
|
|
338
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
content_type = http_res.headers.get("Content-Type")
|
|
342
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
343
|
+
raise models.APIError(
|
|
344
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
345
|
+
http_res.status_code,
|
|
346
|
+
http_res_text,
|
|
347
|
+
http_res,
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
async def get_async(
|
|
351
|
+
self,
|
|
352
|
+
*,
|
|
353
|
+
ip_id: str,
|
|
354
|
+
extra_fields_ip_addresses: Optional[str] = None,
|
|
355
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
356
|
+
server_url: Optional[str] = None,
|
|
357
|
+
timeout_ms: Optional[int] = None,
|
|
358
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
359
|
+
) -> models.IPAddress:
|
|
360
|
+
r"""Retrieve an IP
|
|
361
|
+
|
|
362
|
+
Retrieve an IP Address
|
|
363
|
+
|
|
364
|
+
:param ip_id: The IP Address ID
|
|
365
|
+
:param extra_fields_ip_addresses: The `region` and `server` are provided as extra attributes that is lazy loaded. To request it, just set `extra_fields[ip_addresses]=region,server` in the query string.
|
|
366
|
+
:param retries: Override the default retry configuration for this method
|
|
367
|
+
:param server_url: Override the default server URL for this method
|
|
368
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
369
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
370
|
+
"""
|
|
371
|
+
base_url = None
|
|
372
|
+
url_variables = None
|
|
373
|
+
if timeout_ms is None:
|
|
374
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
375
|
+
|
|
376
|
+
if server_url is not None:
|
|
377
|
+
base_url = server_url
|
|
378
|
+
else:
|
|
379
|
+
base_url = self._get_url(base_url, url_variables)
|
|
380
|
+
|
|
381
|
+
request = models.GetIPRequest(
|
|
382
|
+
ip_id=ip_id,
|
|
383
|
+
extra_fields_ip_addresses=extra_fields_ip_addresses,
|
|
384
|
+
)
|
|
385
|
+
|
|
386
|
+
req = self._build_request_async(
|
|
387
|
+
method="GET",
|
|
388
|
+
path="/ips/{ip_id}",
|
|
389
|
+
base_url=base_url,
|
|
390
|
+
url_variables=url_variables,
|
|
391
|
+
request=request,
|
|
392
|
+
request_body_required=False,
|
|
393
|
+
request_has_path_params=True,
|
|
394
|
+
request_has_query_params=True,
|
|
395
|
+
user_agent_header="user-agent",
|
|
396
|
+
accept_header_value="application/vnd.api+json",
|
|
397
|
+
http_headers=http_headers,
|
|
398
|
+
security=self.sdk_configuration.security,
|
|
399
|
+
timeout_ms=timeout_ms,
|
|
400
|
+
)
|
|
401
|
+
|
|
402
|
+
if retries == UNSET:
|
|
403
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
404
|
+
retries = self.sdk_configuration.retry_config
|
|
405
|
+
|
|
406
|
+
retry_config = None
|
|
407
|
+
if isinstance(retries, utils.RetryConfig):
|
|
408
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
409
|
+
|
|
410
|
+
http_res = await self.do_request_async(
|
|
411
|
+
hook_ctx=HookContext(
|
|
412
|
+
base_url=base_url or "",
|
|
413
|
+
operation_id="get-ip",
|
|
414
|
+
oauth2_scopes=[],
|
|
415
|
+
security_source=get_security_from_env(
|
|
416
|
+
self.sdk_configuration.security, models.Security
|
|
417
|
+
),
|
|
418
|
+
),
|
|
419
|
+
request=req,
|
|
420
|
+
error_status_codes=["404", "4XX", "5XX"],
|
|
421
|
+
retry_config=retry_config,
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
response_data: Any = None
|
|
425
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
426
|
+
return utils.unmarshal_json(http_res.text, models.IPAddress)
|
|
427
|
+
if utils.match_response(http_res, "404", "application/vnd.api+json"):
|
|
428
|
+
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
429
|
+
raise models.ErrorObject(data=response_data)
|
|
430
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
431
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
432
|
+
raise models.APIError(
|
|
433
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
434
|
+
)
|
|
435
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
436
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
437
|
+
raise models.APIError(
|
|
438
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
content_type = http_res.headers.get("Content-Type")
|
|
442
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
443
|
+
raise models.APIError(
|
|
444
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
445
|
+
http_res.status_code,
|
|
446
|
+
http_res_text,
|
|
447
|
+
http_res,
|
|
448
|
+
)
|