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,715 @@
|
|
|
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 latitudesh_python_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Mapping, Optional, Union
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class VpnSessions(BaseSDK):
|
|
13
|
+
def list(
|
|
14
|
+
self,
|
|
15
|
+
*,
|
|
16
|
+
filter_location: Optional[models.FilterLocation] = None,
|
|
17
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
18
|
+
server_url: Optional[str] = None,
|
|
19
|
+
timeout_ms: Optional[int] = None,
|
|
20
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
21
|
+
) -> models.GetVpnSessionsResponseBody:
|
|
22
|
+
r"""List all Active VPN Sessions
|
|
23
|
+
|
|
24
|
+
:param filter_location:
|
|
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
|
+
|
|
40
|
+
request = models.GetVpnSessionsRequest(
|
|
41
|
+
filter_location=filter_location,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
req = self._build_request(
|
|
45
|
+
method="GET",
|
|
46
|
+
path="/vpn_sessions",
|
|
47
|
+
base_url=base_url,
|
|
48
|
+
url_variables=url_variables,
|
|
49
|
+
request=request,
|
|
50
|
+
request_body_required=False,
|
|
51
|
+
request_has_path_params=False,
|
|
52
|
+
request_has_query_params=True,
|
|
53
|
+
user_agent_header="user-agent",
|
|
54
|
+
accept_header_value="application/vnd.api+json",
|
|
55
|
+
http_headers=http_headers,
|
|
56
|
+
security=self.sdk_configuration.security,
|
|
57
|
+
allow_empty_value=None,
|
|
58
|
+
timeout_ms=timeout_ms,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
if retries == UNSET:
|
|
62
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
63
|
+
retries = self.sdk_configuration.retry_config
|
|
64
|
+
|
|
65
|
+
retry_config = None
|
|
66
|
+
if isinstance(retries, utils.RetryConfig):
|
|
67
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
68
|
+
|
|
69
|
+
http_res = self.do_request(
|
|
70
|
+
hook_ctx=HookContext(
|
|
71
|
+
config=self.sdk_configuration,
|
|
72
|
+
base_url=base_url or "",
|
|
73
|
+
operation_id="get-vpn-sessions",
|
|
74
|
+
oauth2_scopes=None,
|
|
75
|
+
security_source=get_security_from_env(
|
|
76
|
+
self.sdk_configuration.security, models.Security
|
|
77
|
+
),
|
|
78
|
+
),
|
|
79
|
+
request=req,
|
|
80
|
+
error_status_codes=["4XX", "5XX"],
|
|
81
|
+
retry_config=retry_config,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
85
|
+
return unmarshal_json_response(models.GetVpnSessionsResponseBody, http_res)
|
|
86
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
87
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
88
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
89
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
90
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
91
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
92
|
+
|
|
93
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
94
|
+
|
|
95
|
+
async def list_async(
|
|
96
|
+
self,
|
|
97
|
+
*,
|
|
98
|
+
filter_location: Optional[models.FilterLocation] = None,
|
|
99
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
100
|
+
server_url: Optional[str] = None,
|
|
101
|
+
timeout_ms: Optional[int] = None,
|
|
102
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
103
|
+
) -> models.GetVpnSessionsResponseBody:
|
|
104
|
+
r"""List all Active VPN Sessions
|
|
105
|
+
|
|
106
|
+
:param filter_location:
|
|
107
|
+
:param retries: Override the default retry configuration for this method
|
|
108
|
+
:param server_url: Override the default server URL for this method
|
|
109
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
110
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
111
|
+
"""
|
|
112
|
+
base_url = None
|
|
113
|
+
url_variables = None
|
|
114
|
+
if timeout_ms is None:
|
|
115
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
116
|
+
|
|
117
|
+
if server_url is not None:
|
|
118
|
+
base_url = server_url
|
|
119
|
+
else:
|
|
120
|
+
base_url = self._get_url(base_url, url_variables)
|
|
121
|
+
|
|
122
|
+
request = models.GetVpnSessionsRequest(
|
|
123
|
+
filter_location=filter_location,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
req = self._build_request_async(
|
|
127
|
+
method="GET",
|
|
128
|
+
path="/vpn_sessions",
|
|
129
|
+
base_url=base_url,
|
|
130
|
+
url_variables=url_variables,
|
|
131
|
+
request=request,
|
|
132
|
+
request_body_required=False,
|
|
133
|
+
request_has_path_params=False,
|
|
134
|
+
request_has_query_params=True,
|
|
135
|
+
user_agent_header="user-agent",
|
|
136
|
+
accept_header_value="application/vnd.api+json",
|
|
137
|
+
http_headers=http_headers,
|
|
138
|
+
security=self.sdk_configuration.security,
|
|
139
|
+
allow_empty_value=None,
|
|
140
|
+
timeout_ms=timeout_ms,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
if retries == UNSET:
|
|
144
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
145
|
+
retries = self.sdk_configuration.retry_config
|
|
146
|
+
|
|
147
|
+
retry_config = None
|
|
148
|
+
if isinstance(retries, utils.RetryConfig):
|
|
149
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
150
|
+
|
|
151
|
+
http_res = await self.do_request_async(
|
|
152
|
+
hook_ctx=HookContext(
|
|
153
|
+
config=self.sdk_configuration,
|
|
154
|
+
base_url=base_url or "",
|
|
155
|
+
operation_id="get-vpn-sessions",
|
|
156
|
+
oauth2_scopes=None,
|
|
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 unmarshal_json_response(models.GetVpnSessionsResponseBody, http_res)
|
|
168
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
169
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
170
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
171
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
172
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
173
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
174
|
+
|
|
175
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
176
|
+
|
|
177
|
+
def create(
|
|
178
|
+
self,
|
|
179
|
+
*,
|
|
180
|
+
data: Optional[
|
|
181
|
+
Union[
|
|
182
|
+
models.PostVpnSessionVpnSessionsData,
|
|
183
|
+
models.PostVpnSessionVpnSessionsDataTypedDict,
|
|
184
|
+
]
|
|
185
|
+
] = None,
|
|
186
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
187
|
+
server_url: Optional[str] = None,
|
|
188
|
+
timeout_ms: Optional[int] = None,
|
|
189
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
190
|
+
) -> models.VpnSessionWithPassword:
|
|
191
|
+
r"""Create a VPN Session
|
|
192
|
+
|
|
193
|
+
Creates a new VPN Session.
|
|
194
|
+
`NOTE:` The VPN credentials are only listed ONCE upon creation. They can however be refreshed or deleted.
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
:param data:
|
|
198
|
+
:param retries: Override the default retry configuration for this method
|
|
199
|
+
:param server_url: Override the default server URL for this method
|
|
200
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
201
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
202
|
+
"""
|
|
203
|
+
base_url = None
|
|
204
|
+
url_variables = None
|
|
205
|
+
if timeout_ms is None:
|
|
206
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
207
|
+
|
|
208
|
+
if server_url is not None:
|
|
209
|
+
base_url = server_url
|
|
210
|
+
else:
|
|
211
|
+
base_url = self._get_url(base_url, url_variables)
|
|
212
|
+
|
|
213
|
+
request = models.PostVpnSessionVpnSessionsRequestBody(
|
|
214
|
+
data=utils.get_pydantic_model(
|
|
215
|
+
data, Optional[models.PostVpnSessionVpnSessionsData]
|
|
216
|
+
),
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
req = self._build_request(
|
|
220
|
+
method="POST",
|
|
221
|
+
path="/vpn_sessions",
|
|
222
|
+
base_url=base_url,
|
|
223
|
+
url_variables=url_variables,
|
|
224
|
+
request=request,
|
|
225
|
+
request_body_required=True,
|
|
226
|
+
request_has_path_params=False,
|
|
227
|
+
request_has_query_params=True,
|
|
228
|
+
user_agent_header="user-agent",
|
|
229
|
+
accept_header_value="application/vnd.api+json",
|
|
230
|
+
http_headers=http_headers,
|
|
231
|
+
security=self.sdk_configuration.security,
|
|
232
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
233
|
+
request,
|
|
234
|
+
False,
|
|
235
|
+
False,
|
|
236
|
+
"json",
|
|
237
|
+
models.PostVpnSessionVpnSessionsRequestBody,
|
|
238
|
+
),
|
|
239
|
+
allow_empty_value=None,
|
|
240
|
+
timeout_ms=timeout_ms,
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
if retries == UNSET:
|
|
244
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
245
|
+
retries = self.sdk_configuration.retry_config
|
|
246
|
+
|
|
247
|
+
retry_config = None
|
|
248
|
+
if isinstance(retries, utils.RetryConfig):
|
|
249
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
250
|
+
|
|
251
|
+
http_res = self.do_request(
|
|
252
|
+
hook_ctx=HookContext(
|
|
253
|
+
config=self.sdk_configuration,
|
|
254
|
+
base_url=base_url or "",
|
|
255
|
+
operation_id="post-vpn-session",
|
|
256
|
+
oauth2_scopes=None,
|
|
257
|
+
security_source=get_security_from_env(
|
|
258
|
+
self.sdk_configuration.security, models.Security
|
|
259
|
+
),
|
|
260
|
+
),
|
|
261
|
+
request=req,
|
|
262
|
+
error_status_codes=["4XX", "5XX"],
|
|
263
|
+
retry_config=retry_config,
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
267
|
+
return unmarshal_json_response(models.VpnSessionWithPassword, http_res)
|
|
268
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
269
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
270
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
271
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
272
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
273
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
274
|
+
|
|
275
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
276
|
+
|
|
277
|
+
async def create_async(
|
|
278
|
+
self,
|
|
279
|
+
*,
|
|
280
|
+
data: Optional[
|
|
281
|
+
Union[
|
|
282
|
+
models.PostVpnSessionVpnSessionsData,
|
|
283
|
+
models.PostVpnSessionVpnSessionsDataTypedDict,
|
|
284
|
+
]
|
|
285
|
+
] = None,
|
|
286
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
287
|
+
server_url: Optional[str] = None,
|
|
288
|
+
timeout_ms: Optional[int] = None,
|
|
289
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
290
|
+
) -> models.VpnSessionWithPassword:
|
|
291
|
+
r"""Create a VPN Session
|
|
292
|
+
|
|
293
|
+
Creates a new VPN Session.
|
|
294
|
+
`NOTE:` The VPN credentials are only listed ONCE upon creation. They can however be refreshed or deleted.
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
:param data:
|
|
298
|
+
:param retries: Override the default retry configuration for this method
|
|
299
|
+
:param server_url: Override the default server URL for this method
|
|
300
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
301
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
302
|
+
"""
|
|
303
|
+
base_url = None
|
|
304
|
+
url_variables = None
|
|
305
|
+
if timeout_ms is None:
|
|
306
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
307
|
+
|
|
308
|
+
if server_url is not None:
|
|
309
|
+
base_url = server_url
|
|
310
|
+
else:
|
|
311
|
+
base_url = self._get_url(base_url, url_variables)
|
|
312
|
+
|
|
313
|
+
request = models.PostVpnSessionVpnSessionsRequestBody(
|
|
314
|
+
data=utils.get_pydantic_model(
|
|
315
|
+
data, Optional[models.PostVpnSessionVpnSessionsData]
|
|
316
|
+
),
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
req = self._build_request_async(
|
|
320
|
+
method="POST",
|
|
321
|
+
path="/vpn_sessions",
|
|
322
|
+
base_url=base_url,
|
|
323
|
+
url_variables=url_variables,
|
|
324
|
+
request=request,
|
|
325
|
+
request_body_required=True,
|
|
326
|
+
request_has_path_params=False,
|
|
327
|
+
request_has_query_params=True,
|
|
328
|
+
user_agent_header="user-agent",
|
|
329
|
+
accept_header_value="application/vnd.api+json",
|
|
330
|
+
http_headers=http_headers,
|
|
331
|
+
security=self.sdk_configuration.security,
|
|
332
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
333
|
+
request,
|
|
334
|
+
False,
|
|
335
|
+
False,
|
|
336
|
+
"json",
|
|
337
|
+
models.PostVpnSessionVpnSessionsRequestBody,
|
|
338
|
+
),
|
|
339
|
+
allow_empty_value=None,
|
|
340
|
+
timeout_ms=timeout_ms,
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
if retries == UNSET:
|
|
344
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
345
|
+
retries = self.sdk_configuration.retry_config
|
|
346
|
+
|
|
347
|
+
retry_config = None
|
|
348
|
+
if isinstance(retries, utils.RetryConfig):
|
|
349
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
350
|
+
|
|
351
|
+
http_res = await self.do_request_async(
|
|
352
|
+
hook_ctx=HookContext(
|
|
353
|
+
config=self.sdk_configuration,
|
|
354
|
+
base_url=base_url or "",
|
|
355
|
+
operation_id="post-vpn-session",
|
|
356
|
+
oauth2_scopes=None,
|
|
357
|
+
security_source=get_security_from_env(
|
|
358
|
+
self.sdk_configuration.security, models.Security
|
|
359
|
+
),
|
|
360
|
+
),
|
|
361
|
+
request=req,
|
|
362
|
+
error_status_codes=["4XX", "5XX"],
|
|
363
|
+
retry_config=retry_config,
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
if utils.match_response(http_res, "201", "application/vnd.api+json"):
|
|
367
|
+
return unmarshal_json_response(models.VpnSessionWithPassword, http_res)
|
|
368
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
369
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
370
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
371
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
372
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
373
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
374
|
+
|
|
375
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
376
|
+
|
|
377
|
+
def refresh_password(
|
|
378
|
+
self,
|
|
379
|
+
*,
|
|
380
|
+
vpn_session_id: str,
|
|
381
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
382
|
+
server_url: Optional[str] = None,
|
|
383
|
+
timeout_ms: Optional[int] = None,
|
|
384
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
385
|
+
) -> models.VpnSessionWithPassword:
|
|
386
|
+
r"""Refresh a VPN Session
|
|
387
|
+
|
|
388
|
+
Refreshing an existing VPN Session will create new credentials for that session
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
:param vpn_session_id:
|
|
392
|
+
:param retries: Override the default retry configuration for this method
|
|
393
|
+
:param server_url: Override the default server URL for this method
|
|
394
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
395
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
396
|
+
"""
|
|
397
|
+
base_url = None
|
|
398
|
+
url_variables = None
|
|
399
|
+
if timeout_ms is None:
|
|
400
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
401
|
+
|
|
402
|
+
if server_url is not None:
|
|
403
|
+
base_url = server_url
|
|
404
|
+
else:
|
|
405
|
+
base_url = self._get_url(base_url, url_variables)
|
|
406
|
+
|
|
407
|
+
request = models.PutVpnSessionRequest(
|
|
408
|
+
vpn_session_id=vpn_session_id,
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
req = self._build_request(
|
|
412
|
+
method="PATCH",
|
|
413
|
+
path="/vpn_sessions/{vpn_session_id}/refresh_password",
|
|
414
|
+
base_url=base_url,
|
|
415
|
+
url_variables=url_variables,
|
|
416
|
+
request=request,
|
|
417
|
+
request_body_required=False,
|
|
418
|
+
request_has_path_params=True,
|
|
419
|
+
request_has_query_params=True,
|
|
420
|
+
user_agent_header="user-agent",
|
|
421
|
+
accept_header_value="application/vnd.api+json",
|
|
422
|
+
http_headers=http_headers,
|
|
423
|
+
security=self.sdk_configuration.security,
|
|
424
|
+
allow_empty_value=None,
|
|
425
|
+
timeout_ms=timeout_ms,
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
if retries == UNSET:
|
|
429
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
430
|
+
retries = self.sdk_configuration.retry_config
|
|
431
|
+
|
|
432
|
+
retry_config = None
|
|
433
|
+
if isinstance(retries, utils.RetryConfig):
|
|
434
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
435
|
+
|
|
436
|
+
http_res = self.do_request(
|
|
437
|
+
hook_ctx=HookContext(
|
|
438
|
+
config=self.sdk_configuration,
|
|
439
|
+
base_url=base_url or "",
|
|
440
|
+
operation_id="put-vpn-session",
|
|
441
|
+
oauth2_scopes=None,
|
|
442
|
+
security_source=get_security_from_env(
|
|
443
|
+
self.sdk_configuration.security, models.Security
|
|
444
|
+
),
|
|
445
|
+
),
|
|
446
|
+
request=req,
|
|
447
|
+
error_status_codes=["4XX", "5XX"],
|
|
448
|
+
retry_config=retry_config,
|
|
449
|
+
)
|
|
450
|
+
|
|
451
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
452
|
+
return unmarshal_json_response(models.VpnSessionWithPassword, http_res)
|
|
453
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
454
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
455
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
456
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
457
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
458
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
459
|
+
|
|
460
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
461
|
+
|
|
462
|
+
async def refresh_password_async(
|
|
463
|
+
self,
|
|
464
|
+
*,
|
|
465
|
+
vpn_session_id: str,
|
|
466
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
467
|
+
server_url: Optional[str] = None,
|
|
468
|
+
timeout_ms: Optional[int] = None,
|
|
469
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
470
|
+
) -> models.VpnSessionWithPassword:
|
|
471
|
+
r"""Refresh a VPN Session
|
|
472
|
+
|
|
473
|
+
Refreshing an existing VPN Session will create new credentials for that session
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
:param vpn_session_id:
|
|
477
|
+
:param retries: Override the default retry configuration for this method
|
|
478
|
+
:param server_url: Override the default server URL for this method
|
|
479
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
480
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
481
|
+
"""
|
|
482
|
+
base_url = None
|
|
483
|
+
url_variables = None
|
|
484
|
+
if timeout_ms is None:
|
|
485
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
486
|
+
|
|
487
|
+
if server_url is not None:
|
|
488
|
+
base_url = server_url
|
|
489
|
+
else:
|
|
490
|
+
base_url = self._get_url(base_url, url_variables)
|
|
491
|
+
|
|
492
|
+
request = models.PutVpnSessionRequest(
|
|
493
|
+
vpn_session_id=vpn_session_id,
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
req = self._build_request_async(
|
|
497
|
+
method="PATCH",
|
|
498
|
+
path="/vpn_sessions/{vpn_session_id}/refresh_password",
|
|
499
|
+
base_url=base_url,
|
|
500
|
+
url_variables=url_variables,
|
|
501
|
+
request=request,
|
|
502
|
+
request_body_required=False,
|
|
503
|
+
request_has_path_params=True,
|
|
504
|
+
request_has_query_params=True,
|
|
505
|
+
user_agent_header="user-agent",
|
|
506
|
+
accept_header_value="application/vnd.api+json",
|
|
507
|
+
http_headers=http_headers,
|
|
508
|
+
security=self.sdk_configuration.security,
|
|
509
|
+
allow_empty_value=None,
|
|
510
|
+
timeout_ms=timeout_ms,
|
|
511
|
+
)
|
|
512
|
+
|
|
513
|
+
if retries == UNSET:
|
|
514
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
515
|
+
retries = self.sdk_configuration.retry_config
|
|
516
|
+
|
|
517
|
+
retry_config = None
|
|
518
|
+
if isinstance(retries, utils.RetryConfig):
|
|
519
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
520
|
+
|
|
521
|
+
http_res = await self.do_request_async(
|
|
522
|
+
hook_ctx=HookContext(
|
|
523
|
+
config=self.sdk_configuration,
|
|
524
|
+
base_url=base_url or "",
|
|
525
|
+
operation_id="put-vpn-session",
|
|
526
|
+
oauth2_scopes=None,
|
|
527
|
+
security_source=get_security_from_env(
|
|
528
|
+
self.sdk_configuration.security, models.Security
|
|
529
|
+
),
|
|
530
|
+
),
|
|
531
|
+
request=req,
|
|
532
|
+
error_status_codes=["4XX", "5XX"],
|
|
533
|
+
retry_config=retry_config,
|
|
534
|
+
)
|
|
535
|
+
|
|
536
|
+
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
537
|
+
return unmarshal_json_response(models.VpnSessionWithPassword, http_res)
|
|
538
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
539
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
540
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
541
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
542
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
543
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
544
|
+
|
|
545
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
546
|
+
|
|
547
|
+
def delete(
|
|
548
|
+
self,
|
|
549
|
+
*,
|
|
550
|
+
vpn_session_id: str,
|
|
551
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
552
|
+
server_url: Optional[str] = None,
|
|
553
|
+
timeout_ms: Optional[int] = None,
|
|
554
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
555
|
+
):
|
|
556
|
+
r"""Delete a VPN Session
|
|
557
|
+
|
|
558
|
+
Deletes an existing VPN Session.
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
:param vpn_session_id:
|
|
562
|
+
:param retries: Override the default retry configuration for this method
|
|
563
|
+
:param server_url: Override the default server URL for this method
|
|
564
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
565
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
566
|
+
"""
|
|
567
|
+
base_url = None
|
|
568
|
+
url_variables = None
|
|
569
|
+
if timeout_ms is None:
|
|
570
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
571
|
+
|
|
572
|
+
if server_url is not None:
|
|
573
|
+
base_url = server_url
|
|
574
|
+
else:
|
|
575
|
+
base_url = self._get_url(base_url, url_variables)
|
|
576
|
+
|
|
577
|
+
request = models.DeleteVpnSessionRequest(
|
|
578
|
+
vpn_session_id=vpn_session_id,
|
|
579
|
+
)
|
|
580
|
+
|
|
581
|
+
req = self._build_request(
|
|
582
|
+
method="DELETE",
|
|
583
|
+
path="/vpn_sessions/{vpn_session_id}",
|
|
584
|
+
base_url=base_url,
|
|
585
|
+
url_variables=url_variables,
|
|
586
|
+
request=request,
|
|
587
|
+
request_body_required=False,
|
|
588
|
+
request_has_path_params=True,
|
|
589
|
+
request_has_query_params=True,
|
|
590
|
+
user_agent_header="user-agent",
|
|
591
|
+
accept_header_value="*/*",
|
|
592
|
+
http_headers=http_headers,
|
|
593
|
+
security=self.sdk_configuration.security,
|
|
594
|
+
allow_empty_value=None,
|
|
595
|
+
timeout_ms=timeout_ms,
|
|
596
|
+
)
|
|
597
|
+
|
|
598
|
+
if retries == UNSET:
|
|
599
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
600
|
+
retries = self.sdk_configuration.retry_config
|
|
601
|
+
|
|
602
|
+
retry_config = None
|
|
603
|
+
if isinstance(retries, utils.RetryConfig):
|
|
604
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
605
|
+
|
|
606
|
+
http_res = self.do_request(
|
|
607
|
+
hook_ctx=HookContext(
|
|
608
|
+
config=self.sdk_configuration,
|
|
609
|
+
base_url=base_url or "",
|
|
610
|
+
operation_id="delete-vpn-session",
|
|
611
|
+
oauth2_scopes=None,
|
|
612
|
+
security_source=get_security_from_env(
|
|
613
|
+
self.sdk_configuration.security, models.Security
|
|
614
|
+
),
|
|
615
|
+
),
|
|
616
|
+
request=req,
|
|
617
|
+
error_status_codes=["4XX", "5XX"],
|
|
618
|
+
retry_config=retry_config,
|
|
619
|
+
)
|
|
620
|
+
|
|
621
|
+
if utils.match_response(http_res, "204", "*"):
|
|
622
|
+
return
|
|
623
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
624
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
625
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
626
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
627
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
628
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
629
|
+
|
|
630
|
+
raise models.APIError("Unexpected response received", http_res)
|
|
631
|
+
|
|
632
|
+
async def delete_async(
|
|
633
|
+
self,
|
|
634
|
+
*,
|
|
635
|
+
vpn_session_id: str,
|
|
636
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
637
|
+
server_url: Optional[str] = None,
|
|
638
|
+
timeout_ms: Optional[int] = None,
|
|
639
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
640
|
+
):
|
|
641
|
+
r"""Delete a VPN Session
|
|
642
|
+
|
|
643
|
+
Deletes an existing VPN Session.
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
:param vpn_session_id:
|
|
647
|
+
:param retries: Override the default retry configuration for this method
|
|
648
|
+
:param server_url: Override the default server URL for this method
|
|
649
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
650
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
651
|
+
"""
|
|
652
|
+
base_url = None
|
|
653
|
+
url_variables = None
|
|
654
|
+
if timeout_ms is None:
|
|
655
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
656
|
+
|
|
657
|
+
if server_url is not None:
|
|
658
|
+
base_url = server_url
|
|
659
|
+
else:
|
|
660
|
+
base_url = self._get_url(base_url, url_variables)
|
|
661
|
+
|
|
662
|
+
request = models.DeleteVpnSessionRequest(
|
|
663
|
+
vpn_session_id=vpn_session_id,
|
|
664
|
+
)
|
|
665
|
+
|
|
666
|
+
req = self._build_request_async(
|
|
667
|
+
method="DELETE",
|
|
668
|
+
path="/vpn_sessions/{vpn_session_id}",
|
|
669
|
+
base_url=base_url,
|
|
670
|
+
url_variables=url_variables,
|
|
671
|
+
request=request,
|
|
672
|
+
request_body_required=False,
|
|
673
|
+
request_has_path_params=True,
|
|
674
|
+
request_has_query_params=True,
|
|
675
|
+
user_agent_header="user-agent",
|
|
676
|
+
accept_header_value="*/*",
|
|
677
|
+
http_headers=http_headers,
|
|
678
|
+
security=self.sdk_configuration.security,
|
|
679
|
+
allow_empty_value=None,
|
|
680
|
+
timeout_ms=timeout_ms,
|
|
681
|
+
)
|
|
682
|
+
|
|
683
|
+
if retries == UNSET:
|
|
684
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
685
|
+
retries = self.sdk_configuration.retry_config
|
|
686
|
+
|
|
687
|
+
retry_config = None
|
|
688
|
+
if isinstance(retries, utils.RetryConfig):
|
|
689
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
690
|
+
|
|
691
|
+
http_res = await self.do_request_async(
|
|
692
|
+
hook_ctx=HookContext(
|
|
693
|
+
config=self.sdk_configuration,
|
|
694
|
+
base_url=base_url or "",
|
|
695
|
+
operation_id="delete-vpn-session",
|
|
696
|
+
oauth2_scopes=None,
|
|
697
|
+
security_source=get_security_from_env(
|
|
698
|
+
self.sdk_configuration.security, models.Security
|
|
699
|
+
),
|
|
700
|
+
),
|
|
701
|
+
request=req,
|
|
702
|
+
error_status_codes=["4XX", "5XX"],
|
|
703
|
+
retry_config=retry_config,
|
|
704
|
+
)
|
|
705
|
+
|
|
706
|
+
if utils.match_response(http_res, "204", "*"):
|
|
707
|
+
return
|
|
708
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
709
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
710
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
711
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
712
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
713
|
+
raise models.APIError("API error occurred", http_res, http_res_text)
|
|
714
|
+
|
|
715
|
+
raise models.APIError("Unexpected response received", http_res)
|