hostinger-api 1.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.
Files changed (88) hide show
  1. hostinger_api/__init__.py +105 -0
  2. hostinger_api/api/__init__.py +21 -0
  3. hostinger_api/api/billing_catalog_api.py +282 -0
  4. hostinger_api/api/billing_orders_api.py +313 -0
  5. hostinger_api/api/billing_payment_methods_api.py +819 -0
  6. hostinger_api/api/billing_subscriptions_api.py +584 -0
  7. hostinger_api/api/domains_portfolio_api.py +282 -0
  8. hostinger_api/api/vps_actions_api.py +599 -0
  9. hostinger_api/api/vps_backups_api.py +882 -0
  10. hostinger_api/api/vps_data_centers_api.py +282 -0
  11. hostinger_api/api/vps_firewall_api.py +2872 -0
  12. hostinger_api/api/vps_malware_scanner_api.py +842 -0
  13. hostinger_api/api/vps_post_install_scripts_api.py +1419 -0
  14. hostinger_api/api/vps_public_keys_api.py +1154 -0
  15. hostinger_api/api/vps_recovery_api.py +597 -0
  16. hostinger_api/api/vps_snapshots_api.py +1100 -0
  17. hostinger_api/api/vps_virtual_machine_api.py +3714 -0
  18. hostinger_api/api/vpsos_templates_api.py +551 -0
  19. hostinger_api/api/vpsptr_records_api.py +565 -0
  20. hostinger_api/api_client.py +795 -0
  21. hostinger_api/api_response.py +21 -0
  22. hostinger_api/configuration.py +579 -0
  23. hostinger_api/exceptions.py +214 -0
  24. hostinger_api/models/__init__.py +72 -0
  25. hostinger_api/models/billing_v1_catalog_catalog_item_price_resource.py +107 -0
  26. hostinger_api/models/billing_v1_catalog_catalog_item_resource.py +99 -0
  27. hostinger_api/models/billing_v1_order_order_billing_address_resource.py +145 -0
  28. hostinger_api/models/billing_v1_order_order_resource.py +116 -0
  29. hostinger_api/models/billing_v1_order_store_request.py +97 -0
  30. hostinger_api/models/billing_v1_order_store_request_items_inner.py +87 -0
  31. hostinger_api/models/billing_v1_payment_method_payment_method_resource.py +102 -0
  32. hostinger_api/models/billing_v1_subscription_cancel_request.py +117 -0
  33. hostinger_api/models/billing_v1_subscription_subscription_resource.py +130 -0
  34. hostinger_api/models/common_schema_error_response_schema.py +87 -0
  35. hostinger_api/models/common_schema_pagination_meta_schema.py +89 -0
  36. hostinger_api/models/common_schema_unauthorized_response_schema.py +87 -0
  37. hostinger_api/models/common_schema_unprocessable_content_response_schema.py +93 -0
  38. hostinger_api/models/common_schema_unprocessable_content_response_schema_errors.py +87 -0
  39. hostinger_api/models/common_success_empty_resource.py +85 -0
  40. hostinger_api/models/domains_v1_domain_domain_resource.py +126 -0
  41. hostinger_api/models/vps_get_action_list_v1200_response.py +99 -0
  42. hostinger_api/models/vps_get_backup_list_v1200_response.py +99 -0
  43. hostinger_api/models/vps_get_firewall_list_v1200_response.py +99 -0
  44. hostinger_api/models/vps_get_post_install_script_list_v1200_response.py +99 -0
  45. hostinger_api/models/vps_get_public_key_list_v1200_response.py +99 -0
  46. hostinger_api/models/vpsv1_action_action_resource.py +104 -0
  47. hostinger_api/models/vpsv1_backup_backup_resource.py +90 -0
  48. hostinger_api/models/vpsv1_data_center_data_center_resource.py +113 -0
  49. hostinger_api/models/vpsv1_firewall_firewall_resource.py +104 -0
  50. hostinger_api/models/vpsv1_firewall_firewall_rule_resource.py +115 -0
  51. hostinger_api/models/vpsv1_firewall_rules_store_request.py +105 -0
  52. hostinger_api/models/vpsv1_firewall_store_request.py +85 -0
  53. hostinger_api/models/vpsv1_ip_address_ip_address_resource.py +94 -0
  54. hostinger_api/models/vpsv1_malware_metrics_resource.py +101 -0
  55. hostinger_api/models/vpsv1_metrics_metrics_collection.py +149 -0
  56. hostinger_api/models/vpsv1_metrics_metrics_collection_cpu_usage.py +127 -0
  57. hostinger_api/models/vpsv1_metrics_metrics_collection_disk_space.py +127 -0
  58. hostinger_api/models/vpsv1_metrics_metrics_collection_incoming_traffic.py +127 -0
  59. hostinger_api/models/vpsv1_metrics_metrics_collection_outgoing_traffic.py +127 -0
  60. hostinger_api/models/vpsv1_metrics_metrics_collection_ram_usage.py +127 -0
  61. hostinger_api/models/vpsv1_metrics_metrics_collection_uptime.py +127 -0
  62. hostinger_api/models/vpsv1_metrics_metrics_resource.py +87 -0
  63. hostinger_api/models/vpsv1_post_install_script_post_install_script_resource.py +94 -0
  64. hostinger_api/models/vpsv1_post_install_script_store_request.py +87 -0
  65. hostinger_api/models/vpsv1_public_key_attach_request.py +85 -0
  66. hostinger_api/models/vpsv1_public_key_public_key_resource.py +89 -0
  67. hostinger_api/models/vpsv1_public_key_store_request.py +87 -0
  68. hostinger_api/models/vpsv1_snapshot_snapshot_resource.py +90 -0
  69. hostinger_api/models/vpsv1_template_template_resource.py +96 -0
  70. hostinger_api/models/vpsv1_virtual_machine_hostname_update_request.py +85 -0
  71. hostinger_api/models/vpsv1_virtual_machine_metric_get_request.py +88 -0
  72. hostinger_api/models/vpsv1_virtual_machine_nameservers_update_request.py +87 -0
  73. hostinger_api/models/vpsv1_virtual_machine_panel_password_update_request.py +86 -0
  74. hostinger_api/models/vpsv1_virtual_machine_recovery_start_request.py +85 -0
  75. hostinger_api/models/vpsv1_virtual_machine_recreate_request.py +90 -0
  76. hostinger_api/models/vpsv1_virtual_machine_root_password_update_request.py +86 -0
  77. hostinger_api/models/vpsv1_virtual_machine_setup_request.py +108 -0
  78. hostinger_api/models/vpsv1_virtual_machine_setup_request_public_key.py +87 -0
  79. hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource.py +190 -0
  80. hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_ipv4.py +131 -0
  81. hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_ipv6.py +131 -0
  82. hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_template.py +127 -0
  83. hostinger_api/py.typed +0 -0
  84. hostinger_api/rest.py +256 -0
  85. hostinger_api-1.0.0.dist-info/METADATA +26 -0
  86. hostinger_api-1.0.0.dist-info/RECORD +88 -0
  87. hostinger_api-1.0.0.dist-info/WHEEL +5 -0
  88. hostinger_api-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hostinger API Python SDK
