latitudesh-python-sdk 1.0.0__py3-none-any.whl → 2.0.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.
Potentially problematic release.
This version of latitudesh-python-sdk might be problematic. Click here for more details.
- latitudesh_python_sdk/_hooks/types.py +7 -0
- latitudesh_python_sdk/_version.py +6 -4
- latitudesh_python_sdk/apikeys.py +22 -18
- latitudesh_python_sdk/basesdk.py +12 -20
- latitudesh_python_sdk/billing.py +2 -0
- latitudesh_python_sdk/events_sdk.py +86 -5
- latitudesh_python_sdk/firewalls_sdk.py +146 -9
- latitudesh_python_sdk/httpclient.py +6 -16
- latitudesh_python_sdk/ipaddresses_sdk.py +82 -5
- latitudesh_python_sdk/models/__init__.py +2597 -1071
- latitudesh_python_sdk/models/assign_server_virtual_networkop.py +2 -2
- latitudesh_python_sdk/models/{bandwidth_plan.py → bandwidth_plan_data.py} +9 -9
- latitudesh_python_sdk/models/bandwidth_plans.py +14 -3
- latitudesh_python_sdk/models/billing_usage.py +3 -0
- latitudesh_python_sdk/models/custom_tag.py +15 -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_ssh_keyop.py +16 -0
- latitudesh_python_sdk/models/delete_user_dataop.py +16 -0
- latitudesh_python_sdk/models/event_data.py +98 -0
- latitudesh_python_sdk/models/events.py +16 -1
- latitudesh_python_sdk/models/filesystem_data.py +4 -0
- latitudesh_python_sdk/models/firewall.py +15 -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 +71 -0
- latitudesh_python_sdk/models/firewall_server.py +4 -1
- latitudesh_python_sdk/models/firewalls.py +7 -7
- latitudesh_python_sdk/models/get_bandwidth_plansop.py +30 -1
- latitudesh_python_sdk/models/get_eventsop.py +29 -1
- latitudesh_python_sdk/models/get_firewall_assignmentsop.py +37 -2
- latitudesh_python_sdk/models/get_ipsop.py +30 -1
- latitudesh_python_sdk/models/get_plans_operating_systemop.py +37 -2
- latitudesh_python_sdk/models/get_projectsop.py +30 -1
- latitudesh_python_sdk/models/get_regionsop.py +42 -0
- latitudesh_python_sdk/models/get_rolesop.py +37 -2
- latitudesh_python_sdk/models/get_serversop.py +30 -1
- latitudesh_python_sdk/models/get_ssh_keyop.py +30 -0
- latitudesh_python_sdk/models/get_ssh_keysop.py +22 -0
- latitudesh_python_sdk/models/get_team_membersop.py +42 -0
- latitudesh_python_sdk/models/get_traffic_consumptionop.py +8 -4
- latitudesh_python_sdk/models/get_user_dataop.py +31 -0
- latitudesh_python_sdk/models/get_users_dataop.py +35 -0
- latitudesh_python_sdk/models/get_virtual_networks_assignmentsop.py +33 -1
- latitudesh_python_sdk/models/get_virtual_networksop.py +30 -1
- latitudesh_python_sdk/models/list_firewallsop.py +30 -1
- latitudesh_python_sdk/models/operating_system_data.py +65 -0
- latitudesh_python_sdk/models/operating_systems.py +15 -0
- latitudesh_python_sdk/models/out_of_band_connection.py +4 -4
- latitudesh_python_sdk/models/patch_user_dataop.py +69 -0
- latitudesh_python_sdk/models/post_ssh_keyop.py +58 -0
- latitudesh_python_sdk/models/post_user_dataop.py +45 -0
- latitudesh_python_sdk/models/project_include.py +3 -0
- latitudesh_python_sdk/models/put_ssh_keyop.py +80 -0
- latitudesh_python_sdk/models/role.py +11 -0
- latitudesh_python_sdk/models/server_data.py +8 -0
- latitudesh_python_sdk/models/{ssh_key.py → ssh_keys.py} +13 -2
- latitudesh_python_sdk/models/storage_plan_data.py +47 -0
- latitudesh_python_sdk/models/storage_plans.py +14 -3
- latitudesh_python_sdk/models/update_serverop.py +60 -10
- latitudesh_python_sdk/models/user_data.py +11 -0
- latitudesh_python_sdk/models/virtual_network.py +19 -1
- latitudesh_python_sdk/models/virtual_network1.py +15 -0
- latitudesh_python_sdk/models/virtual_network_assignment.py +41 -0
- latitudesh_python_sdk/models/virtual_network_assignment_data.py +68 -0
- latitudesh_python_sdk/models/virtual_network_assignments.py +5 -5
- latitudesh_python_sdk/models/virtual_network_data.py +88 -0
- latitudesh_python_sdk/models/virtual_networks.py +3 -3
- latitudesh_python_sdk/operatingsystems_sdk.py +78 -9
- latitudesh_python_sdk/plans.py +109 -30
- latitudesh_python_sdk/privatenetworks.py +185 -36
- latitudesh_python_sdk/projects_sdk.py +113 -32
- latitudesh_python_sdk/regions_sdk.py +78 -7
- latitudesh_python_sdk/roles.py +78 -7
- latitudesh_python_sdk/sdk.py +110 -73
- latitudesh_python_sdk/sdkconfiguration.py +0 -7
- latitudesh_python_sdk/servers_sdk.py +195 -50
- latitudesh_python_sdk/{sshkeys.py → sshkeys_sdk.py} +1030 -5
- latitudesh_python_sdk/storage.py +8 -0
- latitudesh_python_sdk/tags.py +30 -22
- latitudesh_python_sdk/teams_sdk.py +6 -0
- latitudesh_python_sdk/teamsmembers.py +80 -7
- latitudesh_python_sdk/traffic_sdk.py +12 -8
- latitudesh_python_sdk/userdata_sdk.py +1029 -0
- latitudesh_python_sdk/userprofile.py +6 -0
- latitudesh_python_sdk/utils/__init__.py +131 -45
- latitudesh_python_sdk/utils/datetimes.py +23 -0
- latitudesh_python_sdk/utils/forms.py +49 -28
- latitudesh_python_sdk/utils/serializers.py +32 -3
- latitudesh_python_sdk/virtualmachines.py +36 -18
- latitudesh_python_sdk/vpnsessions.py +38 -26
- {latitudesh_python_sdk-1.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/METADATA +58 -22
- {latitudesh_python_sdk-1.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/RECORD +95 -73
- {latitudesh_python_sdk-1.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/WHEEL +1 -1
- latitudesh_python_sdk/models/storage_plan.py +0 -36
- {latitudesh_python_sdk-1.0.0.dist-info → latitudesh_python_sdk-2.0.0.dist-info}/LICENSE +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
+
from jsonpath import JSONPath
|
|
4
5
|
from latitudesh_python_sdk import models, utils
|
|
5
6
|
from latitudesh_python_sdk._hooks import HookContext
|
|
6
|
-
from latitudesh_python_sdk.types import
|
|
7
|
+
from latitudesh_python_sdk.types import OptionalNullable, UNSET
|
|
7
8
|
from latitudesh_python_sdk.utils import get_security_from_env
|
|
8
|
-
from typing import Any, Mapping, Optional, Union
|
|
9
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class ServersSDK(BaseSDK):
|
|
@@ -27,11 +28,13 @@ class ServersSDK(BaseSDK):
|
|
|
27
28
|
filter_disk: Optional[int] = None,
|
|
28
29
|
filter_tags: Optional[str] = None,
|
|
29
30
|
extra_fields_servers: Optional[str] = None,
|
|
31
|
+
page_size: Optional[int] = 20,
|
|
32
|
+
page_number: Optional[int] = 1,
|
|
30
33
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
31
34
|
server_url: Optional[str] = None,
|
|
32
35
|
timeout_ms: Optional[int] = None,
|
|
33
36
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
34
|
-
) -> models.
|
|
37
|
+
) -> Optional[models.GetServersResponse]:
|
|
35
38
|
r"""List all Servers
|
|
36
39
|
|
|
37
40
|
Returns a list of all servers belonging to the team.
|
|
@@ -52,6 +55,8 @@ class ServersSDK(BaseSDK):
|
|
|
52
55
|
:param filter_disk: The disk size in Gigabytes to filter by, should be used with the following options: [eql] to filter for values equal to the provided value. [gte] to filter for values greater or equal to the provided value. [lte] to filter by values lower or equal to the provided value.
|
|
53
56
|
:param filter_tags: The tags ids to filter by, separated by comma, e.g. `filter[tags]=tag_1,tag_2`will return servers with `tag_1` AND `tag_2`
|
|
54
57
|
:param extra_fields_servers: The `credentials` are provided as extra attributes that is lazy loaded. To request it, just set `extra_fields[servers]=credentials` in the query string.
|
|
58
|
+
:param page_size: Number of items to return per page
|
|
59
|
+
:param page_number: Page number to return (starts at 1)
|
|
55
60
|
:param retries: Override the default retry configuration for this method
|
|
56
61
|
:param server_url: Override the default server URL for this method
|
|
57
62
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -83,6 +88,8 @@ class ServersSDK(BaseSDK):
|
|
|
83
88
|
filter_disk=filter_disk,
|
|
84
89
|
filter_tags=filter_tags,
|
|
85
90
|
extra_fields_servers=extra_fields_servers,
|
|
91
|
+
page_size=page_size,
|
|
92
|
+
page_number=page_number,
|
|
86
93
|
)
|
|
87
94
|
|
|
88
95
|
req = self._build_request(
|
|
@@ -111,6 +118,7 @@ class ServersSDK(BaseSDK):
|
|
|
111
118
|
|
|
112
119
|
http_res = self.do_request(
|
|
113
120
|
hook_ctx=HookContext(
|
|
121
|
+
config=self.sdk_configuration,
|
|
114
122
|
base_url=base_url or "",
|
|
115
123
|
operation_id="get-servers",
|
|
116
124
|
oauth2_scopes=[],
|
|
@@ -119,12 +127,54 @@ class ServersSDK(BaseSDK):
|
|
|
119
127
|
),
|
|
120
128
|
),
|
|
121
129
|
request=req,
|
|
122
|
-
error_status_codes=["4XX", "5XX"],
|
|
130
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
123
131
|
retry_config=retry_config,
|
|
124
132
|
)
|
|
125
133
|
|
|
134
|
+
def next_func() -> Optional[models.GetServersResponse]:
|
|
135
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
136
|
+
page = request.page_number if not request.page_number is None else 1
|
|
137
|
+
next_page = page + 1
|
|
138
|
+
|
|
139
|
+
if not http_res.text:
|
|
140
|
+
return None
|
|
141
|
+
results = JSONPath("$.data").parse(body)
|
|
142
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
143
|
+
return None
|
|
144
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
145
|
+
if len(results[0]) < limit:
|
|
146
|
+
return None
|
|
147
|
+
|
|
148
|
+
return self.list(
|
|
149
|
+
filter_project=filter_project,
|
|
150
|
+
filter_region=filter_region,
|
|
151
|
+
filter_hostname=filter_hostname,
|
|
152
|
+
filter_created_at_gte=filter_created_at_gte,
|
|
153
|
+
filter_created_at_lte=filter_created_at_lte,
|
|
154
|
+
filter_label=filter_label,
|
|
155
|
+
filter_status=filter_status,
|
|
156
|
+
filter_plan=filter_plan,
|
|
157
|
+
filter_gpu=filter_gpu,
|
|
158
|
+
filter_ram_eql=filter_ram_eql,
|
|
159
|
+
filter_ram_gte=filter_ram_gte,
|
|
160
|
+
filter_ram_lte=filter_ram_lte,
|
|
161
|
+
filter_disk=filter_disk,
|
|
162
|
+
filter_tags=filter_tags,
|
|
163
|
+
extra_fields_servers=extra_fields_servers,
|
|
164
|
+
page_size=page_size,
|
|
165
|
+
page_number=next_page,
|
|
166
|
+
retries=retries,
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
response_data: Any = None
|
|
126
170
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
127
|
-
return
|
|
171
|
+
return models.GetServersResponse(
|
|
172
|
+
result=utils.unmarshal_json(http_res.text, models.Servers),
|
|
173
|
+
next=next_func,
|
|
174
|
+
)
|
|
175
|
+
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
176
|
+
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
177
|
+
raise models.ErrorObject(data=response_data)
|
|
128
178
|
if utils.match_response(http_res, "4XX", "*"):
|
|
129
179
|
http_res_text = utils.stream_to_text(http_res)
|
|
130
180
|
raise models.APIError(
|
|
@@ -163,11 +213,13 @@ class ServersSDK(BaseSDK):
|
|
|
163
213
|
filter_disk: Optional[int] = None,
|
|
164
214
|
filter_tags: Optional[str] = None,
|
|
165
215
|
extra_fields_servers: Optional[str] = None,
|
|
216
|
+
page_size: Optional[int] = 20,
|
|
217
|
+
page_number: Optional[int] = 1,
|
|
166
218
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
167
219
|
server_url: Optional[str] = None,
|
|
168
220
|
timeout_ms: Optional[int] = None,
|
|
169
221
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
170
|
-
) -> models.
|
|
222
|
+
) -> Optional[models.GetServersResponse]:
|
|
171
223
|
r"""List all Servers
|
|
172
224
|
|
|
173
225
|
Returns a list of all servers belonging to the team.
|
|
@@ -188,6 +240,8 @@ class ServersSDK(BaseSDK):
|
|
|
188
240
|
:param filter_disk: The disk size in Gigabytes to filter by, should be used with the following options: [eql] to filter for values equal to the provided value. [gte] to filter for values greater or equal to the provided value. [lte] to filter by values lower or equal to the provided value.
|
|
189
241
|
:param filter_tags: The tags ids to filter by, separated by comma, e.g. `filter[tags]=tag_1,tag_2`will return servers with `tag_1` AND `tag_2`
|
|
190
242
|
:param extra_fields_servers: The `credentials` are provided as extra attributes that is lazy loaded. To request it, just set `extra_fields[servers]=credentials` in the query string.
|
|
243
|
+
:param page_size: Number of items to return per page
|
|
244
|
+
:param page_number: Page number to return (starts at 1)
|
|
191
245
|
:param retries: Override the default retry configuration for this method
|
|
192
246
|
:param server_url: Override the default server URL for this method
|
|
193
247
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -219,6 +273,8 @@ class ServersSDK(BaseSDK):
|
|
|
219
273
|
filter_disk=filter_disk,
|
|
220
274
|
filter_tags=filter_tags,
|
|
221
275
|
extra_fields_servers=extra_fields_servers,
|
|
276
|
+
page_size=page_size,
|
|
277
|
+
page_number=page_number,
|
|
222
278
|
)
|
|
223
279
|
|
|
224
280
|
req = self._build_request_async(
|
|
@@ -247,6 +303,7 @@ class ServersSDK(BaseSDK):
|
|
|
247
303
|
|
|
248
304
|
http_res = await self.do_request_async(
|
|
249
305
|
hook_ctx=HookContext(
|
|
306
|
+
config=self.sdk_configuration,
|
|
250
307
|
base_url=base_url or "",
|
|
251
308
|
operation_id="get-servers",
|
|
252
309
|
oauth2_scopes=[],
|
|
@@ -255,12 +312,54 @@ class ServersSDK(BaseSDK):
|
|
|
255
312
|
),
|
|
256
313
|
),
|
|
257
314
|
request=req,
|
|
258
|
-
error_status_codes=["4XX", "5XX"],
|
|
315
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
259
316
|
retry_config=retry_config,
|
|
260
317
|
)
|
|
261
318
|
|
|
319
|
+
def next_func() -> Optional[models.GetServersResponse]:
|
|
320
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
321
|
+
page = request.page_number if not request.page_number is None else 1
|
|
322
|
+
next_page = page + 1
|
|
323
|
+
|
|
324
|
+
if not http_res.text:
|
|
325
|
+
return None
|
|
326
|
+
results = JSONPath("$.data").parse(body)
|
|
327
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
328
|
+
return None
|
|
329
|
+
limit = request.page_size if not request.page_size is None else 20
|
|
330
|
+
if len(results[0]) < limit:
|
|
331
|
+
return None
|
|
332
|
+
|
|
333
|
+
return self.list(
|
|
334
|
+
filter_project=filter_project,
|
|
335
|
+
filter_region=filter_region,
|
|
336
|
+
filter_hostname=filter_hostname,
|
|
337
|
+
filter_created_at_gte=filter_created_at_gte,
|
|
338
|
+
filter_created_at_lte=filter_created_at_lte,
|
|
339
|
+
filter_label=filter_label,
|
|
340
|
+
filter_status=filter_status,
|
|
341
|
+
filter_plan=filter_plan,
|
|
342
|
+
filter_gpu=filter_gpu,
|
|
343
|
+
filter_ram_eql=filter_ram_eql,
|
|
344
|
+
filter_ram_gte=filter_ram_gte,
|
|
345
|
+
filter_ram_lte=filter_ram_lte,
|
|
346
|
+
filter_disk=filter_disk,
|
|
347
|
+
filter_tags=filter_tags,
|
|
348
|
+
extra_fields_servers=extra_fields_servers,
|
|
349
|
+
page_size=page_size,
|
|
350
|
+
page_number=next_page,
|
|
351
|
+
retries=retries,
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
response_data: Any = None
|
|
262
355
|
if utils.match_response(http_res, "200", "application/vnd.api+json"):
|
|
263
|
-
return
|
|
356
|
+
return models.GetServersResponse(
|
|
357
|
+
result=utils.unmarshal_json(http_res.text, models.Servers),
|
|
358
|
+
next=next_func,
|
|
359
|
+
)
|
|
360
|
+
if utils.match_response(http_res, "422", "application/vnd.api+json"):
|
|
361
|
+
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
362
|
+
raise models.ErrorObject(data=response_data)
|
|
264
363
|
if utils.match_response(http_res, "4XX", "*"):
|
|
265
364
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
266
365
|
raise models.APIError(
|
|
@@ -284,10 +383,11 @@ class ServersSDK(BaseSDK):
|
|
|
284
383
|
def create(
|
|
285
384
|
self,
|
|
286
385
|
*,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
386
|
+
data: Optional[
|
|
387
|
+
Union[
|
|
388
|
+
models.CreateServerServersData, models.CreateServerServersDataTypedDict
|
|
389
|
+
]
|
|
390
|
+
] = None,
|
|
291
391
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
292
392
|
server_url: Optional[str] = None,
|
|
293
393
|
timeout_ms: Optional[int] = None,
|
|
@@ -295,7 +395,7 @@ class ServersSDK(BaseSDK):
|
|
|
295
395
|
) -> models.Server:
|
|
296
396
|
r"""Deploy Server
|
|
297
397
|
|
|
298
|
-
:param
|
|
398
|
+
:param data:
|
|
299
399
|
:param retries: Override the default retry configuration for this method
|
|
300
400
|
:param server_url: Override the default server URL for this method
|
|
301
401
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -311,9 +411,11 @@ class ServersSDK(BaseSDK):
|
|
|
311
411
|
else:
|
|
312
412
|
base_url = self._get_url(base_url, url_variables)
|
|
313
413
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
414
|
+
request = models.CreateServerServersRequestBody(
|
|
415
|
+
data=utils.get_pydantic_model(
|
|
416
|
+
data, Optional[models.CreateServerServersData]
|
|
417
|
+
),
|
|
418
|
+
)
|
|
317
419
|
|
|
318
420
|
req = self._build_request(
|
|
319
421
|
method="POST",
|
|
@@ -329,11 +431,7 @@ class ServersSDK(BaseSDK):
|
|
|
329
431
|
http_headers=http_headers,
|
|
330
432
|
security=self.sdk_configuration.security,
|
|
331
433
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
332
|
-
request,
|
|
333
|
-
False,
|
|
334
|
-
True,
|
|
335
|
-
"json",
|
|
336
|
-
Optional[models.CreateServerServersRequestBody],
|
|
434
|
+
request, False, False, "json", models.CreateServerServersRequestBody
|
|
337
435
|
),
|
|
338
436
|
timeout_ms=timeout_ms,
|
|
339
437
|
)
|
|
@@ -348,6 +446,7 @@ class ServersSDK(BaseSDK):
|
|
|
348
446
|
|
|
349
447
|
http_res = self.do_request(
|
|
350
448
|
hook_ctx=HookContext(
|
|
449
|
+
config=self.sdk_configuration,
|
|
351
450
|
base_url=base_url or "",
|
|
352
451
|
operation_id="create-server",
|
|
353
452
|
oauth2_scopes=[],
|
|
@@ -391,10 +490,11 @@ class ServersSDK(BaseSDK):
|
|
|
391
490
|
async def create_async(
|
|
392
491
|
self,
|
|
393
492
|
*,
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
493
|
+
data: Optional[
|
|
494
|
+
Union[
|
|
495
|
+
models.CreateServerServersData, models.CreateServerServersDataTypedDict
|
|
496
|
+
]
|
|
497
|
+
] = None,
|
|
398
498
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
399
499
|
server_url: Optional[str] = None,
|
|
400
500
|
timeout_ms: Optional[int] = None,
|
|
@@ -402,7 +502,7 @@ class ServersSDK(BaseSDK):
|
|
|
402
502
|
) -> models.Server:
|
|
403
503
|
r"""Deploy Server
|
|
404
504
|
|
|
405
|
-
:param
|
|
505
|
+
:param data:
|
|
406
506
|
:param retries: Override the default retry configuration for this method
|
|
407
507
|
:param server_url: Override the default server URL for this method
|
|
408
508
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -418,9 +518,11 @@ class ServersSDK(BaseSDK):
|
|
|
418
518
|
else:
|
|
419
519
|
base_url = self._get_url(base_url, url_variables)
|
|
420
520
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
521
|
+
request = models.CreateServerServersRequestBody(
|
|
522
|
+
data=utils.get_pydantic_model(
|
|
523
|
+
data, Optional[models.CreateServerServersData]
|
|
524
|
+
),
|
|
525
|
+
)
|
|
424
526
|
|
|
425
527
|
req = self._build_request_async(
|
|
426
528
|
method="POST",
|
|
@@ -436,11 +538,7 @@ class ServersSDK(BaseSDK):
|
|
|
436
538
|
http_headers=http_headers,
|
|
437
539
|
security=self.sdk_configuration.security,
|
|
438
540
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
439
|
-
request,
|
|
440
|
-
False,
|
|
441
|
-
True,
|
|
442
|
-
"json",
|
|
443
|
-
Optional[models.CreateServerServersRequestBody],
|
|
541
|
+
request, False, False, "json", models.CreateServerServersRequestBody
|
|
444
542
|
),
|
|
445
543
|
timeout_ms=timeout_ms,
|
|
446
544
|
)
|
|
@@ -455,6 +553,7 @@ class ServersSDK(BaseSDK):
|
|
|
455
553
|
|
|
456
554
|
http_res = await self.do_request_async(
|
|
457
555
|
hook_ctx=HookContext(
|
|
556
|
+
config=self.sdk_configuration,
|
|
458
557
|
base_url=base_url or "",
|
|
459
558
|
operation_id="create-server",
|
|
460
559
|
oauth2_scopes=[],
|
|
@@ -558,6 +657,7 @@ class ServersSDK(BaseSDK):
|
|
|
558
657
|
|
|
559
658
|
http_res = self.do_request(
|
|
560
659
|
hook_ctx=HookContext(
|
|
660
|
+
config=self.sdk_configuration,
|
|
561
661
|
base_url=base_url or "",
|
|
562
662
|
operation_id="get-server",
|
|
563
663
|
oauth2_scopes=[],
|
|
@@ -655,6 +755,7 @@ class ServersSDK(BaseSDK):
|
|
|
655
755
|
|
|
656
756
|
http_res = await self.do_request_async(
|
|
657
757
|
hook_ctx=HookContext(
|
|
758
|
+
config=self.sdk_configuration,
|
|
658
759
|
base_url=base_url or "",
|
|
659
760
|
operation_id="get-server",
|
|
660
761
|
oauth2_scopes=[],
|
|
@@ -694,11 +795,16 @@ class ServersSDK(BaseSDK):
|
|
|
694
795
|
*,
|
|
695
796
|
server_id: str,
|
|
696
797
|
id: Optional[str] = "sv_81EVOtR1N4J2Z",
|
|
697
|
-
type_: Optional[models.
|
|
798
|
+
type_: Optional[models.UpdateServerServersRequestType] = None,
|
|
698
799
|
attributes: Optional[
|
|
699
800
|
Union[
|
|
700
|
-
models.
|
|
701
|
-
models.
|
|
801
|
+
models.UpdateServerServersRequestAttributes,
|
|
802
|
+
models.UpdateServerServersRequestAttributesTypedDict,
|
|
803
|
+
]
|
|
804
|
+
] = None,
|
|
805
|
+
data: Optional[
|
|
806
|
+
Union[
|
|
807
|
+
models.UpdateServerServersData, models.UpdateServerServersDataTypedDict
|
|
702
808
|
]
|
|
703
809
|
] = None,
|
|
704
810
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -712,6 +818,7 @@ class ServersSDK(BaseSDK):
|
|
|
712
818
|
:param id:
|
|
713
819
|
:param type:
|
|
714
820
|
:param attributes:
|
|
821
|
+
:param data:
|
|
715
822
|
:param retries: Override the default retry configuration for this method
|
|
716
823
|
:param server_url: Override the default server URL for this method
|
|
717
824
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -733,7 +840,10 @@ class ServersSDK(BaseSDK):
|
|
|
733
840
|
id=id,
|
|
734
841
|
type=type_,
|
|
735
842
|
attributes=utils.get_pydantic_model(
|
|
736
|
-
attributes, Optional[models.
|
|
843
|
+
attributes, Optional[models.UpdateServerServersRequestAttributes]
|
|
844
|
+
),
|
|
845
|
+
data=utils.get_pydantic_model(
|
|
846
|
+
data, Optional[models.UpdateServerServersData]
|
|
737
847
|
),
|
|
738
848
|
),
|
|
739
849
|
)
|
|
@@ -771,6 +881,7 @@ class ServersSDK(BaseSDK):
|
|
|
771
881
|
|
|
772
882
|
http_res = self.do_request(
|
|
773
883
|
hook_ctx=HookContext(
|
|
884
|
+
config=self.sdk_configuration,
|
|
774
885
|
base_url=base_url or "",
|
|
775
886
|
operation_id="update-server",
|
|
776
887
|
oauth2_scopes=[],
|
|
@@ -786,12 +897,10 @@ class ServersSDK(BaseSDK):
|
|
|
786
897
|
response_data: Any = None
|
|
787
898
|
if utils.match_response(http_res, "200", "*"):
|
|
788
899
|
return
|
|
789
|
-
if utils.match_response(http_res, "400", "application/vnd.api+json"):
|
|
900
|
+
if utils.match_response(http_res, ["400", "422"], "application/vnd.api+json"):
|
|
790
901
|
response_data = utils.unmarshal_json(http_res.text, models.ServerErrorData)
|
|
791
902
|
raise models.ServerError(data=response_data)
|
|
792
|
-
if utils.match_response(
|
|
793
|
-
http_res, ["402", "422", "423"], "application/vnd.api+json"
|
|
794
|
-
):
|
|
903
|
+
if utils.match_response(http_res, ["402", "423"], "application/vnd.api+json"):
|
|
795
904
|
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
796
905
|
raise models.ErrorObject(data=response_data)
|
|
797
906
|
if utils.match_response(http_res, "4XX", "*"):
|
|
@@ -819,11 +928,16 @@ class ServersSDK(BaseSDK):
|
|
|
819
928
|
*,
|
|
820
929
|
server_id: str,
|
|
821
930
|
id: Optional[str] = "sv_81EVOtR1N4J2Z",
|
|
822
|
-
type_: Optional[models.
|
|
931
|
+
type_: Optional[models.UpdateServerServersRequestType] = None,
|
|
823
932
|
attributes: Optional[
|
|
824
933
|
Union[
|
|
825
|
-
models.
|
|
826
|
-
models.
|
|
934
|
+
models.UpdateServerServersRequestAttributes,
|
|
935
|
+
models.UpdateServerServersRequestAttributesTypedDict,
|
|
936
|
+
]
|
|
937
|
+
] = None,
|
|
938
|
+
data: Optional[
|
|
939
|
+
Union[
|
|
940
|
+
models.UpdateServerServersData, models.UpdateServerServersDataTypedDict
|
|
827
941
|
]
|
|
828
942
|
] = None,
|
|
829
943
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -837,6 +951,7 @@ class ServersSDK(BaseSDK):
|
|
|
837
951
|
:param id:
|
|
838
952
|
:param type:
|
|
839
953
|
:param attributes:
|
|
954
|
+
:param data:
|
|
840
955
|
:param retries: Override the default retry configuration for this method
|
|
841
956
|
:param server_url: Override the default server URL for this method
|
|
842
957
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -858,7 +973,10 @@ class ServersSDK(BaseSDK):
|
|
|
858
973
|
id=id,
|
|
859
974
|
type=type_,
|
|
860
975
|
attributes=utils.get_pydantic_model(
|
|
861
|
-
attributes, Optional[models.
|
|
976
|
+
attributes, Optional[models.UpdateServerServersRequestAttributes]
|
|
977
|
+
),
|
|
978
|
+
data=utils.get_pydantic_model(
|
|
979
|
+
data, Optional[models.UpdateServerServersData]
|
|
862
980
|
),
|
|
863
981
|
),
|
|
864
982
|
)
|
|
@@ -896,6 +1014,7 @@ class ServersSDK(BaseSDK):
|
|
|
896
1014
|
|
|
897
1015
|
http_res = await self.do_request_async(
|
|
898
1016
|
hook_ctx=HookContext(
|
|
1017
|
+
config=self.sdk_configuration,
|
|
899
1018
|
base_url=base_url or "",
|
|
900
1019
|
operation_id="update-server",
|
|
901
1020
|
oauth2_scopes=[],
|
|
@@ -911,12 +1030,10 @@ class ServersSDK(BaseSDK):
|
|
|
911
1030
|
response_data: Any = None
|
|
912
1031
|
if utils.match_response(http_res, "200", "*"):
|
|
913
1032
|
return
|
|
914
|
-
if utils.match_response(http_res, "400", "application/vnd.api+json"):
|
|
1033
|
+
if utils.match_response(http_res, ["400", "422"], "application/vnd.api+json"):
|
|
915
1034
|
response_data = utils.unmarshal_json(http_res.text, models.ServerErrorData)
|
|
916
1035
|
raise models.ServerError(data=response_data)
|
|
917
|
-
if utils.match_response(
|
|
918
|
-
http_res, ["402", "422", "423"], "application/vnd.api+json"
|
|
919
|
-
):
|
|
1036
|
+
if utils.match_response(http_res, ["402", "423"], "application/vnd.api+json"):
|
|
920
1037
|
response_data = utils.unmarshal_json(http_res.text, models.ErrorObjectData)
|
|
921
1038
|
raise models.ErrorObject(data=response_data)
|
|
922
1039
|
if utils.match_response(http_res, "4XX", "*"):
|
|
@@ -999,6 +1116,7 @@ class ServersSDK(BaseSDK):
|
|
|
999
1116
|
|
|
1000
1117
|
http_res = self.do_request(
|
|
1001
1118
|
hook_ctx=HookContext(
|
|
1119
|
+
config=self.sdk_configuration,
|
|
1002
1120
|
base_url=base_url or "",
|
|
1003
1121
|
operation_id="destroy-server",
|
|
1004
1122
|
oauth2_scopes=[],
|
|
@@ -1099,6 +1217,7 @@ class ServersSDK(BaseSDK):
|
|
|
1099
1217
|
|
|
1100
1218
|
http_res = await self.do_request_async(
|
|
1101
1219
|
hook_ctx=HookContext(
|
|
1220
|
+
config=self.sdk_configuration,
|
|
1102
1221
|
base_url=base_url or "",
|
|
1103
1222
|
operation_id="destroy-server",
|
|
1104
1223
|
oauth2_scopes=[],
|
|
@@ -1196,6 +1315,7 @@ class ServersSDK(BaseSDK):
|
|
|
1196
1315
|
|
|
1197
1316
|
http_res = self.do_request(
|
|
1198
1317
|
hook_ctx=HookContext(
|
|
1318
|
+
config=self.sdk_configuration,
|
|
1199
1319
|
base_url=base_url or "",
|
|
1200
1320
|
operation_id="get-server-deploy-config",
|
|
1201
1321
|
oauth2_scopes=[],
|
|
@@ -1287,6 +1407,7 @@ class ServersSDK(BaseSDK):
|
|
|
1287
1407
|
|
|
1288
1408
|
http_res = await self.do_request_async(
|
|
1289
1409
|
hook_ctx=HookContext(
|
|
1410
|
+
config=self.sdk_configuration,
|
|
1290
1411
|
base_url=base_url or "",
|
|
1291
1412
|
operation_id="get-server-deploy-config",
|
|
1292
1413
|
oauth2_scopes=[],
|
|
@@ -1401,6 +1522,7 @@ class ServersSDK(BaseSDK):
|
|
|
1401
1522
|
|
|
1402
1523
|
http_res = self.do_request(
|
|
1403
1524
|
hook_ctx=HookContext(
|
|
1525
|
+
config=self.sdk_configuration,
|
|
1404
1526
|
base_url=base_url or "",
|
|
1405
1527
|
operation_id="update-server-deploy-config",
|
|
1406
1528
|
oauth2_scopes=[],
|
|
@@ -1524,6 +1646,7 @@ class ServersSDK(BaseSDK):
|
|
|
1524
1646
|
|
|
1525
1647
|
http_res = await self.do_request_async(
|
|
1526
1648
|
hook_ctx=HookContext(
|
|
1649
|
+
config=self.sdk_configuration,
|
|
1527
1650
|
base_url=base_url or "",
|
|
1528
1651
|
operation_id="update-server-deploy-config",
|
|
1529
1652
|
oauth2_scopes=[],
|
|
@@ -1626,6 +1749,7 @@ class ServersSDK(BaseSDK):
|
|
|
1626
1749
|
|
|
1627
1750
|
http_res = self.do_request(
|
|
1628
1751
|
hook_ctx=HookContext(
|
|
1752
|
+
config=self.sdk_configuration,
|
|
1629
1753
|
base_url=base_url or "",
|
|
1630
1754
|
operation_id="server-lock",
|
|
1631
1755
|
oauth2_scopes=[],
|
|
@@ -1719,6 +1843,7 @@ class ServersSDK(BaseSDK):
|
|
|
1719
1843
|
|
|
1720
1844
|
http_res = await self.do_request_async(
|
|
1721
1845
|
hook_ctx=HookContext(
|
|
1846
|
+
config=self.sdk_configuration,
|
|
1722
1847
|
base_url=base_url or "",
|
|
1723
1848
|
operation_id="server-lock",
|
|
1724
1849
|
oauth2_scopes=[],
|
|
@@ -1812,6 +1937,7 @@ class ServersSDK(BaseSDK):
|
|
|
1812
1937
|
|
|
1813
1938
|
http_res = self.do_request(
|
|
1814
1939
|
hook_ctx=HookContext(
|
|
1940
|
+
config=self.sdk_configuration,
|
|
1815
1941
|
base_url=base_url or "",
|
|
1816
1942
|
operation_id="server-unlock",
|
|
1817
1943
|
oauth2_scopes=[],
|
|
@@ -1905,6 +2031,7 @@ class ServersSDK(BaseSDK):
|
|
|
1905
2031
|
|
|
1906
2032
|
http_res = await self.do_request_async(
|
|
1907
2033
|
hook_ctx=HookContext(
|
|
2034
|
+
config=self.sdk_configuration,
|
|
1908
2035
|
base_url=base_url or "",
|
|
1909
2036
|
operation_id="server-unlock",
|
|
1910
2037
|
oauth2_scopes=[],
|
|
@@ -2013,6 +2140,7 @@ class ServersSDK(BaseSDK):
|
|
|
2013
2140
|
|
|
2014
2141
|
http_res = self.do_request(
|
|
2015
2142
|
hook_ctx=HookContext(
|
|
2143
|
+
config=self.sdk_configuration,
|
|
2016
2144
|
base_url=base_url or "",
|
|
2017
2145
|
operation_id="create-server-out-of-band",
|
|
2018
2146
|
oauth2_scopes=[],
|
|
@@ -2125,6 +2253,7 @@ class ServersSDK(BaseSDK):
|
|
|
2125
2253
|
|
|
2126
2254
|
http_res = await self.do_request_async(
|
|
2127
2255
|
hook_ctx=HookContext(
|
|
2256
|
+
config=self.sdk_configuration,
|
|
2128
2257
|
base_url=base_url or "",
|
|
2129
2258
|
operation_id="create-server-out-of-band",
|
|
2130
2259
|
oauth2_scopes=[],
|
|
@@ -2220,6 +2349,7 @@ class ServersSDK(BaseSDK):
|
|
|
2220
2349
|
|
|
2221
2350
|
http_res = self.do_request(
|
|
2222
2351
|
hook_ctx=HookContext(
|
|
2352
|
+
config=self.sdk_configuration,
|
|
2223
2353
|
base_url=base_url or "",
|
|
2224
2354
|
operation_id="get-server-out-of-band",
|
|
2225
2355
|
oauth2_scopes=[],
|
|
@@ -2315,6 +2445,7 @@ class ServersSDK(BaseSDK):
|
|
|
2315
2445
|
|
|
2316
2446
|
http_res = await self.do_request_async(
|
|
2317
2447
|
hook_ctx=HookContext(
|
|
2448
|
+
config=self.sdk_configuration,
|
|
2318
2449
|
base_url=base_url or "",
|
|
2319
2450
|
operation_id="get-server-out-of-band",
|
|
2320
2451
|
oauth2_scopes=[],
|
|
@@ -2433,6 +2564,7 @@ class ServersSDK(BaseSDK):
|
|
|
2433
2564
|
|
|
2434
2565
|
http_res = self.do_request(
|
|
2435
2566
|
hook_ctx=HookContext(
|
|
2567
|
+
config=self.sdk_configuration,
|
|
2436
2568
|
base_url=base_url or "",
|
|
2437
2569
|
operation_id="create-server-action",
|
|
2438
2570
|
oauth2_scopes=[],
|
|
@@ -2551,6 +2683,7 @@ class ServersSDK(BaseSDK):
|
|
|
2551
2683
|
|
|
2552
2684
|
http_res = await self.do_request_async(
|
|
2553
2685
|
hook_ctx=HookContext(
|
|
2686
|
+
config=self.sdk_configuration,
|
|
2554
2687
|
base_url=base_url or "",
|
|
2555
2688
|
operation_id="create-server-action",
|
|
2556
2689
|
oauth2_scopes=[],
|
|
@@ -2652,6 +2785,7 @@ class ServersSDK(BaseSDK):
|
|
|
2652
2785
|
|
|
2653
2786
|
http_res = self.do_request(
|
|
2654
2787
|
hook_ctx=HookContext(
|
|
2788
|
+
config=self.sdk_configuration,
|
|
2655
2789
|
base_url=base_url or "",
|
|
2656
2790
|
operation_id="create-ipmi-session",
|
|
2657
2791
|
oauth2_scopes=[],
|
|
@@ -2755,6 +2889,7 @@ class ServersSDK(BaseSDK):
|
|
|
2755
2889
|
|
|
2756
2890
|
http_res = await self.do_request_async(
|
|
2757
2891
|
hook_ctx=HookContext(
|
|
2892
|
+
config=self.sdk_configuration,
|
|
2758
2893
|
base_url=base_url or "",
|
|
2759
2894
|
operation_id="create-ipmi-session",
|
|
2760
2895
|
oauth2_scopes=[],
|
|
@@ -2854,6 +2989,7 @@ class ServersSDK(BaseSDK):
|
|
|
2854
2989
|
|
|
2855
2990
|
http_res = self.do_request(
|
|
2856
2991
|
hook_ctx=HookContext(
|
|
2992
|
+
config=self.sdk_configuration,
|
|
2857
2993
|
base_url=base_url or "",
|
|
2858
2994
|
operation_id="server-start-rescue-mode",
|
|
2859
2995
|
oauth2_scopes=[],
|
|
@@ -2951,6 +3087,7 @@ class ServersSDK(BaseSDK):
|
|
|
2951
3087
|
|
|
2952
3088
|
http_res = await self.do_request_async(
|
|
2953
3089
|
hook_ctx=HookContext(
|
|
3090
|
+
config=self.sdk_configuration,
|
|
2954
3091
|
base_url=base_url or "",
|
|
2955
3092
|
operation_id="server-start-rescue-mode",
|
|
2956
3093
|
oauth2_scopes=[],
|
|
@@ -3048,6 +3185,7 @@ class ServersSDK(BaseSDK):
|
|
|
3048
3185
|
|
|
3049
3186
|
http_res = self.do_request(
|
|
3050
3187
|
hook_ctx=HookContext(
|
|
3188
|
+
config=self.sdk_configuration,
|
|
3051
3189
|
base_url=base_url or "",
|
|
3052
3190
|
operation_id="server-exit-rescue-mode",
|
|
3053
3191
|
oauth2_scopes=[],
|
|
@@ -3145,6 +3283,7 @@ class ServersSDK(BaseSDK):
|
|
|
3145
3283
|
|
|
3146
3284
|
http_res = await self.do_request_async(
|
|
3147
3285
|
hook_ctx=HookContext(
|
|
3286
|
+
config=self.sdk_configuration,
|
|
3148
3287
|
base_url=base_url or "",
|
|
3149
3288
|
operation_id="server-exit-rescue-mode",
|
|
3150
3289
|
oauth2_scopes=[],
|
|
@@ -3242,6 +3381,7 @@ class ServersSDK(BaseSDK):
|
|
|
3242
3381
|
|
|
3243
3382
|
http_res = self.do_request(
|
|
3244
3383
|
hook_ctx=HookContext(
|
|
3384
|
+
config=self.sdk_configuration,
|
|
3245
3385
|
base_url=base_url or "",
|
|
3246
3386
|
operation_id="server-schedule-deletion",
|
|
3247
3387
|
oauth2_scopes=[],
|
|
@@ -3341,6 +3481,7 @@ class ServersSDK(BaseSDK):
|
|
|
3341
3481
|
|
|
3342
3482
|
http_res = await self.do_request_async(
|
|
3343
3483
|
hook_ctx=HookContext(
|
|
3484
|
+
config=self.sdk_configuration,
|
|
3344
3485
|
base_url=base_url or "",
|
|
3345
3486
|
operation_id="server-schedule-deletion",
|
|
3346
3487
|
oauth2_scopes=[],
|
|
@@ -3440,6 +3581,7 @@ class ServersSDK(BaseSDK):
|
|
|
3440
3581
|
|
|
3441
3582
|
http_res = self.do_request(
|
|
3442
3583
|
hook_ctx=HookContext(
|
|
3584
|
+
config=self.sdk_configuration,
|
|
3443
3585
|
base_url=base_url or "",
|
|
3444
3586
|
operation_id="server-unschedule-deletion",
|
|
3445
3587
|
oauth2_scopes=[],
|
|
@@ -3537,6 +3679,7 @@ class ServersSDK(BaseSDK):
|
|
|
3537
3679
|
|
|
3538
3680
|
http_res = await self.do_request_async(
|
|
3539
3681
|
hook_ctx=HookContext(
|
|
3682
|
+
config=self.sdk_configuration,
|
|
3540
3683
|
base_url=base_url or "",
|
|
3541
3684
|
operation_id="server-unschedule-deletion",
|
|
3542
3685
|
oauth2_scopes=[],
|
|
@@ -3649,6 +3792,7 @@ class ServersSDK(BaseSDK):
|
|
|
3649
3792
|
|
|
3650
3793
|
http_res = self.do_request(
|
|
3651
3794
|
hook_ctx=HookContext(
|
|
3795
|
+
config=self.sdk_configuration,
|
|
3652
3796
|
base_url=base_url or "",
|
|
3653
3797
|
operation_id="create-server-reinstall",
|
|
3654
3798
|
oauth2_scopes=[],
|
|
@@ -3766,6 +3910,7 @@ class ServersSDK(BaseSDK):
|
|
|
3766
3910
|
|
|
3767
3911
|
http_res = await self.do_request_async(
|
|
3768
3912
|
hook_ctx=HookContext(
|
|
3913
|
+
config=self.sdk_configuration,
|
|
3769
3914
|
base_url=base_url or "",
|
|
3770
3915
|
operation_id="create-server-reinstall",
|
|
3771
3916
|
oauth2_scopes=[],
|