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,77 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .region_resource_data import RegionResourceData, RegionResourceDataTypedDict
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from latitudesh_python_sdk.types import BaseModel
|
|
7
|
+
from typing import Optional
|
|
8
|
+
from typing_extensions import NotRequired, TypedDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class VpnSessionDataWithPasswordType(str, Enum):
|
|
12
|
+
VPN_SESSIONS = "vpn_sessions"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class VpnSessionDataWithPasswordStatus(str, Enum):
|
|
16
|
+
r"""from Firewall Response"""
|
|
17
|
+
|
|
18
|
+
ENABLE = "enable"
|
|
19
|
+
DISABLE = "disable"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class VpnSessionDataWithPasswordAttributesTypedDict(TypedDict):
|
|
23
|
+
user_name: NotRequired[str]
|
|
24
|
+
r"""VPN username"""
|
|
25
|
+
password: NotRequired[str]
|
|
26
|
+
r"""VPN password"""
|
|
27
|
+
port: NotRequired[str]
|
|
28
|
+
r"""VPN port"""
|
|
29
|
+
host: NotRequired[str]
|
|
30
|
+
r"""VPN host"""
|
|
31
|
+
region: NotRequired[RegionResourceDataTypedDict]
|
|
32
|
+
status: NotRequired[VpnSessionDataWithPasswordStatus]
|
|
33
|
+
r"""from Firewall Response"""
|
|
34
|
+
expires_at: NotRequired[str]
|
|
35
|
+
r"""Time to expiry"""
|
|
36
|
+
created_at: NotRequired[str]
|
|
37
|
+
updated_at: NotRequired[str]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class VpnSessionDataWithPasswordAttributes(BaseModel):
|
|
41
|
+
user_name: Optional[str] = None
|
|
42
|
+
r"""VPN username"""
|
|
43
|
+
|
|
44
|
+
password: Optional[str] = None
|
|
45
|
+
r"""VPN password"""
|
|
46
|
+
|
|
47
|
+
port: Optional[str] = None
|
|
48
|
+
r"""VPN port"""
|
|
49
|
+
|
|
50
|
+
host: Optional[str] = None
|
|
51
|
+
r"""VPN host"""
|
|
52
|
+
|
|
53
|
+
region: Optional[RegionResourceData] = None
|
|
54
|
+
|
|
55
|
+
status: Optional[VpnSessionDataWithPasswordStatus] = None
|
|
56
|
+
r"""from Firewall Response"""
|
|
57
|
+
|
|
58
|
+
expires_at: Optional[str] = None
|
|
59
|
+
r"""Time to expiry"""
|
|
60
|
+
|
|
61
|
+
created_at: Optional[str] = None
|
|
62
|
+
|
|
63
|
+
updated_at: Optional[str] = None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class VpnSessionDataWithPasswordTypedDict(TypedDict):
|
|
67
|
+
id: NotRequired[str]
|
|
68
|
+
type: NotRequired[VpnSessionDataWithPasswordType]
|
|
69
|
+
attributes: NotRequired[VpnSessionDataWithPasswordAttributesTypedDict]
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class VpnSessionDataWithPassword(BaseModel):
|
|
73
|
+
id: Optional[str] = None
|
|
74
|
+
|
|
75
|
+
type: Optional[VpnSessionDataWithPasswordType] = None
|
|
76
|
+
|
|
77
|
+
attributes: Optional[VpnSessionDataWithPasswordAttributes] = None
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .vpn_session_data_with_password import (
|
|
5
|
+
VpnSessionDataWithPassword,
|
|
6
|
+
VpnSessionDataWithPasswordTypedDict,
|
|
7
|
+
)
|
|
8
|
+
from latitudesh_python_sdk.types import BaseModel
|
|
9
|
+
from typing import Optional
|
|
10
|
+
from typing_extensions import NotRequired, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class VpnSessionWithPasswordTypedDict(TypedDict):
|
|
14
|
+
data: NotRequired[VpnSessionDataWithPasswordTypedDict]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class VpnSessionWithPassword(BaseModel):
|
|
18
|
+
data: Optional[VpnSessionDataWithPassword] = None
|
|
@@ -0,0 +1,188 @@
|
|
|
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 Mapping, Optional
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class OperatingSystemsSDK(BaseSDK):
|
|
12
|
+
def list(
|
|
13
|
+
self,
|
|
14
|
+
*,
|
|
15
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
16
|
+
server_url: Optional[str] = None,
|
|
17
|
+
timeout_ms: Optional[int] = None,
|
|
18
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
19
|
+
) -> models.GetPlansOperatingSystemResponseBody:
|
|
20
|
+
r"""List all operating systems available
|
|
21
|
+
|
|
22
|
+
Lists all operating systems available to deploy and reinstall.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
:param retries: Override the default retry configuration for this method
|
|
26
|
+
:param server_url: Override the default server URL for this method
|
|
27
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
28
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
29
|
+
"""
|
|
30
|
+
base_url = None
|
|
31
|
+
url_variables = None
|
|
32
|
+
if timeout_ms is None:
|
|
33
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
34
|
+
|
|
35
|
+
if server_url is not None:
|
|
36
|
+
base_url = server_url
|
|
37
|
+
else:
|
|
38
|
+
base_url = self._get_url(base_url, url_variables)
|
|
39
|
+
req = self._build_request(
|
|
40
|
+
method="GET",
|
|
41
|
+
path="/plans/operating_systems",
|
|
42
|
+
base_url=base_url,
|
|
43
|
+
url_variables=url_variables,
|
|
44
|
+
request=None,
|
|
45
|
+
request_body_required=False,
|
|
46
|
+
request_has_path_params=False,
|
|
47
|
+
request_has_query_params=True,
|
|
48
|
+
user_agent_header="user-agent",
|
|
49
|
+
accept_header_value="application/vnd.api+json",
|
|
50
|
+
http_headers=http_headers,
|
|
51
|
+
security=self.sdk_configuration.security,
|
|
52
|
+
timeout_ms=timeout_ms,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
if retries == UNSET:
|
|
56
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
57
|
+
retries = self.sdk_configuration.retry_config
|
|
58
|
+
|
|
59
|
+
retry_config = None
|
|
60
|
+
if isinstance(retries, utils.RetryConfig):
|
|
61
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
62
|
+
|
|
63
|
+
http_res = self.do_request(
|
|
64
|
+
hook_ctx=HookContext(
|
|
65
|
+
base_url=base_url or "",
|
|
66
|
+
operation_id="get-plans-operating-system",
|
|
67
|
+
oauth2_scopes=[],
|
|
68
|
+
security_source=get_security_from_env(
|
|
69
|
+
self.sdk_configuration.security, models.Security
|
|
70
|
+
),
|
|
71
|
+
),
|
|
72
|
+
request=req,
|
|
73
|
+
error_status_codes=["4XX", "5XX"],
|
|
74
|
+
retry_config=retry_config,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
78
|
+
return utils.unmarshal_json(
|
|
79
|
+
http_res.text, models.GetPlansOperatingSystemResponseBody
|
|
80
|
+
)
|
|
81
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
82
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
83
|
+
raise models.APIError(
|
|
84
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
85
|
+
)
|
|
86
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
87
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
88
|
+
raise models.APIError(
|
|
89
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
content_type = http_res.headers.get("Content-Type")
|
|
93
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
94
|
+
raise models.APIError(
|
|
95
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
96
|
+
http_res.status_code,
|
|
97
|
+
http_res_text,
|
|
98
|
+
http_res,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
async def list_async(
|
|
102
|
+
self,
|
|
103
|
+
*,
|
|
104
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
105
|
+
server_url: Optional[str] = None,
|
|
106
|
+
timeout_ms: Optional[int] = None,
|
|
107
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
108
|
+
) -> models.GetPlansOperatingSystemResponseBody:
|
|
109
|
+
r"""List all operating systems available
|
|
110
|
+
|
|
111
|
+
Lists all operating systems available to deploy and reinstall.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
:param retries: Override the default retry configuration for this method
|
|
115
|
+
:param server_url: Override the default server URL for this method
|
|
116
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
117
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
118
|
+
"""
|
|
119
|
+
base_url = None
|
|
120
|
+
url_variables = None
|
|
121
|
+
if timeout_ms is None:
|
|
122
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
123
|
+
|
|
124
|
+
if server_url is not None:
|
|
125
|
+
base_url = server_url
|
|
126
|
+
else:
|
|
127
|
+
base_url = self._get_url(base_url, url_variables)
|
|
128
|
+
req = self._build_request_async(
|
|
129
|
+
method="GET",
|
|
130
|
+
path="/plans/operating_systems",
|
|
131
|
+
base_url=base_url,
|
|
132
|
+
url_variables=url_variables,
|
|
133
|
+
request=None,
|
|
134
|
+
request_body_required=False,
|
|
135
|
+
request_has_path_params=False,
|
|
136
|
+
request_has_query_params=True,
|
|
137
|
+
user_agent_header="user-agent",
|
|
138
|
+
accept_header_value="application/vnd.api+json",
|
|
139
|
+
http_headers=http_headers,
|
|
140
|
+
security=self.sdk_configuration.security,
|
|
141
|
+
timeout_ms=timeout_ms,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
if retries == UNSET:
|
|
145
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
146
|
+
retries = self.sdk_configuration.retry_config
|
|
147
|
+
|
|
148
|
+
retry_config = None
|
|
149
|
+
if isinstance(retries, utils.RetryConfig):
|
|
150
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
151
|
+
|
|
152
|
+
http_res = await self.do_request_async(
|
|
153
|
+
hook_ctx=HookContext(
|
|
154
|
+
base_url=base_url or "",
|
|
155
|
+
operation_id="get-plans-operating-system",
|
|
156
|
+
oauth2_scopes=[],
|
|
157
|
+
security_source=get_security_from_env(
|
|
158
|
+
self.sdk_configuration.security, models.Security
|
|
159
|
+
),
|
|
160
|
+
),
|
|
161
|
+
request=req,
|
|
162
|
+
error_status_codes=["4XX", "5XX"],
|
|
163
|
+
retry_config=retry_config,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
167
|
+
return utils.unmarshal_json(
|
|
168
|
+
http_res.text, models.GetPlansOperatingSystemResponseBody
|
|
169
|
+
)
|
|
170
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
171
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
172
|
+
raise models.APIError(
|
|
173
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
174
|
+
)
|
|
175
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
176
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
177
|
+
raise models.APIError(
|
|
178
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
content_type = http_res.headers.get("Content-Type")
|
|
182
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
183
|
+
raise models.APIError(
|
|
184
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
185
|
+
http_res.status_code,
|
|
186
|
+
http_res_text,
|
|
187
|
+
http_res,
|
|
188
|
+
)
|