5
+
6
+ API Version: 0.0.1-beta
7
+
8
+ NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
9
+ If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
10
+ """ # noqa: E501
11
+
12
+ import warnings
13
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
14
+ from typing import Any, Dict, List, Optional, Tuple, Union
15
+ from typing_extensions import Annotated
16
+
17
+ from pydantic import Field, StrictInt
18
+ from typing_extensions import Annotated
19
+ from hostinger_api.models.vpsv1_action_action_resource import VPSV1ActionActionResource
20
+ from hostinger_api.models.vpsv1_snapshot_snapshot_resource import VPSV1SnapshotSnapshotResource
21
+
22
+ from hostinger_api.api_client import ApiClient, RequestSerialized
23
+ from hostinger_api.api_response import ApiResponse
24
+ from hostinger_api.rest import RESTResponseType
25
+
26
+
27
+ class VPSSnapshotsApi:
28
+
29
+ def __init__(self, api_client=None) -> None:
30
+ if api_client is None:
31
+ api_client = ApiClient.get_default()
32
+ self.api_client = api_client
33
+
34
+
35
+ @validate_call
36
+ def create_snapshot_v1(
37
+ self,
38
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
39
+ _request_timeout: Union[
40
+ None,
41
+ Annotated[StrictFloat, Field(gt=0)],
42
+ Tuple[
43
+ Annotated[StrictFloat, Field(gt=0)],
44
+ Annotated[StrictFloat, Field(gt=0)]
45
+ ]
46
+ ] = None,
47
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
48
+ _content_type: Optional[StrictStr] = None,
49
+ _headers: Optional[Dict[StrictStr, Any]] = None,
50
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
51
+ ) -> VPSV1ActionActionResource:
52
+ """Create snapshot
53
+
54
+ This endpoint creates a snapshot of a specified virtual machine. A snapshot captures the state and data of the virtual machine at a specific point in time, allowing users to restore the virtual machine to that state if needed. This operation is useful for backup purposes, system recovery, and testing changes without affecting the current state of the virtual machine. **Creating new snapshot will overwrite the existing snapshot!**
55
+
56
+ :param virtual_machine_id: Virtual Machine ID (required)
57
+ :type virtual_machine_id: int
58
+ :param _request_timeout: timeout setting for this request. If one
59
+ number provided, it will be total request
60
+ timeout. It can also be a pair (tuple) of
61
+ (connection, read) timeouts.
62
+ :type _request_timeout: int, tuple(int, int), optional
63
+ :param _request_auth: set to override the auth_settings for an a single
64
+ request; this effectively ignores the
65
+ authentication in the spec for a single request.
66
+ :type _request_auth: dict, optional
67
+ :param _content_type: force content-type for the request.
68
+ :type _content_type: str, Optional
69
+ :param _headers: set to override the headers for a single
70
+ request; this effectively ignores the headers
71
+ in the spec for a single request.
72
+ :type _headers: dict, optional
73
+ :param _host_index: set to override the host_index for a single
74
+ request; this effectively ignores the host_index
75
+ in the spec for a single request.
76
+ :type _host_index: int, optional
77
+ :return: Returns the result object.
78
+ """ # noqa: E501
79
+
80
+ _param = self._create_snapshot_v1_serialize(
81
+ virtual_machine_id=virtual_machine_id,
82
+ _request_auth=_request_auth,
83
+ _content_type=_content_type,
84
+ _headers=_headers,
85
+ _host_index=_host_index
86
+ )
87
+
88
+ _response_types_map: Dict[str, Optional[str]] = {
89
+ '200': "VPSV1ActionActionResource",
90
+ '401': "CommonSchemaUnauthorizedResponseSchema",
91
+ '500': "CommonSchemaErrorResponseSchema",
92
+ }
93
+ response_data = self.api_client.call_api(
94
+ *_param,
95
+ _request_timeout=_request_timeout
96
+ )
97
+ response_data.read()
98
+ return self.api_client.response_deserialize(
99
+ response_data=response_data,
100
+ response_types_map=_response_types_map,
101
+ ).data
102
+
103
+
104
+ @validate_call
105
+ def create_snapshot_v1_with_http_info(
106
+ self,
107
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
108
+ _request_timeout: Union[
109
+ None,
110
+ Annotated[StrictFloat, Field(gt=0)],
111
+ Tuple[
112
+ Annotated[StrictFloat, Field(gt=0)],
113
+ Annotated[StrictFloat, Field(gt=0)]
114
+ ]
115
+ ] = None,
116
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
117
+ _content_type: Optional[StrictStr] = None,
118
+ _headers: Optional[Dict[StrictStr, Any]] = None,
119
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
120
+ ) -> ApiResponse[VPSV1ActionActionResource]:
121
+ """Create snapshot
122
+
123
+ This endpoint creates a snapshot of a specified virtual machine. A snapshot captures the state and data of the virtual machine at a specific point in time, allowing users to restore the virtual machine to that state if needed. This operation is useful for backup purposes, system recovery, and testing changes without affecting the current state of the virtual machine. **Creating new snapshot will overwrite the existing snapshot!**
124
+
125
+ :param virtual_machine_id: Virtual Machine ID (required)
126
+ :type virtual_machine_id: int
127
+ :param _request_timeout: timeout setting for this request. If one
128
+ number provided, it will be total request
129
+ timeout. It can also be a pair (tuple) of
130
+ (connection, read) timeouts.
131
+ :type _request_timeout: int, tuple(int, int), optional
132
+ :param _request_auth: set to override the auth_settings for an a single
133
+ request; this effectively ignores the
134
+ authentication in the spec for a single request.
135
+ :type _request_auth: dict, optional
136
+ :param _content_type: force content-type for the request.
137
+ :type _content_type: str, Optional
138
+ :param _headers: set to override the headers for a single
139
+ request; this effectively ignores the headers
140
+ in the spec for a single request.
141
+ :type _headers: dict, optional
142
+ :param _host_index: set to override the host_index for a single
143
+ request; this effectively ignores the host_index
144
+ in the spec for a single request.
145
+ :type _host_index: int, optional
146
+ :return: Returns the result object.
147
+ """ # noqa: E501
148
+
149
+ _param = self._create_snapshot_v1_serialize(
150
+ virtual_machine_id=virtual_machine_id,
151
+ _request_auth=_request_auth,
152
+ _content_type=_content_type,
153
+ _headers=_headers,
154
+ _host_index=_host_index
155
+ )
156
+
157
+ _response_types_map: Dict[str, Optional[str]] = {
158
+ '200': "VPSV1ActionActionResource",
159
+ '401': "CommonSchemaUnauthorizedResponseSchema",
160
+ '500': "CommonSchemaErrorResponseSchema",
161
+ }
162
+ response_data = self.api_client.call_api(
163
+ *_param,
164
+ _request_timeout=_request_timeout
165
+ )
166
+ response_data.read()
167
+ return self.api_client.response_deserialize(
168
+ response_data=response_data,
169
+ response_types_map=_response_types_map,
170
+ )
171
+
172
+
173
+ @validate_call
174
+ def create_snapshot_v1_without_preload_content(
175
+ self,
176
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
177
+ _request_timeout: Union[
178
+ None,
179
+ Annotated[StrictFloat, Field(gt=0)],
180
+ Tuple[
181
+ Annotated[StrictFloat, Field(gt=0)],
182
+ Annotated[StrictFloat, Field(gt=0)]
183
+ ]
184
+ ] = None,
185
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
186
+ _content_type: Optional[StrictStr] = None,
187
+ _headers: Optional[Dict[StrictStr, Any]] = None,
188
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
189
+ ) -> RESTResponseType:
190
+ """Create snapshot
191
+
192
+ This endpoint creates a snapshot of a specified virtual machine. A snapshot captures the state and data of the virtual machine at a specific point in time, allowing users to restore the virtual machine to that state if needed. This operation is useful for backup purposes, system recovery, and testing changes without affecting the current state of the virtual machine. **Creating new snapshot will overwrite the existing snapshot!**
193
+
194
+ :param virtual_machine_id: Virtual Machine ID (required)
195
+ :type virtual_machine_id: int
196
+ :param _request_timeout: timeout setting for this request. If one
197
+ number provided, it will be total request
198
+ timeout. It can also be a pair (tuple) of
199
+ (connection, read) timeouts.
200
+ :type _request_timeout: int, tuple(int, int), optional
201
+ :param _request_auth: set to override the auth_settings for an a single
202
+ request; this effectively ignores the
203
+ authentication in the spec for a single request.
204
+ :type _request_auth: dict, optional
205
+ :param _content_type: force content-type for the request.
206
+ :type _content_type: str, Optional
207
+ :param _headers: set to override the headers for a single
208
+ request; this effectively ignores the headers
209
+ in the spec for a single request.
210
+ :type _headers: dict, optional
211
+ :param _host_index: set to override the host_index for a single
212
+ request; this effectively ignores the host_index
213
+ in the spec for a single request.
214
+ :type _host_index: int, optional
215
+ :return: Returns the result object.
216
+ """ # noqa: E501
217
+
218
+ _param = self._create_snapshot_v1_serialize(
219
+ virtual_machine_id=virtual_machine_id,
220
+ _request_auth=_request_auth,
221
+ _content_type=_content_type,
222
+ _headers=_headers,
223
+ _host_index=_host_index
224
+ )
225
+
226
+ _response_types_map: Dict[str, Optional[str]] = {
227
+ '200': "VPSV1ActionActionResource",
228
+ '401': "CommonSchemaUnauthorizedResponseSchema",
229
+ '500': "CommonSchemaErrorResponseSchema",
230
+ }
231
+ response_data = self.api_client.call_api(
232
+ *_param,
233
+ _request_timeout=_request_timeout
234
+ )
235
+ return response_data.response
236
+
237
+
238
+ def _create_snapshot_v1_serialize(
239
+ self,
240
+ virtual_machine_id,
241
+ _request_auth,
242
+ _content_type,
243
+ _headers,
244
+ _host_index,
245
+ ) -> RequestSerialized:
246
+
247
+ _host = None
248
+
249
+ _collection_formats: Dict[str, str] = {
250
+ }
251
+
252
+ _path_params: Dict[str, str] = {}
253
+ _query_params: List[Tuple[str, str]] = []
254
+ _header_params: Dict[str, Optional[str]] = _headers or {}
255
+ _form_params: List[Tuple[str, str]] = []
256
+ _files: Dict[
257
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
258
+ ] = {}
259
+ _body_params: Optional[bytes] = None
260
+
261
+ # process the path parameters
262
+ if virtual_machine_id is not None:
263
+ _path_params['virtualMachineId'] = virtual_machine_id
264
+ # process the query parameters
265
+ # process the header parameters
266
+ # process the form parameters
267
+ # process the body parameter
268
+
269
+
270
+ # set the HTTP header `Accept`
271
+ if 'Accept' not in _header_params:
272
+ _header_params['Accept'] = self.api_client.select_header_accept(
273
+ [
274
+ 'application/json'
275
+ ]
276
+ )
277
+
278
+
279
+ # authentication setting
280
+ _auth_settings: List[str] = [
281
+ 'apiToken'
282
+ ]
283
+
284
+ return self.api_client.param_serialize(
285
+ method='POST',
286
+ resource_path='/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot',
287
+ path_params=_path_params,
288
+ query_params=_query_params,
289
+ header_params=_header_params,
290
+ body=_body_params,
291
+ post_params=_form_params,
292
+ files=_files,
293
+ auth_settings=_auth_settings,
294
+ collection_formats=_collection_formats,
295
+ _host=_host,
296
+ _request_auth=_request_auth
297
+ )
298
+
299
+
300
+
301
+
302
+ @validate_call
303
+ def delete_snapshot_v1(
304
+ self,
305
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
306
+ _request_timeout: Union[
307
+ None,
308
+ Annotated[StrictFloat, Field(gt=0)],
309
+ Tuple[
310
+ Annotated[StrictFloat, Field(gt=0)],
311
+ Annotated[StrictFloat, Field(gt=0)]
312
+ ]
313
+ ] = None,
314
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
315
+ _content_type: Optional[StrictStr] = None,
316
+ _headers: Optional[Dict[StrictStr, Any]] = None,
317
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
318
+ ) -> VPSV1ActionActionResource:
319
+ """Delete snapshot
320
+
321
+ This endpoint deletes a snapshot of a specified virtual machine.
322
+
323
+ :param virtual_machine_id: Virtual Machine ID (required)
324
+ :type virtual_machine_id: int
325
+ :param _request_timeout: timeout setting for this request. If one
326
+ number provided, it will be total request
327
+ timeout. It can also be a pair (tuple) of
328
+ (connection, read) timeouts.
329
+ :type _request_timeout: int, tuple(int, int), optional
330
+ :param _request_auth: set to override the auth_settings for an a single
331
+ request; this effectively ignores the
332
+ authentication in the spec for a single request.
333
+ :type _request_auth: dict, optional
334
+ :param _content_type: force content-type for the request.
335
+ :type _content_type: str, Optional
336
+ :param _headers: set to override the headers for a single
337
+ request; this effectively ignores the headers
338
+ in the spec for a single request.
339
+ :type _headers: dict, optional
340
+ :param _host_index: set to override the host_index for a single
341
+ request; this effectively ignores the host_index
342
+ in the spec for a single request.
343
+ :type _host_index: int, optional
344
+ :return: Returns the result object.
345
+ """ # noqa: E501
346
+
347
+ _param = self._delete_snapshot_v1_serialize(
348
+ virtual_machine_id=virtual_machine_id,
349
+ _request_auth=_request_auth,
350
+ _content_type=_content_type,
351
+ _headers=_headers,
352
+ _host_index=_host_index
353
+ )
354
+
355
+ _response_types_map: Dict[str, Optional[str]] = {
356
+ '200': "VPSV1ActionActionResource",
357
+ '401': "CommonSchemaUnauthorizedResponseSchema",
358
+ '500': "CommonSchemaErrorResponseSchema",
359
+ }
360
+ response_data = self.api_client.call_api(
361
+ *_param,
362
+ _request_timeout=_request_timeout
363
+ )
364
+ response_data.read()
365
+ return self.api_client.response_deserialize(
366
+ response_data=response_data,
367
+ response_types_map=_response_types_map,
368
+ ).data
369
+
370
+
371
+ @validate_call
372
+ def delete_snapshot_v1_with_http_info(
373
+ self,
374
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
375
+ _request_timeout: Union[
376
+ None,
377
+ Annotated[StrictFloat, Field(gt=0)],
378
+ Tuple[
379
+ Annotated[StrictFloat, Field(gt=0)],
380
+ Annotated[StrictFloat, Field(gt=0)]
381
+ ]
382
+ ] = None,
383
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
384
+ _content_type: Optional[StrictStr] = None,
385
+ _headers: Optional[Dict[StrictStr, Any]] = None,
386
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
387
+ ) -> ApiResponse[VPSV1ActionActionResource]:
388
+ """Delete snapshot
389
+
390
+ This endpoint deletes a snapshot of a specified virtual machine.
391
+
392
+ :param virtual_machine_id: Virtual Machine ID (required)
393
+ :type virtual_machine_id: int
394
+ :param _request_timeout: timeout setting for this request. If one
395
+ number provided, it will be total request
396
+ timeout. It can also be a pair (tuple) of
397
+ (connection, read) timeouts.
398
+ :type _request_timeout: int, tuple(int, int), optional
399
+ :param _request_auth: set to override the auth_settings for an a single
400
+ request; this effectively ignores the
401
+ authentication in the spec for a single request.
402
+ :type _request_auth: dict, optional
403
+ :param _content_type: force content-type for the request.
404
+ :type _content_type: str, Optional
405
+ :param _headers: set to override the headers for a single
406
+ request; this effectively ignores the headers
407
+ in the spec for a single request.
408
+ :type _headers: dict, optional
409
+ :param _host_index: set to override the host_index for a single
410
+ request; this effectively ignores the host_index
411
+ in the spec for a single request.
412
+ :type _host_index: int, optional
413
+ :return: Returns the result object.
414
+ """ # noqa: E501
415
+
416
+ _param = self._delete_snapshot_v1_serialize(
417
+ virtual_machine_id=virtual_machine_id,
418
+ _request_auth=_request_auth,
419
+ _content_type=_content_type,
420
+ _headers=_headers,
421
+ _host_index=_host_index
422
+ )
423
+
424
+ _response_types_map: Dict[str, Optional[str]] = {
425
+ '200': "VPSV1ActionActionResource",
426
+ '401': "CommonSchemaUnauthorizedResponseSchema",
427
+ '500': "CommonSchemaErrorResponseSchema",
428
+ }
429
+ response_data = self.api_client.call_api(
430
+ *_param,
431
+ _request_timeout=_request_timeout
432
+ )
433
+ response_data.read()
434
+ return self.api_client.response_deserialize(
435
+ response_data=response_data,
436
+ response_types_map=_response_types_map,
437
+ )
438
+
439
+
440
+ @validate_call
441
+ def delete_snapshot_v1_without_preload_content(
442
+ self,
443
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
444
+ _request_timeout: Union[
445
+ None,
446
+ Annotated[StrictFloat, Field(gt=0)],
447
+ Tuple[
448
+ Annotated[StrictFloat, Field(gt=0)],
449
+ Annotated[StrictFloat, Field(gt=0)]
450
+ ]
451
+ ] = None,
452
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
453
+ _content_type: Optional[StrictStr] = None,
454
+ _headers: Optional[Dict[StrictStr, Any]] = None,
455
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
456
+ ) -> RESTResponseType:
457
+ """Delete snapshot
458
+
459
+ This endpoint deletes a snapshot of a specified virtual machine.
460
+
461
+ :param virtual_machine_id: Virtual Machine ID (required)
462
+ :type virtual_machine_id: int
463
+ :param _request_timeout: timeout setting for this request. If one
464
+ number provided, it will be total request
465
+ timeout. It can also be a pair (tuple) of
466
+ (connection, read) timeouts.
467
+ :type _request_timeout: int, tuple(int, int), optional
468
+ :param _request_auth: set to override the auth_settings for an a single
469
+ request; this effectively ignores the
470
+ authentication in the spec for a single request.
471
+ :type _request_auth: dict, optional
472
+ :param _content_type: force content-type for the request.
473
+ :type _content_type: str, Optional
474
+ :param _headers: set to override the headers for a single
475
+ request; this effectively ignores the headers
476
+ in the spec for a single request.
477
+ :type _headers: dict, optional
478
+ :param _host_index: set to override the host_index for a single
479
+ request; this effectively ignores the host_index
480
+ in the spec for a single request.
481
+ :type _host_index: int, optional
482
+ :return: Returns the result object.
483
+ """ # noqa: E501
484
+
485
+ _param = self._delete_snapshot_v1_serialize(
486
+ virtual_machine_id=virtual_machine_id,
487
+ _request_auth=_request_auth,
488
+ _content_type=_content_type,
489
+ _headers=_headers,
490
+ _host_index=_host_index
491
+ )
492
+
493
+ _response_types_map: Dict[str, Optional[str]] = {
494
+ '200': "VPSV1ActionActionResource",
495
+ '401': "CommonSchemaUnauthorizedResponseSchema",
496
+ '500': "CommonSchemaErrorResponseSchema",
497
+ }
498
+ response_data = self.api_client.call_api(
499
+ *_param,
500
+ _request_timeout=_request_timeout
501
+ )
502
+ return response_data.response
503
+
504
+
505
+ def _delete_snapshot_v1_serialize(
506
+ self,
507
+ virtual_machine_id,
508
+ _request_auth,
509
+ _content_type,
510
+ _headers,
511
+ _host_index,
512
+ ) -> RequestSerialized:
513
+
514
+ _host = None
515
+
516
+ _collection_formats: Dict[str, str] = {
517
+ }
518
+
519
+ _path_params: Dict[str, str] = {}
520
+ _query_params: List[Tuple[str, str]] = []
521
+ _header_params: Dict[str, Optional[str]] = _headers or {}
522
+ _form_params: List[Tuple[str, str]] = []
523
+ _files: Dict[
524
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
525
+ ] = {}
526
+ _body_params: Optional[bytes] = None
527
+
528
+ # process the path parameters
529
+ if virtual_machine_id is not None:
530
+ _path_params['virtualMachineId'] = virtual_machine_id
531
+ # process the query parameters
532
+ # process the header parameters
533
+ # process the form parameters
534
+ # process the body parameter
535
+
536
+
537
+ # set the HTTP header `Accept`
538
+ if 'Accept' not in _header_params:
539
+ _header_params['Accept'] = self.api_client.select_header_accept(
540
+ [
541
+ 'application/json'
542
+ ]
543
+ )
544
+
545
+
546
+ # authentication setting
547
+ _auth_settings: List[str] = [
548
+ 'apiToken'
549
+ ]
550
+
551
+ return self.api_client.param_serialize(
552
+ method='DELETE',
553
+ resource_path='/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot',
554
+ path_params=_path_params,
555
+ query_params=_query_params,
556
+ header_params=_header_params,
557
+ body=_body_params,
558
+ post_params=_form_params,
559
+ files=_files,
560
+ auth_settings=_auth_settings,
561
+ collection_formats=_collection_formats,
562
+ _host=_host,
563
+ _request_auth=_request_auth
564
+ )
565
+
566
+
567
+
568
+
569
+ @validate_call
570
+ def get_snapshot_v1(
571
+ self,
572
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
573
+ _request_timeout: Union[
574
+ None,
575
+ Annotated[StrictFloat, Field(gt=0)],
576
+ Tuple[
577
+ Annotated[StrictFloat, Field(gt=0)],
578
+ Annotated[StrictFloat, Field(gt=0)]
579
+ ]
580
+ ] = None,
581
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
582
+ _content_type: Optional[StrictStr] = None,
583
+ _headers: Optional[Dict[StrictStr, Any]] = None,
584
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
585
+ ) -> VPSV1SnapshotSnapshotResource:
586
+ """Get snapshot
587
+
588
+ This endpoint retrieves a snapshot for a specified virtual machine.
589
+
590
+ :param virtual_machine_id: Virtual Machine ID (required)
591
+ :type virtual_machine_id: int
592
+ :param _request_timeout: timeout setting for this request. If one
593
+ number provided, it will be total request
594
+ timeout. It can also be a pair (tuple) of
595
+ (connection, read) timeouts.
596
+ :type _request_timeout: int, tuple(int, int), optional
597
+ :param _request_auth: set to override the auth_settings for an a single
598
+ request; this effectively ignores the
599
+ authentication in the spec for a single request.
600
+ :type _request_auth: dict, optional
601
+ :param _content_type: force content-type for the request.
602
+ :type _content_type: str, Optional
603
+ :param _headers: set to override the headers for a single
604
+ request; this effectively ignores the headers
605
+ in the spec for a single request.
606
+ :type _headers: dict, optional
607
+ :param _host_index: set to override the host_index for a single
608
+ request; this effectively ignores the host_index
609
+ in the spec for a single request.
610
+ :type _host_index: int, optional
611
+ :return: Returns the result object.
612
+ """ # noqa: E501
613
+
614
+ _param = self._get_snapshot_v1_serialize(
615
+ virtual_machine_id=virtual_machine_id,
616
+ _request_auth=_request_auth,
617
+ _content_type=_content_type,
618
+ _headers=_headers,
619
+ _host_index=_host_index
620
+ )
621
+
622
+ _response_types_map: Dict[str, Optional[str]] = {
623
+ '200': "VPSV1SnapshotSnapshotResource",
624
+ '401': "CommonSchemaUnauthorizedResponseSchema",
625
+ '500': "CommonSchemaErrorResponseSchema",
626
+ }
627
+ response_data = self.api_client.call_api(
628
+ *_param,
629
+ _request_timeout=_request_timeout
630
+ )
631
+ response_data.read()
632
+ return self.api_client.response_deserialize(
633
+ response_data=response_data,
634
+ response_types_map=_response_types_map,
635
+ ).data
636
+
637
+
638
+ @validate_call
639
+ def get_snapshot_v1_with_http_info(
640
+ self,
641
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
642
+ _request_timeout: Union[
643
+ None,
644
+ Annotated[StrictFloat, Field(gt=0)],
645
+ Tuple[
646
+ Annotated[StrictFloat, Field(gt=0)],
647
+ Annotated[StrictFloat, Field(gt=0)]
648
+ ]
649
+ ] = None,
650
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
651
+ _content_type: Optional[StrictStr] = None,
652
+ _headers: Optional[Dict[StrictStr, Any]] = None,
653
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
654
+ ) -> ApiResponse[VPSV1SnapshotSnapshotResource]:
655
+ """Get snapshot
656
+
657
+ This endpoint retrieves a snapshot for a specified virtual machine.
658
+
659
+ :param virtual_machine_id: Virtual Machine ID (required)
660
+ :type virtual_machine_id: int
661
+ :param _request_timeout: timeout setting for this request. If one
662
+ number provided, it will be total request
663
+ timeout. It can also be a pair (tuple) of
664
+ (connection, read) timeouts.
665
+ :type _request_timeout: int, tuple(int, int), optional
666
+ :param _request_auth: set to override the auth_settings for an a single
667
+ request; this effectively ignores the
668
+ authentication in the spec for a single request.
669
+ :type _request_auth: dict, optional
670
+ :param _content_type: force content-type for the request.
671
+ :type _content_type: str, Optional
672
+ :param _headers: set to override the headers for a single
673
+ request; this effectively ignores the headers
674
+ in the spec for a single request.
675
+ :type _headers: dict, optional
676
+ :param _host_index: set to override the host_index for a single
677
+ request; this effectively ignores the host_index
678
+ in the spec for a single request.
679
+ :type _host_index: int, optional
680
+ :return: Returns the result object.
681
+ """ # noqa: E501
682
+
683
+ _param = self._get_snapshot_v1_serialize(
684
+ virtual_machine_id=virtual_machine_id,
685
+ _request_auth=_request_auth,
686
+ _content_type=_content_type,
687
+ _headers=_headers,
688
+ _host_index=_host_index
689
+ )
690
+
691
+ _response_types_map: Dict[str, Optional[str]] = {
692
+ '200': "VPSV1SnapshotSnapshotResource",
693
+ '401': "CommonSchemaUnauthorizedResponseSchema",
694
+ '500': "CommonSchemaErrorResponseSchema",
695
+ }
696
+ response_data = self.api_client.call_api(
697
+ *_param,
698
+ _request_timeout=_request_timeout
699
+ )
700
+ response_data.read()
701
+ return self.api_client.response_deserialize(
702
+ response_data=response_data,
703
+ response_types_map=_response_types_map,
704
+ )
705
+
706
+
707
+ @validate_call
708
+ def get_snapshot_v1_without_preload_content(
709
+ self,
710
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
711
+ _request_timeout: Union[
712
+ None,
713
+ Annotated[StrictFloat, Field(gt=0)],
714
+ Tuple[
715
+ Annotated[StrictFloat, Field(gt=0)],
716
+ Annotated[StrictFloat, Field(gt=0)]
717
+ ]
718
+ ] = None,
719
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
720
+ _content_type: Optional[StrictStr] = None,
721
+ _headers: Optional[Dict[StrictStr, Any]] = None,
722
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
723
+ ) -> RESTResponseType:
724
+ """Get snapshot
725
+
726
+ This endpoint retrieves a snapshot for a specified virtual machine.
727
+
728
+ :param virtual_machine_id: Virtual Machine ID (required)
729
+ :type virtual_machine_id: int
730
+ :param _request_timeout: timeout setting for this request. If one
731
+ number provided, it will be total request
732
+ timeout. It can also be a pair (tuple) of
733
+ (connection, read) timeouts.
734
+ :type _request_timeout: int, tuple(int, int), optional
735
+ :param _request_auth: set to override the auth_settings for an a single
736
+ request; this effectively ignores the
737
+ authentication in the spec for a single request.
738
+ :type _request_auth: dict, optional
739
+ :param _content_type: force content-type for the request.
740
+ :type _content_type: str, Optional
741
+ :param _headers: set to override the headers for a single
742
+ request; this effectively ignores the headers
743
+ in the spec for a single request.
744
+ :type _headers: dict, optional
745
+ :param _host_index: set to override the host_index for a single
746
+ request; this effectively ignores the host_index
747
+ in the spec for a single request.
748
+ :type _host_index: int, optional
749
+ :return: Returns the result object.
750
+ """ # noqa: E501
751
+
752
+ _param = self._get_snapshot_v1_serialize(
753
+ virtual_machine_id=virtual_machine_id,
754
+ _request_auth=_request_auth,
755
+ _content_type=_content_type,
756
+ _headers=_headers,
757
+ _host_index=_host_index
758
+ )
759
+
760
+ _response_types_map: Dict[str, Optional[str]] = {
761
+ '200': "VPSV1SnapshotSnapshotResource",
762
+ '401': "CommonSchemaUnauthorizedResponseSchema",
763
+ '500': "CommonSchemaErrorResponseSchema",
764
+ }
765
+ response_data = self.api_client.call_api(
766
+ *_param,
767
+ _request_timeout=_request_timeout
768
+ )
769
+ return response_data.response
770
+
771
+
772
+ def _get_snapshot_v1_serialize(
773
+ self,
774
+ virtual_machine_id,
775
+ _request_auth,
776
+ _content_type,
777
+ _headers,
778
+ _host_index,
779
+ ) -> RequestSerialized:
780
+
781
+ _host = None
782
+
783
+ _collection_formats: Dict[str, str] = {
784
+ }
785
+
786
+ _path_params: Dict[str, str] = {}
787
+ _query_params: List[Tuple[str, str]] = []
788
+ _header_params: Dict[str, Optional[str]] = _headers or {}
789
+ _form_params: List[Tuple[str, str]] = []
790
+ _files: Dict[
791
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
792
+ ] = {}
793
+ _body_params: Optional[bytes] = None
794
+
795
+ # process the path parameters
796
+ if virtual_machine_id is not None:
797
+ _path_params['virtualMachineId'] = virtual_machine_id
798
+ # process the query parameters
799
+ # process the header parameters
800
+ # process the form parameters
801
+ # process the body parameter
802
+
803
+
804
+ # set the HTTP header `Accept`
805
+ if 'Accept' not in _header_params:
806
+ _header_params['Accept'] = self.api_client.select_header_accept(
807
+ [
808
+ 'application/json'
809
+ ]
810
+ )
811
+
812
+
813
+ # authentication setting
814
+ _auth_settings: List[str] = [
815
+ 'apiToken'
816
+ ]
817
+
818
+ return self.api_client.param_serialize(
819
+ method='GET',
820
+ resource_path='/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot',
821
+ path_params=_path_params,
822
+ query_params=_query_params,
823
+ header_params=_header_params,
824
+ body=_body_params,
825
+ post_params=_form_params,
826
+ files=_files,
827
+ auth_settings=_auth_settings,
828
+ collection_formats=_collection_formats,
829
+ _host=_host,
830
+ _request_auth=_request_auth
831
+ )
832
+
833
+
834
+
835
+
836
+ @validate_call
837
+ def restore_snapshot_v1(
838
+ self,
839
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
840
+ _request_timeout: Union[
841
+ None,
842
+ Annotated[StrictFloat, Field(gt=0)],
843
+ Tuple[
844
+ Annotated[StrictFloat, Field(gt=0)],
845
+ Annotated[StrictFloat, Field(gt=0)]
846
+ ]
847
+ ] = None,
848
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
849
+ _content_type: Optional[StrictStr] = None,
850
+ _headers: Optional[Dict[StrictStr, Any]] = None,
851
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
852
+ ) -> VPSV1ActionActionResource:
853
+ """Restore snapshot
854
+
855
+ This endpoint restores a specified virtual machine to a previous state using a snapshot. Restoring from a snapshot allows users to revert the virtual machine to that state, which is useful for system recovery, undoing changes, or testing.
856
+
857
+ :param virtual_machine_id: Virtual Machine ID (required)
858
+ :type virtual_machine_id: int
859
+ :param _request_timeout: timeout setting for this request. If one
860
+ number provided, it will be total request
861
+ timeout. It can also be a pair (tuple) of
862
+ (connection, read) timeouts.
863
+ :type _request_timeout: int, tuple(int, int), optional
864
+ :param _request_auth: set to override the auth_settings for an a single
865
+ request; this effectively ignores the
866
+ authentication in the spec for a single request.
867
+ :type _request_auth: dict, optional
868
+ :param _content_type: force content-type for the request.
869
+ :type _content_type: str, Optional
870
+ :param _headers: set to override the headers for a single
871
+ request; this effectively ignores the headers
872
+ in the spec for a single request.
873
+ :type _headers: dict, optional
874
+ :param _host_index: set to override the host_index for a single
875
+ request; this effectively ignores the host_index
876
+ in the spec for a single request.
877
+ :type _host_index: int, optional
878
+ :return: Returns the result object.
879
+ """ # noqa: E501
880
+
881
+ _param = self._restore_snapshot_v1_serialize(
882
+ virtual_machine_id=virtual_machine_id,
883
+ _request_auth=_request_auth,
884
+ _content_type=_content_type,
885
+ _headers=_headers,
886
+ _host_index=_host_index
887
+ )
888
+
889
+ _response_types_map: Dict[str, Optional[str]] = {
890
+ '200': "VPSV1ActionActionResource",
891
+ '401': "CommonSchemaUnauthorizedResponseSchema",
892
+ '500': "CommonSchemaErrorResponseSchema",
893
+ }
894
+ response_data = self.api_client.call_api(
895
+ *_param,
896
+ _request_timeout=_request_timeout
897
+ )
898
+ response_data.read()
899
+ return self.api_client.response_deserialize(
900
+ response_data=response_data,
901
+ response_types_map=_response_types_map,
902
+ ).data
903
+
904
+
905
+ @validate_call
906
+ def restore_snapshot_v1_with_http_info(
907
+ self,
908
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
909
+ _request_timeout: Union[
910
+ None,
911
+ Annotated[StrictFloat, Field(gt=0)],
912
+ Tuple[
913
+ Annotated[StrictFloat, Field(gt=0)],
914
+ Annotated[StrictFloat, Field(gt=0)]
915
+ ]
916
+ ] = None,
917
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
918
+ _content_type: Optional[StrictStr] = None,
919
+ _headers: Optional[Dict[StrictStr, Any]] = None,
920
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
921
+ ) -> ApiResponse[VPSV1ActionActionResource]:
922
+ """Restore snapshot
923
+
924
+ This endpoint restores a specified virtual machine to a previous state using a snapshot. Restoring from a snapshot allows users to revert the virtual machine to that state, which is useful for system recovery, undoing changes, or testing.
925
+
926
+ :param virtual_machine_id: Virtual Machine ID (required)
927
+ :type virtual_machine_id: int
928
+ :param _request_timeout: timeout setting for this request. If one
929
+ number provided, it will be total request
930
+ timeout. It can also be a pair (tuple) of
931
+ (connection, read) timeouts.
932
+ :type _request_timeout: int, tuple(int, int), optional
933
+ :param _request_auth: set to override the auth_settings for an a single
934
+ request; this effectively ignores the
935
+ authentication in the spec for a single request.
936
+ :type _request_auth: dict, optional
937
+ :param _content_type: force content-type for the request.
938
+ :type _content_type: str, Optional
939
+ :param _headers: set to override the headers for a single
940
+ request; this effectively ignores the headers
941
+ in the spec for a single request.
942
+ :type _headers: dict, optional
943
+ :param _host_index: set to override the host_index for a single
944
+ request; this effectively ignores the host_index
945
+ in the spec for a single request.
946
+ :type _host_index: int, optional
947
+ :return: Returns the result object.
948
+ """ # noqa: E501
949
+
950
+ _param = self._restore_snapshot_v1_serialize(
951
+ virtual_machine_id=virtual_machine_id,
952
+ _request_auth=_request_auth,
953
+ _content_type=_content_type,
954
+ _headers=_headers,
955
+ _host_index=_host_index
956
+ )
957
+
958
+ _response_types_map: Dict[str, Optional[str]] = {
959
+ '200': "VPSV1ActionActionResource",
960
+ '401': "CommonSchemaUnauthorizedResponseSchema",
961
+ '500': "CommonSchemaErrorResponseSchema",
962
+ }
963
+ response_data = self.api_client.call_api(
964
+ *_param,
965
+ _request_timeout=_request_timeout
966
+ )
967
+ response_data.read()
968
+ return self.api_client.response_deserialize(
969
+ response_data=response_data,
970
+ response_types_map=_response_types_map,
971
+ )
972
+
973
+
974
+ @validate_call
975
+ def restore_snapshot_v1_without_preload_content(
976
+ self,
977
+ virtual_machine_id: Annotated[StrictInt, Field(description="Virtual Machine ID")],
978
+ _request_timeout: Union[
979
+ None,
980
+ Annotated[StrictFloat, Field(gt=0)],
981
+ Tuple[
982
+ Annotated[StrictFloat, Field(gt=0)],
983
+ Annotated[StrictFloat, Field(gt=0)]
984
+ ]
985
+ ] = None,
986
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
987
+ _content_type: Optional[StrictStr] = None,
988
+ _headers: Optional[Dict[StrictStr, Any]] = None,
989
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
990
+ ) -> RESTResponseType:
991
+ """Restore snapshot
992
+
993
+ This endpoint restores a specified virtual machine to a previous state using a snapshot. Restoring from a snapshot allows users to revert the virtual machine to that state, which is useful for system recovery, undoing changes, or testing.
994
+
995
+ :param virtual_machine_id: Virtual Machine ID (required)
996
+ :type virtual_machine_id: int
997
+ :param _request_timeout: timeout setting for this request. If one
998
+ number provided, it will be total request
999
+ timeout. It can also be a pair (tuple) of
1000
+ (connection, read) timeouts.
1001
+ :type _request_timeout: int, tuple(int, int), optional
1002
+ :param _request_auth: set to override the auth_settings for an a single
1003
+ request; this effectively ignores the
1004
+ authentication in the spec for a single request.
1005
+ :type _request_auth: dict, optional
1006
+ :param _content_type: force content-type for the request.
1007
+ :type _content_type: str, Optional
1008
+ :param _headers: set to override the headers for a single
1009
+ request; this effectively ignores the headers
1010
+ in the spec for a single request.
1011
+ :type _headers: dict, optional
1012
+ :param _host_index: set to override the host_index for a single
1013
+ request; this effectively ignores the host_index
1014
+ in the spec for a single request.
1015
+ :type _host_index: int, optional
1016
+ :return: Returns the result object.
1017
+ """ # noqa: E501
1018
+
1019
+ _param = self._restore_snapshot_v1_serialize(
1020
+ virtual_machine_id=virtual_machine_id,
1021
+ _request_auth=_request_auth,
1022
+ _content_type=_content_type,
1023
+ _headers=_headers,
1024
+ _host_index=_host_index
1025
+ )
1026
+
1027
+ _response_types_map: Dict[str, Optional[str]] = {
1028
+ '200': "VPSV1ActionActionResource",
1029
+ '401': "CommonSchemaUnauthorizedResponseSchema",
1030
+ '500': "CommonSchemaErrorResponseSchema",
1031
+ }
1032
+ response_data = self.api_client.call_api(
1033
+ *_param,
1034
+ _request_timeout=_request_timeout
1035
+ )
1036
+ return response_data.response
1037
+
1038
+
1039
+ def _restore_snapshot_v1_serialize(
1040
+ self,
1041
+ virtual_machine_id,
1042
+ _request_auth,
1043
+ _content_type,
1044
+ _headers,
1045
+ _host_index,
1046
+ ) -> RequestSerialized:
1047
+
1048
+ _host = None
1049
+
1050
+ _collection_formats: Dict[str, str] = {
1051
+ }
1052
+
1053
+ _path_params: Dict[str, str] = {}
1054
+ _query_params: List[Tuple[str, str]] = []
1055
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1056
+ _form_params: List[Tuple[str, str]] = []
1057
+ _files: Dict[
1058
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1059
+ ] = {}
1060
+ _body_params: Optional[bytes] = None
1061
+
1062
+ # process the path parameters
1063
+ if virtual_machine_id is not None:
1064
+ _path_params['virtualMachineId'] = virtual_machine_id
1065
+ # process the query parameters
1066
+ # process the header parameters
1067
+ # process the form parameters
1068
+ # process the body parameter
1069
+
1070
+
1071
+ # set the HTTP header `Accept`
1072
+ if 'Accept' not in _header_params:
1073
+ _header_params['Accept'] = self.api_client.select_header_accept(
1074
+ [
1075
+ 'application/json'
1076
+ ]
1077
+ )
1078
+
1079
+
1080
+ # authentication setting
1081
+ _auth_settings: List[str] = [
1082
+ 'apiToken'
1083
+ ]
1084
+
1085
+ return self.api_client.param_serialize(
1086
+ method='POST',
1087
+ resource_path='/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot/restore',
1088
+ path_params=_path_params,
1089
+ query_params=_query_params,
1090
+ header_params=_header_params,
1091
+ body=_body_params,
1092
+ post_params=_form_params,
1093
+ files=_files,
1094
+ auth_settings=_auth_settings,
1095
+ collection_formats=_collection_formats,
1096
+ _host=_host,
1097
+ _request_auth=_request_auth
1098
+ )
1099
+
1100
+