ha-sdk-python 1.0.10__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.
- ha_sdk_python/__init__.py +490 -0
- ha_sdk_python/api/__init__.py +15 -0
- ha_sdk_python/api/backups_api.py +2434 -0
- ha_sdk_python/api/console_access_api.py +334 -0
- ha_sdk_python/api/dns_api.py +896 -0
- ha_sdk_python/api/firewall_api.py +1534 -0
- ha_sdk_python/api/monitoring_api.py +1234 -0
- ha_sdk_python/api/power_management_api.py +2434 -0
- ha_sdk_python/api/security_api.py +1243 -0
- ha_sdk_python/api/service_management_api.py +1797 -0
- ha_sdk_python/api/snapshots_api.py +1534 -0
- ha_sdk_python/api/user_management_api.py +331 -0
- ha_sdk_python/api/vps_management_api.py +2399 -0
- ha_sdk_python/api_client.py +805 -0
- ha_sdk_python/api_response.py +21 -0
- ha_sdk_python/configuration.py +593 -0
- ha_sdk_python/exceptions.py +218 -0
- ha_sdk_python/models/__init__.py +227 -0
- ha_sdk_python/models/backup_create_response_data.py +97 -0
- ha_sdk_python/models/backup_creation_info.py +95 -0
- ha_sdk_python/models/backup_item.py +95 -0
- ha_sdk_python/models/backup_mode.py +89 -0
- ha_sdk_python/models/backup_mode_type.py +38 -0
- ha_sdk_python/models/backup_schedule.py +98 -0
- ha_sdk_python/models/backup_schedule_list_response_data.py +97 -0
- ha_sdk_python/models/bad_request_error_response_content.py +89 -0
- ha_sdk_python/models/billing_cycle.py +37 -0
- ha_sdk_python/models/cancel_vps_request_content.py +90 -0
- ha_sdk_python/models/cancel_vps_response_content.py +94 -0
- ha_sdk_python/models/catalogue_config_option.py +105 -0
- ha_sdk_python/models/catalogue_config_suboption.py +96 -0
- ha_sdk_python/models/catalogue_currency.py +91 -0
- ha_sdk_python/models/catalogue_data.py +107 -0
- ha_sdk_python/models/catalogue_group.py +99 -0
- ha_sdk_python/models/catalogue_plan.py +108 -0
- ha_sdk_python/models/catalogue_product.py +131 -0
- ha_sdk_python/models/change_password_request_content.py +90 -0
- ha_sdk_python/models/change_password_response_content.py +94 -0
- ha_sdk_python/models/compression_method.py +89 -0
- ha_sdk_python/models/compression_type.py +39 -0
- ha_sdk_python/models/create_backup_request_content.py +93 -0
- ha_sdk_python/models/create_backup_response_content.py +94 -0
- ha_sdk_python/models/create_backup_schedule_request_content.py +108 -0
- ha_sdk_python/models/create_backup_schedule_response_content.py +94 -0
- ha_sdk_python/models/create_firewall_rule_request_content.py +115 -0
- ha_sdk_python/models/create_firewall_rule_response_content.py +94 -0
- ha_sdk_python/models/create_notification_request_content.py +111 -0
- ha_sdk_python/models/create_notification_response_content.py +94 -0
- ha_sdk_python/models/create_order_domain_item.py +101 -0
- ha_sdk_python/models/create_order_items.py +105 -0
- ha_sdk_python/models/create_order_product.py +108 -0
- ha_sdk_python/models/create_order_product_item.py +101 -0
- ha_sdk_python/models/create_order_request_content.py +97 -0
- ha_sdk_python/models/create_order_response_content.py +94 -0
- ha_sdk_python/models/create_order_response_data.py +126 -0
- ha_sdk_python/models/create_order_total.py +91 -0
- ha_sdk_python/models/create_power_task_request_content.py +160 -0
- ha_sdk_python/models/create_power_task_response_content.py +94 -0
- ha_sdk_python/models/create_rdns_record_request_content.py +96 -0
- ha_sdk_python/models/create_rdns_record_response_content.py +94 -0
- ha_sdk_python/models/create_rdns_record_response_data.py +91 -0
- ha_sdk_python/models/create_snapshot_request_content.py +91 -0
- ha_sdk_python/models/create_snapshot_response_content.py +94 -0
- ha_sdk_python/models/day_of_week.py +42 -0
- ha_sdk_python/models/delete_backup_request_content.py +89 -0
- ha_sdk_python/models/delete_backup_response_content.py +94 -0
- ha_sdk_python/models/delete_backup_schedule_request_content.py +89 -0
- ha_sdk_python/models/delete_backup_schedule_response_content.py +94 -0
- ha_sdk_python/models/delete_firewall_rule_request_content.py +89 -0
- ha_sdk_python/models/delete_firewall_rule_response_content.py +94 -0
- ha_sdk_python/models/delete_notification_request_content.py +89 -0
- ha_sdk_python/models/delete_notification_response_content.py +94 -0
- ha_sdk_python/models/delete_power_task_request_content.py +89 -0
- ha_sdk_python/models/delete_power_task_response_content.py +94 -0
- ha_sdk_python/models/delete_rdns_record_request_content.py +88 -0
- ha_sdk_python/models/delete_rdns_record_response_content.py +94 -0
- ha_sdk_python/models/delete_snapshot_request_content.py +89 -0
- ha_sdk_python/models/delete_snapshot_response_content.py +94 -0
- ha_sdk_python/models/edit_backup_schedule_request_content.py +110 -0
- ha_sdk_python/models/edit_backup_schedule_response_content.py +94 -0
- ha_sdk_python/models/firewall_list_response_data.py +125 -0
- ha_sdk_python/models/firewall_move_direction.py +39 -0
- ha_sdk_python/models/firewall_move_response_data.py +91 -0
- ha_sdk_python/models/firewall_option.py +89 -0
- ha_sdk_python/models/firewall_rule.py +113 -0
- ha_sdk_python/models/firewall_rule_action.py +38 -0
- ha_sdk_python/models/firewall_rule_type.py +38 -0
- ha_sdk_python/models/forbidden_error_response_content.py +89 -0
- ha_sdk_python/models/get_catalogue_request_content.py +89 -0
- ha_sdk_python/models/get_catalogue_response_content.py +94 -0
- ha_sdk_python/models/get_no_vnc_console_request_content.py +87 -0
- ha_sdk_python/models/get_no_vnc_console_response_content.py +94 -0
- ha_sdk_python/models/get_private_ssh_key_request_content.py +87 -0
- ha_sdk_python/models/get_private_ssh_key_response_content.py +94 -0
- ha_sdk_python/models/get_public_ssh_key_request_content.py +87 -0
- ha_sdk_python/models/get_public_ssh_key_response_content.py +94 -0
- ha_sdk_python/models/get_vps_config_request_content.py +87 -0
- ha_sdk_python/models/get_vps_config_response_content.py +94 -0
- ha_sdk_python/models/get_vps_details_request_content.py +87 -0
- ha_sdk_python/models/get_vps_details_response_content.py +94 -0
- ha_sdk_python/models/internal_service_error_response_content.py +89 -0
- ha_sdk_python/models/invalid_state_error_response_content.py +89 -0
- ha_sdk_python/models/list_backup_schedules_request_content.py +87 -0
- ha_sdk_python/models/list_backup_schedules_response_content.py +94 -0
- ha_sdk_python/models/list_backups_request_content.py +87 -0
- ha_sdk_python/models/list_backups_response_content.py +94 -0
- ha_sdk_python/models/list_firewall_rules_request_content.py +87 -0
- ha_sdk_python/models/list_firewall_rules_response_content.py +94 -0
- ha_sdk_python/models/list_isos_request_content.py +87 -0
- ha_sdk_python/models/list_isos_response_content.py +94 -0
- ha_sdk_python/models/list_isos_response_data.py +89 -0
- ha_sdk_python/models/list_notifications_request_content.py +87 -0
- ha_sdk_python/models/list_notifications_response_content.py +94 -0
- ha_sdk_python/models/list_orders_response_content.py +94 -0
- ha_sdk_python/models/list_orders_response_data.py +95 -0
- ha_sdk_python/models/list_power_tasks_request_content.py +87 -0
- ha_sdk_python/models/list_power_tasks_response_content.py +94 -0
- ha_sdk_python/models/list_rdns_records_response_content.py +94 -0
- ha_sdk_python/models/list_rdns_response_data.py +115 -0
- ha_sdk_python/models/list_reinstall_os_request_content.py +87 -0
- ha_sdk_python/models/list_reinstall_os_response_content.py +94 -0
- ha_sdk_python/models/list_reinstall_os_response_data.py +89 -0
- ha_sdk_python/models/list_snapshots_request_content.py +87 -0
- ha_sdk_python/models/list_snapshots_response_content.py +94 -0
- ha_sdk_python/models/list_vps_services_data.py +95 -0
- ha_sdk_python/models/list_vps_services_response_content.py +94 -0
- ha_sdk_python/models/mount_iso_request_content.py +91 -0
- ha_sdk_python/models/mount_iso_response_content.py +94 -0
- ha_sdk_python/models/move_firewall_rule_request_content.py +94 -0
- ha_sdk_python/models/move_firewall_rule_response_content.py +94 -0
- ha_sdk_python/models/no_vnc_console_details.py +95 -0
- ha_sdk_python/models/no_vnc_console_response_data.py +93 -0
- ha_sdk_python/models/notification.py +105 -0
- ha_sdk_python/models/notification_create_response_data.py +93 -0
- ha_sdk_python/models/notification_dialog_rules.py +95 -0
- ha_sdk_python/models/notification_list_response_data.py +103 -0
- ha_sdk_python/models/notification_status.py +43 -0
- ha_sdk_python/models/operation_status.py +37 -0
- ha_sdk_python/models/order.py +109 -0
- ha_sdk_python/models/order_last_attempt.py +93 -0
- ha_sdk_python/models/order_warning.py +89 -0
- ha_sdk_python/models/payment_error.py +89 -0
- ha_sdk_python/models/payment_status.py +38 -0
- ha_sdk_python/models/power_task.py +105 -0
- ha_sdk_python/models/power_task_action.py +38 -0
- ha_sdk_python/models/power_task_create_response_data.py +93 -0
- ha_sdk_python/models/power_task_dialog_rules.py +95 -0
- ha_sdk_python/models/power_task_job_type.py +38 -0
- ha_sdk_python/models/power_task_list_response_data.py +107 -0
- ha_sdk_python/models/public_ssh_key_response_data.py +93 -0
- ha_sdk_python/models/rdns_available_item.py +111 -0
- ha_sdk_python/models/rdns_pool.py +89 -0
- ha_sdk_python/models/rdns_record.py +109 -0
- ha_sdk_python/models/reboot_vps_request_content.py +87 -0
- ha_sdk_python/models/reboot_vps_response_content.py +94 -0
- ha_sdk_python/models/resource_not_found_error_response_content.py +89 -0
- ha_sdk_python/models/restore_backup_request_content.py +89 -0
- ha_sdk_python/models/restore_backup_response_content.py +94 -0
- ha_sdk_python/models/retry_payment_request_content.py +89 -0
- ha_sdk_python/models/retry_payment_response_content.py +94 -0
- ha_sdk_python/models/retry_payment_response_data.py +98 -0
- ha_sdk_python/models/retry_payment_total.py +91 -0
- ha_sdk_python/models/rollback_snapshot_request_content.py +89 -0
- ha_sdk_python/models/rollback_snapshot_response_content.py +94 -0
- ha_sdk_python/models/service_backups_response_data.py +131 -0
- ha_sdk_python/models/service_snapshots_response_data.py +101 -0
- ha_sdk_python/models/service_unavailable_error_response_content.py +89 -0
- ha_sdk_python/models/shutdown_vps_request_content.py +87 -0
- ha_sdk_python/models/shutdown_vps_response_content.py +94 -0
- ha_sdk_python/models/snapshot_create_response_data.py +89 -0
- ha_sdk_python/models/snapshot_item.py +95 -0
- ha_sdk_python/models/ssh_key_details.py +89 -0
- ha_sdk_python/models/start_vps_request_content.py +87 -0
- ha_sdk_python/models/start_vps_response_content.py +94 -0
- ha_sdk_python/models/stop_vps_request_content.py +87 -0
- ha_sdk_python/models/stop_vps_response_content.py +94 -0
- ha_sdk_python/models/too_many_requests_error_response_content.py +89 -0
- ha_sdk_python/models/trigger_reinstall_request_content.py +89 -0
- ha_sdk_python/models/trigger_reinstall_response_content.py +94 -0
- ha_sdk_python/models/trigger_reinstall_response_data.py +89 -0
- ha_sdk_python/models/unauthorized_error_response_content.py +89 -0
- ha_sdk_python/models/update_firewall_rule_request_content.py +94 -0
- ha_sdk_python/models/update_firewall_rule_response_content.py +94 -0
- ha_sdk_python/models/update_notification_request_content.py +113 -0
- ha_sdk_python/models/update_notification_response_content.py +94 -0
- ha_sdk_python/models/update_power_task_request_content.py +164 -0
- ha_sdk_python/models/update_power_task_response_content.py +94 -0
- ha_sdk_python/models/update_snapshot_request_content.py +91 -0
- ha_sdk_python/models/update_snapshot_response_content.py +94 -0
- ha_sdk_python/models/update_ssh_keys_request_content.py +97 -0
- ha_sdk_python/models/update_ssh_keys_response_content.py +94 -0
- ha_sdk_python/models/update_vps_config_request_content.py +99 -0
- ha_sdk_python/models/update_vps_config_response_content.py +94 -0
- ha_sdk_python/models/user_change_password_details.py +91 -0
- ha_sdk_python/models/user_change_password_request_content.py +92 -0
- ha_sdk_python/models/user_change_password_response_content.py +94 -0
- ha_sdk_python/models/user_change_password_response_data.py +95 -0
- ha_sdk_python/models/validate_pricing_base.py +89 -0
- ha_sdk_python/models/validate_pricing_breakdown.py +103 -0
- ha_sdk_python/models/validate_pricing_config_item.py +116 -0
- ha_sdk_python/models/validate_pricing_currency.py +93 -0
- ha_sdk_python/models/validate_pricing_discount.py +97 -0
- ha_sdk_python/models/validate_pricing_plan_config.py +97 -0
- ha_sdk_python/models/validate_pricing_plan_pricing.py +89 -0
- ha_sdk_python/models/validate_pricing_price_range.py +91 -0
- ha_sdk_python/models/validate_pricing_product.py +101 -0
- ha_sdk_python/models/validate_pricing_product_result.py +121 -0
- ha_sdk_python/models/validate_pricing_prorata.py +95 -0
- ha_sdk_python/models/validate_pricing_request_content.py +97 -0
- ha_sdk_python/models/validate_pricing_response_content.py +94 -0
- ha_sdk_python/models/validate_pricing_response_data.py +109 -0
- ha_sdk_python/models/validate_pricing_summary.py +101 -0
- ha_sdk_python/models/validate_pricing_summary_recurring.py +91 -0
- ha_sdk_python/models/validation_error_response_content.py +89 -0
- ha_sdk_python/models/vps_available_features.py +115 -0
- ha_sdk_python/models/vps_bandwidth_info.py +94 -0
- ha_sdk_python/models/vps_cancel_response_data.py +93 -0
- ha_sdk_python/models/vps_cancel_type.py +37 -0
- ha_sdk_python/models/vps_config_response_data.py +108 -0
- ha_sdk_python/models/vps_cpu_info.py +92 -0
- ha_sdk_python/models/vps_credentials.py +89 -0
- ha_sdk_python/models/vps_details_response.py +143 -0
- ha_sdk_python/models/vps_disk_info.py +96 -0
- ha_sdk_python/models/vps_memory_info.py +96 -0
- ha_sdk_python/models/vps_network_rate.py +92 -0
- ha_sdk_python/models/vps_os_info.py +89 -0
- ha_sdk_python/models/vps_service_info.py +97 -0
- ha_sdk_python/models/vps_simple_action_response_data.py +87 -0
- ha_sdk_python/models/vps_vm_info.py +102 -0
- ha_sdk_python/py.typed +0 -0
- ha_sdk_python/rest.py +263 -0
- ha_sdk_python/retryable_paths.py +26 -0
- ha_sdk_python-1.0.10.dist-info/METADATA +131 -0
- ha_sdk_python-1.0.10.dist-info/RECORD +237 -0
- ha_sdk_python-1.0.10.dist-info/WHEEL +5 -0
- ha_sdk_python-1.0.10.dist-info/licenses/LICENSE +21 -0
- ha_sdk_python-1.0.10.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,2434 @@
|
|
|
1
|
+
"""
|
|
2
|
+
HostAfricaApi
|
|
3
|
+
|
|
4
|
+
HostAfrica API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2026-01-01
|
|
7
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
8
|
+
|
|
9
|
+
Do not edit the class manually.
|
|
10
|
+
""" # noqa: E501
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
import warnings
|
|
14
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
15
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
|
+
from typing_extensions import Annotated
|
|
17
|
+
|
|
18
|
+
from ha_sdk_python.models.create_power_task_request_content import CreatePowerTaskRequestContent
|
|
19
|
+
from ha_sdk_python.models.create_power_task_response_content import CreatePowerTaskResponseContent
|
|
20
|
+
from ha_sdk_python.models.delete_power_task_request_content import DeletePowerTaskRequestContent
|
|
21
|
+
from ha_sdk_python.models.delete_power_task_response_content import DeletePowerTaskResponseContent
|
|
22
|
+
from ha_sdk_python.models.list_power_tasks_request_content import ListPowerTasksRequestContent
|
|
23
|
+
from ha_sdk_python.models.list_power_tasks_response_content import ListPowerTasksResponseContent
|
|
24
|
+
from ha_sdk_python.models.reboot_vps_request_content import RebootVpsRequestContent
|
|
25
|
+
from ha_sdk_python.models.reboot_vps_response_content import RebootVpsResponseContent
|
|
26
|
+
from ha_sdk_python.models.shutdown_vps_request_content import ShutdownVpsRequestContent
|
|
27
|
+
from ha_sdk_python.models.shutdown_vps_response_content import ShutdownVpsResponseContent
|
|
28
|
+
from ha_sdk_python.models.start_vps_request_content import StartVpsRequestContent
|
|
29
|
+
from ha_sdk_python.models.start_vps_response_content import StartVpsResponseContent
|
|
30
|
+
from ha_sdk_python.models.stop_vps_request_content import StopVpsRequestContent
|
|
31
|
+
from ha_sdk_python.models.stop_vps_response_content import StopVpsResponseContent
|
|
32
|
+
from ha_sdk_python.models.update_power_task_request_content import UpdatePowerTaskRequestContent
|
|
33
|
+
from ha_sdk_python.models.update_power_task_response_content import UpdatePowerTaskResponseContent
|
|
34
|
+
|
|
35
|
+
from ha_sdk_python.api_client import ApiClient, RequestSerialized
|
|
36
|
+
from ha_sdk_python.api_response import ApiResponse
|
|
37
|
+
from ha_sdk_python.rest import RESTResponseType
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class PowerManagementApi:
|
|
41
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
42
|
+
Ref: https://openapi-generator.tech
|
|
43
|
+
|
|
44
|
+
Do not edit the class manually.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
def __init__(self, api_client=None) -> None:
|
|
48
|
+
if api_client is None:
|
|
49
|
+
api_client = ApiClient.get_default()
|
|
50
|
+
self.api_client = api_client
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@validate_call
|
|
54
|
+
def create_power_task(
|
|
55
|
+
self,
|
|
56
|
+
create_power_task_request_content: CreatePowerTaskRequestContent,
|
|
57
|
+
_request_timeout: Union[
|
|
58
|
+
None,
|
|
59
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
60
|
+
Tuple[
|
|
61
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
62
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
63
|
+
]
|
|
64
|
+
] = None,
|
|
65
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
66
|
+
_content_type: Optional[StrictStr] = None,
|
|
67
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
68
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
69
|
+
) -> CreatePowerTaskResponseContent:
|
|
70
|
+
"""create_power_task
|
|
71
|
+
|
|
72
|
+
Creates a new power task (scheduled start/stop/restart operation) for a VPS service
|
|
73
|
+
|
|
74
|
+
:param create_power_task_request_content: (required)
|
|
75
|
+
:type create_power_task_request_content: CreatePowerTaskRequestContent
|
|
76
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
77
|
+
number provided, it will be total request
|
|
78
|
+
timeout. It can also be a pair (tuple) of
|
|
79
|
+
(connection, read) timeouts.
|
|
80
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
81
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
82
|
+
request; this effectively ignores the
|
|
83
|
+
authentication in the spec for a single request.
|
|
84
|
+
:type _request_auth: dict, optional
|
|
85
|
+
:param _content_type: force content-type for the request.
|
|
86
|
+
:type _content_type: str, Optional
|
|
87
|
+
:param _headers: set to override the headers for a single
|
|
88
|
+
request; this effectively ignores the headers
|
|
89
|
+
in the spec for a single request.
|
|
90
|
+
:type _headers: dict, optional
|
|
91
|
+
:param _host_index: set to override the host_index for a single
|
|
92
|
+
request; this effectively ignores the host_index
|
|
93
|
+
in the spec for a single request.
|
|
94
|
+
:type _host_index: int, optional
|
|
95
|
+
:return: Returns the result object.
|
|
96
|
+
""" # noqa: E501
|
|
97
|
+
|
|
98
|
+
_param = self._create_power_task_serialize(
|
|
99
|
+
create_power_task_request_content=create_power_task_request_content,
|
|
100
|
+
_request_auth=_request_auth,
|
|
101
|
+
_content_type=_content_type,
|
|
102
|
+
_headers=_headers,
|
|
103
|
+
_host_index=_host_index
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
107
|
+
'200': "CreatePowerTaskResponseContent",
|
|
108
|
+
'400': "BadRequestErrorResponseContent",
|
|
109
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
110
|
+
'403': "ForbiddenErrorResponseContent",
|
|
111
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
112
|
+
'422': "ValidationErrorResponseContent",
|
|
113
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
114
|
+
'500': "InternalServiceErrorResponseContent",
|
|
115
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
116
|
+
}
|
|
117
|
+
response_data = self.api_client.call_api(
|
|
118
|
+
*_param,
|
|
119
|
+
_request_timeout=_request_timeout
|
|
120
|
+
)
|
|
121
|
+
response_data.read()
|
|
122
|
+
return self.api_client.response_deserialize(
|
|
123
|
+
response_data=response_data,
|
|
124
|
+
response_types_map=_response_types_map,
|
|
125
|
+
).data
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
@validate_call
|
|
129
|
+
def create_power_task_with_http_info(
|
|
130
|
+
self,
|
|
131
|
+
create_power_task_request_content: CreatePowerTaskRequestContent,
|
|
132
|
+
_request_timeout: Union[
|
|
133
|
+
None,
|
|
134
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
135
|
+
Tuple[
|
|
136
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
137
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
138
|
+
]
|
|
139
|
+
] = None,
|
|
140
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
141
|
+
_content_type: Optional[StrictStr] = None,
|
|
142
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
143
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
144
|
+
) -> ApiResponse[CreatePowerTaskResponseContent]:
|
|
145
|
+
"""create_power_task
|
|
146
|
+
|
|
147
|
+
Creates a new power task (scheduled start/stop/restart operation) for a VPS service
|
|
148
|
+
|
|
149
|
+
:param create_power_task_request_content: (required)
|
|
150
|
+
:type create_power_task_request_content: CreatePowerTaskRequestContent
|
|
151
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
152
|
+
number provided, it will be total request
|
|
153
|
+
timeout. It can also be a pair (tuple) of
|
|
154
|
+
(connection, read) timeouts.
|
|
155
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
156
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
157
|
+
request; this effectively ignores the
|
|
158
|
+
authentication in the spec for a single request.
|
|
159
|
+
:type _request_auth: dict, optional
|
|
160
|
+
:param _content_type: force content-type for the request.
|
|
161
|
+
:type _content_type: str, Optional
|
|
162
|
+
:param _headers: set to override the headers for a single
|
|
163
|
+
request; this effectively ignores the headers
|
|
164
|
+
in the spec for a single request.
|
|
165
|
+
:type _headers: dict, optional
|
|
166
|
+
:param _host_index: set to override the host_index for a single
|
|
167
|
+
request; this effectively ignores the host_index
|
|
168
|
+
in the spec for a single request.
|
|
169
|
+
:type _host_index: int, optional
|
|
170
|
+
:return: Returns the result object.
|
|
171
|
+
""" # noqa: E501
|
|
172
|
+
|
|
173
|
+
_param = self._create_power_task_serialize(
|
|
174
|
+
create_power_task_request_content=create_power_task_request_content,
|
|
175
|
+
_request_auth=_request_auth,
|
|
176
|
+
_content_type=_content_type,
|
|
177
|
+
_headers=_headers,
|
|
178
|
+
_host_index=_host_index
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
182
|
+
'200': "CreatePowerTaskResponseContent",
|
|
183
|
+
'400': "BadRequestErrorResponseContent",
|
|
184
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
185
|
+
'403': "ForbiddenErrorResponseContent",
|
|
186
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
187
|
+
'422': "ValidationErrorResponseContent",
|
|
188
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
189
|
+
'500': "InternalServiceErrorResponseContent",
|
|
190
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
191
|
+
}
|
|
192
|
+
response_data = self.api_client.call_api(
|
|
193
|
+
*_param,
|
|
194
|
+
_request_timeout=_request_timeout
|
|
195
|
+
)
|
|
196
|
+
response_data.read()
|
|
197
|
+
return self.api_client.response_deserialize(
|
|
198
|
+
response_data=response_data,
|
|
199
|
+
response_types_map=_response_types_map,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
@validate_call
|
|
204
|
+
def create_power_task_without_preload_content(
|
|
205
|
+
self,
|
|
206
|
+
create_power_task_request_content: CreatePowerTaskRequestContent,
|
|
207
|
+
_request_timeout: Union[
|
|
208
|
+
None,
|
|
209
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
210
|
+
Tuple[
|
|
211
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
212
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
213
|
+
]
|
|
214
|
+
] = None,
|
|
215
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
216
|
+
_content_type: Optional[StrictStr] = None,
|
|
217
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
218
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
219
|
+
) -> RESTResponseType:
|
|
220
|
+
"""create_power_task
|
|
221
|
+
|
|
222
|
+
Creates a new power task (scheduled start/stop/restart operation) for a VPS service
|
|
223
|
+
|
|
224
|
+
:param create_power_task_request_content: (required)
|
|
225
|
+
:type create_power_task_request_content: CreatePowerTaskRequestContent
|
|
226
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
227
|
+
number provided, it will be total request
|
|
228
|
+
timeout. It can also be a pair (tuple) of
|
|
229
|
+
(connection, read) timeouts.
|
|
230
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
231
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
232
|
+
request; this effectively ignores the
|
|
233
|
+
authentication in the spec for a single request.
|
|
234
|
+
:type _request_auth: dict, optional
|
|
235
|
+
:param _content_type: force content-type for the request.
|
|
236
|
+
:type _content_type: str, Optional
|
|
237
|
+
:param _headers: set to override the headers for a single
|
|
238
|
+
request; this effectively ignores the headers
|
|
239
|
+
in the spec for a single request.
|
|
240
|
+
:type _headers: dict, optional
|
|
241
|
+
:param _host_index: set to override the host_index for a single
|
|
242
|
+
request; this effectively ignores the host_index
|
|
243
|
+
in the spec for a single request.
|
|
244
|
+
:type _host_index: int, optional
|
|
245
|
+
:return: Returns the result object.
|
|
246
|
+
""" # noqa: E501
|
|
247
|
+
|
|
248
|
+
_param = self._create_power_task_serialize(
|
|
249
|
+
create_power_task_request_content=create_power_task_request_content,
|
|
250
|
+
_request_auth=_request_auth,
|
|
251
|
+
_content_type=_content_type,
|
|
252
|
+
_headers=_headers,
|
|
253
|
+
_host_index=_host_index
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
257
|
+
'200': "CreatePowerTaskResponseContent",
|
|
258
|
+
'400': "BadRequestErrorResponseContent",
|
|
259
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
260
|
+
'403': "ForbiddenErrorResponseContent",
|
|
261
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
262
|
+
'422': "ValidationErrorResponseContent",
|
|
263
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
264
|
+
'500': "InternalServiceErrorResponseContent",
|
|
265
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
266
|
+
}
|
|
267
|
+
response_data = self.api_client.call_api(
|
|
268
|
+
*_param,
|
|
269
|
+
_request_timeout=_request_timeout
|
|
270
|
+
)
|
|
271
|
+
return response_data.response
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
def _create_power_task_serialize(
|
|
275
|
+
self,
|
|
276
|
+
create_power_task_request_content,
|
|
277
|
+
_request_auth,
|
|
278
|
+
_content_type,
|
|
279
|
+
_headers,
|
|
280
|
+
_host_index,
|
|
281
|
+
) -> RequestSerialized:
|
|
282
|
+
|
|
283
|
+
_host = None
|
|
284
|
+
|
|
285
|
+
_collection_formats: Dict[str, str] = {
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
_path_params: Dict[str, str] = {}
|
|
289
|
+
_query_params: List[Tuple[str, str]] = []
|
|
290
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
291
|
+
_form_params: List[Tuple[str, str]] = []
|
|
292
|
+
_files: Dict[
|
|
293
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
294
|
+
] = {}
|
|
295
|
+
_body_params: Optional[bytes] = None
|
|
296
|
+
|
|
297
|
+
# process the path parameters
|
|
298
|
+
# process the query parameters
|
|
299
|
+
# process the header parameters
|
|
300
|
+
# process the form parameters
|
|
301
|
+
# process the body parameter
|
|
302
|
+
if create_power_task_request_content is not None:
|
|
303
|
+
_body_params = create_power_task_request_content
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
# set the HTTP header `Accept`
|
|
307
|
+
if 'Accept' not in _header_params:
|
|
308
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
309
|
+
[
|
|
310
|
+
'application/json'
|
|
311
|
+
]
|
|
312
|
+
)
|
|
313
|
+
|
|
314
|
+
# set the HTTP header `Content-Type`
|
|
315
|
+
if _content_type:
|
|
316
|
+
_header_params['Content-Type'] = _content_type
|
|
317
|
+
else:
|
|
318
|
+
_default_content_type = (
|
|
319
|
+
self.api_client.select_header_content_type(
|
|
320
|
+
[
|
|
321
|
+
'application/json'
|
|
322
|
+
]
|
|
323
|
+
)
|
|
324
|
+
)
|
|
325
|
+
if _default_content_type is not None:
|
|
326
|
+
_header_params['Content-Type'] = _default_content_type
|
|
327
|
+
|
|
328
|
+
# authentication setting
|
|
329
|
+
_auth_settings: List[str] = [
|
|
330
|
+
'BearerAuth'
|
|
331
|
+
]
|
|
332
|
+
|
|
333
|
+
return self.api_client.param_serialize(
|
|
334
|
+
method='POST',
|
|
335
|
+
resource_path='/vps/create-power-task',
|
|
336
|
+
path_params=_path_params,
|
|
337
|
+
query_params=_query_params,
|
|
338
|
+
header_params=_header_params,
|
|
339
|
+
body=_body_params,
|
|
340
|
+
post_params=_form_params,
|
|
341
|
+
files=_files,
|
|
342
|
+
auth_settings=_auth_settings,
|
|
343
|
+
collection_formats=_collection_formats,
|
|
344
|
+
_host=_host,
|
|
345
|
+
_request_auth=_request_auth
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
@validate_call
|
|
352
|
+
def delete_power_task(
|
|
353
|
+
self,
|
|
354
|
+
delete_power_task_request_content: DeletePowerTaskRequestContent,
|
|
355
|
+
_request_timeout: Union[
|
|
356
|
+
None,
|
|
357
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
358
|
+
Tuple[
|
|
359
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
360
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
361
|
+
]
|
|
362
|
+
] = None,
|
|
363
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
364
|
+
_content_type: Optional[StrictStr] = None,
|
|
365
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
366
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
367
|
+
) -> DeletePowerTaskResponseContent:
|
|
368
|
+
"""delete_power_task
|
|
369
|
+
|
|
370
|
+
Deletes a power task from a VPS service
|
|
371
|
+
|
|
372
|
+
:param delete_power_task_request_content: (required)
|
|
373
|
+
:type delete_power_task_request_content: DeletePowerTaskRequestContent
|
|
374
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
375
|
+
number provided, it will be total request
|
|
376
|
+
timeout. It can also be a pair (tuple) of
|
|
377
|
+
(connection, read) timeouts.
|
|
378
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
379
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
380
|
+
request; this effectively ignores the
|
|
381
|
+
authentication in the spec for a single request.
|
|
382
|
+
:type _request_auth: dict, optional
|
|
383
|
+
:param _content_type: force content-type for the request.
|
|
384
|
+
:type _content_type: str, Optional
|
|
385
|
+
:param _headers: set to override the headers for a single
|
|
386
|
+
request; this effectively ignores the headers
|
|
387
|
+
in the spec for a single request.
|
|
388
|
+
:type _headers: dict, optional
|
|
389
|
+
:param _host_index: set to override the host_index for a single
|
|
390
|
+
request; this effectively ignores the host_index
|
|
391
|
+
in the spec for a single request.
|
|
392
|
+
:type _host_index: int, optional
|
|
393
|
+
:return: Returns the result object.
|
|
394
|
+
""" # noqa: E501
|
|
395
|
+
|
|
396
|
+
_param = self._delete_power_task_serialize(
|
|
397
|
+
delete_power_task_request_content=delete_power_task_request_content,
|
|
398
|
+
_request_auth=_request_auth,
|
|
399
|
+
_content_type=_content_type,
|
|
400
|
+
_headers=_headers,
|
|
401
|
+
_host_index=_host_index
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
405
|
+
'200': "DeletePowerTaskResponseContent",
|
|
406
|
+
'400': "BadRequestErrorResponseContent",
|
|
407
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
408
|
+
'403': "ForbiddenErrorResponseContent",
|
|
409
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
410
|
+
'422': "ValidationErrorResponseContent",
|
|
411
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
412
|
+
'500': "InternalServiceErrorResponseContent",
|
|
413
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
414
|
+
}
|
|
415
|
+
response_data = self.api_client.call_api(
|
|
416
|
+
*_param,
|
|
417
|
+
_request_timeout=_request_timeout
|
|
418
|
+
)
|
|
419
|
+
response_data.read()
|
|
420
|
+
return self.api_client.response_deserialize(
|
|
421
|
+
response_data=response_data,
|
|
422
|
+
response_types_map=_response_types_map,
|
|
423
|
+
).data
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
@validate_call
|
|
427
|
+
def delete_power_task_with_http_info(
|
|
428
|
+
self,
|
|
429
|
+
delete_power_task_request_content: DeletePowerTaskRequestContent,
|
|
430
|
+
_request_timeout: Union[
|
|
431
|
+
None,
|
|
432
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
433
|
+
Tuple[
|
|
434
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
435
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
436
|
+
]
|
|
437
|
+
] = None,
|
|
438
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
439
|
+
_content_type: Optional[StrictStr] = None,
|
|
440
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
441
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
442
|
+
) -> ApiResponse[DeletePowerTaskResponseContent]:
|
|
443
|
+
"""delete_power_task
|
|
444
|
+
|
|
445
|
+
Deletes a power task from a VPS service
|
|
446
|
+
|
|
447
|
+
:param delete_power_task_request_content: (required)
|
|
448
|
+
:type delete_power_task_request_content: DeletePowerTaskRequestContent
|
|
449
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
450
|
+
number provided, it will be total request
|
|
451
|
+
timeout. It can also be a pair (tuple) of
|
|
452
|
+
(connection, read) timeouts.
|
|
453
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
454
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
455
|
+
request; this effectively ignores the
|
|
456
|
+
authentication in the spec for a single request.
|
|
457
|
+
:type _request_auth: dict, optional
|
|
458
|
+
:param _content_type: force content-type for the request.
|
|
459
|
+
:type _content_type: str, Optional
|
|
460
|
+
:param _headers: set to override the headers for a single
|
|
461
|
+
request; this effectively ignores the headers
|
|
462
|
+
in the spec for a single request.
|
|
463
|
+
:type _headers: dict, optional
|
|
464
|
+
:param _host_index: set to override the host_index for a single
|
|
465
|
+
request; this effectively ignores the host_index
|
|
466
|
+
in the spec for a single request.
|
|
467
|
+
:type _host_index: int, optional
|
|
468
|
+
:return: Returns the result object.
|
|
469
|
+
""" # noqa: E501
|
|
470
|
+
|
|
471
|
+
_param = self._delete_power_task_serialize(
|
|
472
|
+
delete_power_task_request_content=delete_power_task_request_content,
|
|
473
|
+
_request_auth=_request_auth,
|
|
474
|
+
_content_type=_content_type,
|
|
475
|
+
_headers=_headers,
|
|
476
|
+
_host_index=_host_index
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
480
|
+
'200': "DeletePowerTaskResponseContent",
|
|
481
|
+
'400': "BadRequestErrorResponseContent",
|
|
482
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
483
|
+
'403': "ForbiddenErrorResponseContent",
|
|
484
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
485
|
+
'422': "ValidationErrorResponseContent",
|
|
486
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
487
|
+
'500': "InternalServiceErrorResponseContent",
|
|
488
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
489
|
+
}
|
|
490
|
+
response_data = self.api_client.call_api(
|
|
491
|
+
*_param,
|
|
492
|
+
_request_timeout=_request_timeout
|
|
493
|
+
)
|
|
494
|
+
response_data.read()
|
|
495
|
+
return self.api_client.response_deserialize(
|
|
496
|
+
response_data=response_data,
|
|
497
|
+
response_types_map=_response_types_map,
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
@validate_call
|
|
502
|
+
def delete_power_task_without_preload_content(
|
|
503
|
+
self,
|
|
504
|
+
delete_power_task_request_content: DeletePowerTaskRequestContent,
|
|
505
|
+
_request_timeout: Union[
|
|
506
|
+
None,
|
|
507
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
508
|
+
Tuple[
|
|
509
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
510
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
511
|
+
]
|
|
512
|
+
] = None,
|
|
513
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
514
|
+
_content_type: Optional[StrictStr] = None,
|
|
515
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
516
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
517
|
+
) -> RESTResponseType:
|
|
518
|
+
"""delete_power_task
|
|
519
|
+
|
|
520
|
+
Deletes a power task from a VPS service
|
|
521
|
+
|
|
522
|
+
:param delete_power_task_request_content: (required)
|
|
523
|
+
:type delete_power_task_request_content: DeletePowerTaskRequestContent
|
|
524
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
525
|
+
number provided, it will be total request
|
|
526
|
+
timeout. It can also be a pair (tuple) of
|
|
527
|
+
(connection, read) timeouts.
|
|
528
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
529
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
530
|
+
request; this effectively ignores the
|
|
531
|
+
authentication in the spec for a single request.
|
|
532
|
+
:type _request_auth: dict, optional
|
|
533
|
+
:param _content_type: force content-type for the request.
|
|
534
|
+
:type _content_type: str, Optional
|
|
535
|
+
:param _headers: set to override the headers for a single
|
|
536
|
+
request; this effectively ignores the headers
|
|
537
|
+
in the spec for a single request.
|
|
538
|
+
:type _headers: dict, optional
|
|
539
|
+
:param _host_index: set to override the host_index for a single
|
|
540
|
+
request; this effectively ignores the host_index
|
|
541
|
+
in the spec for a single request.
|
|
542
|
+
:type _host_index: int, optional
|
|
543
|
+
:return: Returns the result object.
|
|
544
|
+
""" # noqa: E501
|
|
545
|
+
|
|
546
|
+
_param = self._delete_power_task_serialize(
|
|
547
|
+
delete_power_task_request_content=delete_power_task_request_content,
|
|
548
|
+
_request_auth=_request_auth,
|
|
549
|
+
_content_type=_content_type,
|
|
550
|
+
_headers=_headers,
|
|
551
|
+
_host_index=_host_index
|
|
552
|
+
)
|
|
553
|
+
|
|
554
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
555
|
+
'200': "DeletePowerTaskResponseContent",
|
|
556
|
+
'400': "BadRequestErrorResponseContent",
|
|
557
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
558
|
+
'403': "ForbiddenErrorResponseContent",
|
|
559
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
560
|
+
'422': "ValidationErrorResponseContent",
|
|
561
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
562
|
+
'500': "InternalServiceErrorResponseContent",
|
|
563
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
564
|
+
}
|
|
565
|
+
response_data = self.api_client.call_api(
|
|
566
|
+
*_param,
|
|
567
|
+
_request_timeout=_request_timeout
|
|
568
|
+
)
|
|
569
|
+
return response_data.response
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
def _delete_power_task_serialize(
|
|
573
|
+
self,
|
|
574
|
+
delete_power_task_request_content,
|
|
575
|
+
_request_auth,
|
|
576
|
+
_content_type,
|
|
577
|
+
_headers,
|
|
578
|
+
_host_index,
|
|
579
|
+
) -> RequestSerialized:
|
|
580
|
+
|
|
581
|
+
_host = None
|
|
582
|
+
|
|
583
|
+
_collection_formats: Dict[str, str] = {
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
_path_params: Dict[str, str] = {}
|
|
587
|
+
_query_params: List[Tuple[str, str]] = []
|
|
588
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
589
|
+
_form_params: List[Tuple[str, str]] = []
|
|
590
|
+
_files: Dict[
|
|
591
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
592
|
+
] = {}
|
|
593
|
+
_body_params: Optional[bytes] = None
|
|
594
|
+
|
|
595
|
+
# process the path parameters
|
|
596
|
+
# process the query parameters
|
|
597
|
+
# process the header parameters
|
|
598
|
+
# process the form parameters
|
|
599
|
+
# process the body parameter
|
|
600
|
+
if delete_power_task_request_content is not None:
|
|
601
|
+
_body_params = delete_power_task_request_content
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
# set the HTTP header `Accept`
|
|
605
|
+
if 'Accept' not in _header_params:
|
|
606
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
607
|
+
[
|
|
608
|
+
'application/json'
|
|
609
|
+
]
|
|
610
|
+
)
|
|
611
|
+
|
|
612
|
+
# set the HTTP header `Content-Type`
|
|
613
|
+
if _content_type:
|
|
614
|
+
_header_params['Content-Type'] = _content_type
|
|
615
|
+
else:
|
|
616
|
+
_default_content_type = (
|
|
617
|
+
self.api_client.select_header_content_type(
|
|
618
|
+
[
|
|
619
|
+
'application/json'
|
|
620
|
+
]
|
|
621
|
+
)
|
|
622
|
+
)
|
|
623
|
+
if _default_content_type is not None:
|
|
624
|
+
_header_params['Content-Type'] = _default_content_type
|
|
625
|
+
|
|
626
|
+
# authentication setting
|
|
627
|
+
_auth_settings: List[str] = [
|
|
628
|
+
'BearerAuth'
|
|
629
|
+
]
|
|
630
|
+
|
|
631
|
+
return self.api_client.param_serialize(
|
|
632
|
+
method='POST',
|
|
633
|
+
resource_path='/vps/delete-power-task',
|
|
634
|
+
path_params=_path_params,
|
|
635
|
+
query_params=_query_params,
|
|
636
|
+
header_params=_header_params,
|
|
637
|
+
body=_body_params,
|
|
638
|
+
post_params=_form_params,
|
|
639
|
+
files=_files,
|
|
640
|
+
auth_settings=_auth_settings,
|
|
641
|
+
collection_formats=_collection_formats,
|
|
642
|
+
_host=_host,
|
|
643
|
+
_request_auth=_request_auth
|
|
644
|
+
)
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
@validate_call
|
|
650
|
+
def list_power_tasks(
|
|
651
|
+
self,
|
|
652
|
+
list_power_tasks_request_content: ListPowerTasksRequestContent,
|
|
653
|
+
_request_timeout: Union[
|
|
654
|
+
None,
|
|
655
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
656
|
+
Tuple[
|
|
657
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
658
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
659
|
+
]
|
|
660
|
+
] = None,
|
|
661
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
662
|
+
_content_type: Optional[StrictStr] = None,
|
|
663
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
664
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
665
|
+
) -> ListPowerTasksResponseContent:
|
|
666
|
+
"""list_power_tasks
|
|
667
|
+
|
|
668
|
+
Retrieves the list of power tasks (scheduled start/stop/restart operations) for a VPS service
|
|
669
|
+
|
|
670
|
+
:param list_power_tasks_request_content: (required)
|
|
671
|
+
:type list_power_tasks_request_content: ListPowerTasksRequestContent
|
|
672
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
673
|
+
number provided, it will be total request
|
|
674
|
+
timeout. It can also be a pair (tuple) of
|
|
675
|
+
(connection, read) timeouts.
|
|
676
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
677
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
678
|
+
request; this effectively ignores the
|
|
679
|
+
authentication in the spec for a single request.
|
|
680
|
+
:type _request_auth: dict, optional
|
|
681
|
+
:param _content_type: force content-type for the request.
|
|
682
|
+
:type _content_type: str, Optional
|
|
683
|
+
:param _headers: set to override the headers for a single
|
|
684
|
+
request; this effectively ignores the headers
|
|
685
|
+
in the spec for a single request.
|
|
686
|
+
:type _headers: dict, optional
|
|
687
|
+
:param _host_index: set to override the host_index for a single
|
|
688
|
+
request; this effectively ignores the host_index
|
|
689
|
+
in the spec for a single request.
|
|
690
|
+
:type _host_index: int, optional
|
|
691
|
+
:return: Returns the result object.
|
|
692
|
+
""" # noqa: E501
|
|
693
|
+
|
|
694
|
+
_param = self._list_power_tasks_serialize(
|
|
695
|
+
list_power_tasks_request_content=list_power_tasks_request_content,
|
|
696
|
+
_request_auth=_request_auth,
|
|
697
|
+
_content_type=_content_type,
|
|
698
|
+
_headers=_headers,
|
|
699
|
+
_host_index=_host_index
|
|
700
|
+
)
|
|
701
|
+
|
|
702
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
703
|
+
'200': "ListPowerTasksResponseContent",
|
|
704
|
+
'400': "BadRequestErrorResponseContent",
|
|
705
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
706
|
+
'403': "ForbiddenErrorResponseContent",
|
|
707
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
708
|
+
'422': "ValidationErrorResponseContent",
|
|
709
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
710
|
+
'500': "InternalServiceErrorResponseContent",
|
|
711
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
712
|
+
}
|
|
713
|
+
response_data = self.api_client.call_api(
|
|
714
|
+
*_param,
|
|
715
|
+
_request_timeout=_request_timeout
|
|
716
|
+
)
|
|
717
|
+
response_data.read()
|
|
718
|
+
return self.api_client.response_deserialize(
|
|
719
|
+
response_data=response_data,
|
|
720
|
+
response_types_map=_response_types_map,
|
|
721
|
+
).data
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
@validate_call
|
|
725
|
+
def list_power_tasks_with_http_info(
|
|
726
|
+
self,
|
|
727
|
+
list_power_tasks_request_content: ListPowerTasksRequestContent,
|
|
728
|
+
_request_timeout: Union[
|
|
729
|
+
None,
|
|
730
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
731
|
+
Tuple[
|
|
732
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
733
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
734
|
+
]
|
|
735
|
+
] = None,
|
|
736
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
737
|
+
_content_type: Optional[StrictStr] = None,
|
|
738
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
739
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
740
|
+
) -> ApiResponse[ListPowerTasksResponseContent]:
|
|
741
|
+
"""list_power_tasks
|
|
742
|
+
|
|
743
|
+
Retrieves the list of power tasks (scheduled start/stop/restart operations) for a VPS service
|
|
744
|
+
|
|
745
|
+
:param list_power_tasks_request_content: (required)
|
|
746
|
+
:type list_power_tasks_request_content: ListPowerTasksRequestContent
|
|
747
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
748
|
+
number provided, it will be total request
|
|
749
|
+
timeout. It can also be a pair (tuple) of
|
|
750
|
+
(connection, read) timeouts.
|
|
751
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
752
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
753
|
+
request; this effectively ignores the
|
|
754
|
+
authentication in the spec for a single request.
|
|
755
|
+
:type _request_auth: dict, optional
|
|
756
|
+
:param _content_type: force content-type for the request.
|
|
757
|
+
:type _content_type: str, Optional
|
|
758
|
+
:param _headers: set to override the headers for a single
|
|
759
|
+
request; this effectively ignores the headers
|
|
760
|
+
in the spec for a single request.
|
|
761
|
+
:type _headers: dict, optional
|
|
762
|
+
:param _host_index: set to override the host_index for a single
|
|
763
|
+
request; this effectively ignores the host_index
|
|
764
|
+
in the spec for a single request.
|
|
765
|
+
:type _host_index: int, optional
|
|
766
|
+
:return: Returns the result object.
|
|
767
|
+
""" # noqa: E501
|
|
768
|
+
|
|
769
|
+
_param = self._list_power_tasks_serialize(
|
|
770
|
+
list_power_tasks_request_content=list_power_tasks_request_content,
|
|
771
|
+
_request_auth=_request_auth,
|
|
772
|
+
_content_type=_content_type,
|
|
773
|
+
_headers=_headers,
|
|
774
|
+
_host_index=_host_index
|
|
775
|
+
)
|
|
776
|
+
|
|
777
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
778
|
+
'200': "ListPowerTasksResponseContent",
|
|
779
|
+
'400': "BadRequestErrorResponseContent",
|
|
780
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
781
|
+
'403': "ForbiddenErrorResponseContent",
|
|
782
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
783
|
+
'422': "ValidationErrorResponseContent",
|
|
784
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
785
|
+
'500': "InternalServiceErrorResponseContent",
|
|
786
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
787
|
+
}
|
|
788
|
+
response_data = self.api_client.call_api(
|
|
789
|
+
*_param,
|
|
790
|
+
_request_timeout=_request_timeout
|
|
791
|
+
)
|
|
792
|
+
response_data.read()
|
|
793
|
+
return self.api_client.response_deserialize(
|
|
794
|
+
response_data=response_data,
|
|
795
|
+
response_types_map=_response_types_map,
|
|
796
|
+
)
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
@validate_call
|
|
800
|
+
def list_power_tasks_without_preload_content(
|
|
801
|
+
self,
|
|
802
|
+
list_power_tasks_request_content: ListPowerTasksRequestContent,
|
|
803
|
+
_request_timeout: Union[
|
|
804
|
+
None,
|
|
805
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
806
|
+
Tuple[
|
|
807
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
808
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
809
|
+
]
|
|
810
|
+
] = None,
|
|
811
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
812
|
+
_content_type: Optional[StrictStr] = None,
|
|
813
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
814
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
815
|
+
) -> RESTResponseType:
|
|
816
|
+
"""list_power_tasks
|
|
817
|
+
|
|
818
|
+
Retrieves the list of power tasks (scheduled start/stop/restart operations) for a VPS service
|
|
819
|
+
|
|
820
|
+
:param list_power_tasks_request_content: (required)
|
|
821
|
+
:type list_power_tasks_request_content: ListPowerTasksRequestContent
|
|
822
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
823
|
+
number provided, it will be total request
|
|
824
|
+
timeout. It can also be a pair (tuple) of
|
|
825
|
+
(connection, read) timeouts.
|
|
826
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
827
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
828
|
+
request; this effectively ignores the
|
|
829
|
+
authentication in the spec for a single request.
|
|
830
|
+
:type _request_auth: dict, optional
|
|
831
|
+
:param _content_type: force content-type for the request.
|
|
832
|
+
:type _content_type: str, Optional
|
|
833
|
+
:param _headers: set to override the headers for a single
|
|
834
|
+
request; this effectively ignores the headers
|
|
835
|
+
in the spec for a single request.
|
|
836
|
+
:type _headers: dict, optional
|
|
837
|
+
:param _host_index: set to override the host_index for a single
|
|
838
|
+
request; this effectively ignores the host_index
|
|
839
|
+
in the spec for a single request.
|
|
840
|
+
:type _host_index: int, optional
|
|
841
|
+
:return: Returns the result object.
|
|
842
|
+
""" # noqa: E501
|
|
843
|
+
|
|
844
|
+
_param = self._list_power_tasks_serialize(
|
|
845
|
+
list_power_tasks_request_content=list_power_tasks_request_content,
|
|
846
|
+
_request_auth=_request_auth,
|
|
847
|
+
_content_type=_content_type,
|
|
848
|
+
_headers=_headers,
|
|
849
|
+
_host_index=_host_index
|
|
850
|
+
)
|
|
851
|
+
|
|
852
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
853
|
+
'200': "ListPowerTasksResponseContent",
|
|
854
|
+
'400': "BadRequestErrorResponseContent",
|
|
855
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
856
|
+
'403': "ForbiddenErrorResponseContent",
|
|
857
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
858
|
+
'422': "ValidationErrorResponseContent",
|
|
859
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
860
|
+
'500': "InternalServiceErrorResponseContent",
|
|
861
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
862
|
+
}
|
|
863
|
+
response_data = self.api_client.call_api(
|
|
864
|
+
*_param,
|
|
865
|
+
_request_timeout=_request_timeout
|
|
866
|
+
)
|
|
867
|
+
return response_data.response
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
def _list_power_tasks_serialize(
|
|
871
|
+
self,
|
|
872
|
+
list_power_tasks_request_content,
|
|
873
|
+
_request_auth,
|
|
874
|
+
_content_type,
|
|
875
|
+
_headers,
|
|
876
|
+
_host_index,
|
|
877
|
+
) -> RequestSerialized:
|
|
878
|
+
|
|
879
|
+
_host = None
|
|
880
|
+
|
|
881
|
+
_collection_formats: Dict[str, str] = {
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
_path_params: Dict[str, str] = {}
|
|
885
|
+
_query_params: List[Tuple[str, str]] = []
|
|
886
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
887
|
+
_form_params: List[Tuple[str, str]] = []
|
|
888
|
+
_files: Dict[
|
|
889
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
890
|
+
] = {}
|
|
891
|
+
_body_params: Optional[bytes] = None
|
|
892
|
+
|
|
893
|
+
# process the path parameters
|
|
894
|
+
# process the query parameters
|
|
895
|
+
# process the header parameters
|
|
896
|
+
# process the form parameters
|
|
897
|
+
# process the body parameter
|
|
898
|
+
if list_power_tasks_request_content is not None:
|
|
899
|
+
_body_params = list_power_tasks_request_content
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
# set the HTTP header `Accept`
|
|
903
|
+
if 'Accept' not in _header_params:
|
|
904
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
905
|
+
[
|
|
906
|
+
'application/json'
|
|
907
|
+
]
|
|
908
|
+
)
|
|
909
|
+
|
|
910
|
+
# set the HTTP header `Content-Type`
|
|
911
|
+
if _content_type:
|
|
912
|
+
_header_params['Content-Type'] = _content_type
|
|
913
|
+
else:
|
|
914
|
+
_default_content_type = (
|
|
915
|
+
self.api_client.select_header_content_type(
|
|
916
|
+
[
|
|
917
|
+
'application/json'
|
|
918
|
+
]
|
|
919
|
+
)
|
|
920
|
+
)
|
|
921
|
+
if _default_content_type is not None:
|
|
922
|
+
_header_params['Content-Type'] = _default_content_type
|
|
923
|
+
|
|
924
|
+
# authentication setting
|
|
925
|
+
_auth_settings: List[str] = [
|
|
926
|
+
'BearerAuth'
|
|
927
|
+
]
|
|
928
|
+
|
|
929
|
+
return self.api_client.param_serialize(
|
|
930
|
+
method='POST',
|
|
931
|
+
resource_path='/vps/list-power-tasks',
|
|
932
|
+
path_params=_path_params,
|
|
933
|
+
query_params=_query_params,
|
|
934
|
+
header_params=_header_params,
|
|
935
|
+
body=_body_params,
|
|
936
|
+
post_params=_form_params,
|
|
937
|
+
files=_files,
|
|
938
|
+
auth_settings=_auth_settings,
|
|
939
|
+
collection_formats=_collection_formats,
|
|
940
|
+
_host=_host,
|
|
941
|
+
_request_auth=_request_auth
|
|
942
|
+
)
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
@validate_call
|
|
948
|
+
def reboot_vps(
|
|
949
|
+
self,
|
|
950
|
+
reboot_vps_request_content: RebootVpsRequestContent,
|
|
951
|
+
_request_timeout: Union[
|
|
952
|
+
None,
|
|
953
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
954
|
+
Tuple[
|
|
955
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
956
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
957
|
+
]
|
|
958
|
+
] = None,
|
|
959
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
960
|
+
_content_type: Optional[StrictStr] = None,
|
|
961
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
962
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
963
|
+
) -> RebootVpsResponseContent:
|
|
964
|
+
"""reboot_vps
|
|
965
|
+
|
|
966
|
+
Gracefully reboot a VPS service. Sends ACPI reboot signal to guest OS
|
|
967
|
+
|
|
968
|
+
:param reboot_vps_request_content: (required)
|
|
969
|
+
:type reboot_vps_request_content: RebootVpsRequestContent
|
|
970
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
971
|
+
number provided, it will be total request
|
|
972
|
+
timeout. It can also be a pair (tuple) of
|
|
973
|
+
(connection, read) timeouts.
|
|
974
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
975
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
976
|
+
request; this effectively ignores the
|
|
977
|
+
authentication in the spec for a single request.
|
|
978
|
+
:type _request_auth: dict, optional
|
|
979
|
+
:param _content_type: force content-type for the request.
|
|
980
|
+
:type _content_type: str, Optional
|
|
981
|
+
:param _headers: set to override the headers for a single
|
|
982
|
+
request; this effectively ignores the headers
|
|
983
|
+
in the spec for a single request.
|
|
984
|
+
:type _headers: dict, optional
|
|
985
|
+
:param _host_index: set to override the host_index for a single
|
|
986
|
+
request; this effectively ignores the host_index
|
|
987
|
+
in the spec for a single request.
|
|
988
|
+
:type _host_index: int, optional
|
|
989
|
+
:return: Returns the result object.
|
|
990
|
+
""" # noqa: E501
|
|
991
|
+
|
|
992
|
+
_param = self._reboot_vps_serialize(
|
|
993
|
+
reboot_vps_request_content=reboot_vps_request_content,
|
|
994
|
+
_request_auth=_request_auth,
|
|
995
|
+
_content_type=_content_type,
|
|
996
|
+
_headers=_headers,
|
|
997
|
+
_host_index=_host_index
|
|
998
|
+
)
|
|
999
|
+
|
|
1000
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1001
|
+
'200': "RebootVpsResponseContent",
|
|
1002
|
+
'400': "BadRequestErrorResponseContent",
|
|
1003
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1004
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1005
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1006
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1007
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1008
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1009
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1010
|
+
}
|
|
1011
|
+
response_data = self.api_client.call_api(
|
|
1012
|
+
*_param,
|
|
1013
|
+
_request_timeout=_request_timeout
|
|
1014
|
+
)
|
|
1015
|
+
response_data.read()
|
|
1016
|
+
return self.api_client.response_deserialize(
|
|
1017
|
+
response_data=response_data,
|
|
1018
|
+
response_types_map=_response_types_map,
|
|
1019
|
+
).data
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
@validate_call
|
|
1023
|
+
def reboot_vps_with_http_info(
|
|
1024
|
+
self,
|
|
1025
|
+
reboot_vps_request_content: RebootVpsRequestContent,
|
|
1026
|
+
_request_timeout: Union[
|
|
1027
|
+
None,
|
|
1028
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1029
|
+
Tuple[
|
|
1030
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1031
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1032
|
+
]
|
|
1033
|
+
] = None,
|
|
1034
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1035
|
+
_content_type: Optional[StrictStr] = None,
|
|
1036
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1037
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1038
|
+
) -> ApiResponse[RebootVpsResponseContent]:
|
|
1039
|
+
"""reboot_vps
|
|
1040
|
+
|
|
1041
|
+
Gracefully reboot a VPS service. Sends ACPI reboot signal to guest OS
|
|
1042
|
+
|
|
1043
|
+
:param reboot_vps_request_content: (required)
|
|
1044
|
+
:type reboot_vps_request_content: RebootVpsRequestContent
|
|
1045
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1046
|
+
number provided, it will be total request
|
|
1047
|
+
timeout. It can also be a pair (tuple) of
|
|
1048
|
+
(connection, read) timeouts.
|
|
1049
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1050
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1051
|
+
request; this effectively ignores the
|
|
1052
|
+
authentication in the spec for a single request.
|
|
1053
|
+
:type _request_auth: dict, optional
|
|
1054
|
+
:param _content_type: force content-type for the request.
|
|
1055
|
+
:type _content_type: str, Optional
|
|
1056
|
+
:param _headers: set to override the headers for a single
|
|
1057
|
+
request; this effectively ignores the headers
|
|
1058
|
+
in the spec for a single request.
|
|
1059
|
+
:type _headers: dict, optional
|
|
1060
|
+
:param _host_index: set to override the host_index for a single
|
|
1061
|
+
request; this effectively ignores the host_index
|
|
1062
|
+
in the spec for a single request.
|
|
1063
|
+
:type _host_index: int, optional
|
|
1064
|
+
:return: Returns the result object.
|
|
1065
|
+
""" # noqa: E501
|
|
1066
|
+
|
|
1067
|
+
_param = self._reboot_vps_serialize(
|
|
1068
|
+
reboot_vps_request_content=reboot_vps_request_content,
|
|
1069
|
+
_request_auth=_request_auth,
|
|
1070
|
+
_content_type=_content_type,
|
|
1071
|
+
_headers=_headers,
|
|
1072
|
+
_host_index=_host_index
|
|
1073
|
+
)
|
|
1074
|
+
|
|
1075
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1076
|
+
'200': "RebootVpsResponseContent",
|
|
1077
|
+
'400': "BadRequestErrorResponseContent",
|
|
1078
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1079
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1080
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1081
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1082
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1083
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1084
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1085
|
+
}
|
|
1086
|
+
response_data = self.api_client.call_api(
|
|
1087
|
+
*_param,
|
|
1088
|
+
_request_timeout=_request_timeout
|
|
1089
|
+
)
|
|
1090
|
+
response_data.read()
|
|
1091
|
+
return self.api_client.response_deserialize(
|
|
1092
|
+
response_data=response_data,
|
|
1093
|
+
response_types_map=_response_types_map,
|
|
1094
|
+
)
|
|
1095
|
+
|
|
1096
|
+
|
|
1097
|
+
@validate_call
|
|
1098
|
+
def reboot_vps_without_preload_content(
|
|
1099
|
+
self,
|
|
1100
|
+
reboot_vps_request_content: RebootVpsRequestContent,
|
|
1101
|
+
_request_timeout: Union[
|
|
1102
|
+
None,
|
|
1103
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1104
|
+
Tuple[
|
|
1105
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1106
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1107
|
+
]
|
|
1108
|
+
] = None,
|
|
1109
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1110
|
+
_content_type: Optional[StrictStr] = None,
|
|
1111
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1112
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1113
|
+
) -> RESTResponseType:
|
|
1114
|
+
"""reboot_vps
|
|
1115
|
+
|
|
1116
|
+
Gracefully reboot a VPS service. Sends ACPI reboot signal to guest OS
|
|
1117
|
+
|
|
1118
|
+
:param reboot_vps_request_content: (required)
|
|
1119
|
+
:type reboot_vps_request_content: RebootVpsRequestContent
|
|
1120
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1121
|
+
number provided, it will be total request
|
|
1122
|
+
timeout. It can also be a pair (tuple) of
|
|
1123
|
+
(connection, read) timeouts.
|
|
1124
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1125
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1126
|
+
request; this effectively ignores the
|
|
1127
|
+
authentication in the spec for a single request.
|
|
1128
|
+
:type _request_auth: dict, optional
|
|
1129
|
+
:param _content_type: force content-type for the request.
|
|
1130
|
+
:type _content_type: str, Optional
|
|
1131
|
+
:param _headers: set to override the headers for a single
|
|
1132
|
+
request; this effectively ignores the headers
|
|
1133
|
+
in the spec for a single request.
|
|
1134
|
+
:type _headers: dict, optional
|
|
1135
|
+
:param _host_index: set to override the host_index for a single
|
|
1136
|
+
request; this effectively ignores the host_index
|
|
1137
|
+
in the spec for a single request.
|
|
1138
|
+
:type _host_index: int, optional
|
|
1139
|
+
:return: Returns the result object.
|
|
1140
|
+
""" # noqa: E501
|
|
1141
|
+
|
|
1142
|
+
_param = self._reboot_vps_serialize(
|
|
1143
|
+
reboot_vps_request_content=reboot_vps_request_content,
|
|
1144
|
+
_request_auth=_request_auth,
|
|
1145
|
+
_content_type=_content_type,
|
|
1146
|
+
_headers=_headers,
|
|
1147
|
+
_host_index=_host_index
|
|
1148
|
+
)
|
|
1149
|
+
|
|
1150
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1151
|
+
'200': "RebootVpsResponseContent",
|
|
1152
|
+
'400': "BadRequestErrorResponseContent",
|
|
1153
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1154
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1155
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1156
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1157
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1158
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1159
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1160
|
+
}
|
|
1161
|
+
response_data = self.api_client.call_api(
|
|
1162
|
+
*_param,
|
|
1163
|
+
_request_timeout=_request_timeout
|
|
1164
|
+
)
|
|
1165
|
+
return response_data.response
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
def _reboot_vps_serialize(
|
|
1169
|
+
self,
|
|
1170
|
+
reboot_vps_request_content,
|
|
1171
|
+
_request_auth,
|
|
1172
|
+
_content_type,
|
|
1173
|
+
_headers,
|
|
1174
|
+
_host_index,
|
|
1175
|
+
) -> RequestSerialized:
|
|
1176
|
+
|
|
1177
|
+
_host = None
|
|
1178
|
+
|
|
1179
|
+
_collection_formats: Dict[str, str] = {
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
_path_params: Dict[str, str] = {}
|
|
1183
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1184
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1185
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1186
|
+
_files: Dict[
|
|
1187
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1188
|
+
] = {}
|
|
1189
|
+
_body_params: Optional[bytes] = None
|
|
1190
|
+
|
|
1191
|
+
# process the path parameters
|
|
1192
|
+
# process the query parameters
|
|
1193
|
+
# process the header parameters
|
|
1194
|
+
# process the form parameters
|
|
1195
|
+
# process the body parameter
|
|
1196
|
+
if reboot_vps_request_content is not None:
|
|
1197
|
+
_body_params = reboot_vps_request_content
|
|
1198
|
+
|
|
1199
|
+
|
|
1200
|
+
# set the HTTP header `Accept`
|
|
1201
|
+
if 'Accept' not in _header_params:
|
|
1202
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1203
|
+
[
|
|
1204
|
+
'application/json'
|
|
1205
|
+
]
|
|
1206
|
+
)
|
|
1207
|
+
|
|
1208
|
+
# set the HTTP header `Content-Type`
|
|
1209
|
+
if _content_type:
|
|
1210
|
+
_header_params['Content-Type'] = _content_type
|
|
1211
|
+
else:
|
|
1212
|
+
_default_content_type = (
|
|
1213
|
+
self.api_client.select_header_content_type(
|
|
1214
|
+
[
|
|
1215
|
+
'application/json'
|
|
1216
|
+
]
|
|
1217
|
+
)
|
|
1218
|
+
)
|
|
1219
|
+
if _default_content_type is not None:
|
|
1220
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1221
|
+
|
|
1222
|
+
# authentication setting
|
|
1223
|
+
_auth_settings: List[str] = [
|
|
1224
|
+
'BearerAuth'
|
|
1225
|
+
]
|
|
1226
|
+
|
|
1227
|
+
return self.api_client.param_serialize(
|
|
1228
|
+
method='POST',
|
|
1229
|
+
resource_path='/vps/reboot',
|
|
1230
|
+
path_params=_path_params,
|
|
1231
|
+
query_params=_query_params,
|
|
1232
|
+
header_params=_header_params,
|
|
1233
|
+
body=_body_params,
|
|
1234
|
+
post_params=_form_params,
|
|
1235
|
+
files=_files,
|
|
1236
|
+
auth_settings=_auth_settings,
|
|
1237
|
+
collection_formats=_collection_formats,
|
|
1238
|
+
_host=_host,
|
|
1239
|
+
_request_auth=_request_auth
|
|
1240
|
+
)
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
@validate_call
|
|
1246
|
+
def shutdown_vps(
|
|
1247
|
+
self,
|
|
1248
|
+
shutdown_vps_request_content: ShutdownVpsRequestContent,
|
|
1249
|
+
_request_timeout: Union[
|
|
1250
|
+
None,
|
|
1251
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1252
|
+
Tuple[
|
|
1253
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1254
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1255
|
+
]
|
|
1256
|
+
] = None,
|
|
1257
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1258
|
+
_content_type: Optional[StrictStr] = None,
|
|
1259
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1260
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1261
|
+
) -> ShutdownVpsResponseContent:
|
|
1262
|
+
"""shutdown_vps
|
|
1263
|
+
|
|
1264
|
+
Gracefully shutdown a VPS service. Sends ACPI shutdown signal to guest OS
|
|
1265
|
+
|
|
1266
|
+
:param shutdown_vps_request_content: (required)
|
|
1267
|
+
:type shutdown_vps_request_content: ShutdownVpsRequestContent
|
|
1268
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1269
|
+
number provided, it will be total request
|
|
1270
|
+
timeout. It can also be a pair (tuple) of
|
|
1271
|
+
(connection, read) timeouts.
|
|
1272
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1273
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1274
|
+
request; this effectively ignores the
|
|
1275
|
+
authentication in the spec for a single request.
|
|
1276
|
+
:type _request_auth: dict, optional
|
|
1277
|
+
:param _content_type: force content-type for the request.
|
|
1278
|
+
:type _content_type: str, Optional
|
|
1279
|
+
:param _headers: set to override the headers for a single
|
|
1280
|
+
request; this effectively ignores the headers
|
|
1281
|
+
in the spec for a single request.
|
|
1282
|
+
:type _headers: dict, optional
|
|
1283
|
+
:param _host_index: set to override the host_index for a single
|
|
1284
|
+
request; this effectively ignores the host_index
|
|
1285
|
+
in the spec for a single request.
|
|
1286
|
+
:type _host_index: int, optional
|
|
1287
|
+
:return: Returns the result object.
|
|
1288
|
+
""" # noqa: E501
|
|
1289
|
+
|
|
1290
|
+
_param = self._shutdown_vps_serialize(
|
|
1291
|
+
shutdown_vps_request_content=shutdown_vps_request_content,
|
|
1292
|
+
_request_auth=_request_auth,
|
|
1293
|
+
_content_type=_content_type,
|
|
1294
|
+
_headers=_headers,
|
|
1295
|
+
_host_index=_host_index
|
|
1296
|
+
)
|
|
1297
|
+
|
|
1298
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1299
|
+
'200': "ShutdownVpsResponseContent",
|
|
1300
|
+
'400': "BadRequestErrorResponseContent",
|
|
1301
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1302
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1303
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1304
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1305
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1306
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1307
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1308
|
+
}
|
|
1309
|
+
response_data = self.api_client.call_api(
|
|
1310
|
+
*_param,
|
|
1311
|
+
_request_timeout=_request_timeout
|
|
1312
|
+
)
|
|
1313
|
+
response_data.read()
|
|
1314
|
+
return self.api_client.response_deserialize(
|
|
1315
|
+
response_data=response_data,
|
|
1316
|
+
response_types_map=_response_types_map,
|
|
1317
|
+
).data
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
@validate_call
|
|
1321
|
+
def shutdown_vps_with_http_info(
|
|
1322
|
+
self,
|
|
1323
|
+
shutdown_vps_request_content: ShutdownVpsRequestContent,
|
|
1324
|
+
_request_timeout: Union[
|
|
1325
|
+
None,
|
|
1326
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1327
|
+
Tuple[
|
|
1328
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1329
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1330
|
+
]
|
|
1331
|
+
] = None,
|
|
1332
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1333
|
+
_content_type: Optional[StrictStr] = None,
|
|
1334
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1335
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1336
|
+
) -> ApiResponse[ShutdownVpsResponseContent]:
|
|
1337
|
+
"""shutdown_vps
|
|
1338
|
+
|
|
1339
|
+
Gracefully shutdown a VPS service. Sends ACPI shutdown signal to guest OS
|
|
1340
|
+
|
|
1341
|
+
:param shutdown_vps_request_content: (required)
|
|
1342
|
+
:type shutdown_vps_request_content: ShutdownVpsRequestContent
|
|
1343
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1344
|
+
number provided, it will be total request
|
|
1345
|
+
timeout. It can also be a pair (tuple) of
|
|
1346
|
+
(connection, read) timeouts.
|
|
1347
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1348
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1349
|
+
request; this effectively ignores the
|
|
1350
|
+
authentication in the spec for a single request.
|
|
1351
|
+
:type _request_auth: dict, optional
|
|
1352
|
+
:param _content_type: force content-type for the request.
|
|
1353
|
+
:type _content_type: str, Optional
|
|
1354
|
+
:param _headers: set to override the headers for a single
|
|
1355
|
+
request; this effectively ignores the headers
|
|
1356
|
+
in the spec for a single request.
|
|
1357
|
+
:type _headers: dict, optional
|
|
1358
|
+
:param _host_index: set to override the host_index for a single
|
|
1359
|
+
request; this effectively ignores the host_index
|
|
1360
|
+
in the spec for a single request.
|
|
1361
|
+
:type _host_index: int, optional
|
|
1362
|
+
:return: Returns the result object.
|
|
1363
|
+
""" # noqa: E501
|
|
1364
|
+
|
|
1365
|
+
_param = self._shutdown_vps_serialize(
|
|
1366
|
+
shutdown_vps_request_content=shutdown_vps_request_content,
|
|
1367
|
+
_request_auth=_request_auth,
|
|
1368
|
+
_content_type=_content_type,
|
|
1369
|
+
_headers=_headers,
|
|
1370
|
+
_host_index=_host_index
|
|
1371
|
+
)
|
|
1372
|
+
|
|
1373
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1374
|
+
'200': "ShutdownVpsResponseContent",
|
|
1375
|
+
'400': "BadRequestErrorResponseContent",
|
|
1376
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1377
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1378
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1379
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1380
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1381
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1382
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1383
|
+
}
|
|
1384
|
+
response_data = self.api_client.call_api(
|
|
1385
|
+
*_param,
|
|
1386
|
+
_request_timeout=_request_timeout
|
|
1387
|
+
)
|
|
1388
|
+
response_data.read()
|
|
1389
|
+
return self.api_client.response_deserialize(
|
|
1390
|
+
response_data=response_data,
|
|
1391
|
+
response_types_map=_response_types_map,
|
|
1392
|
+
)
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
@validate_call
|
|
1396
|
+
def shutdown_vps_without_preload_content(
|
|
1397
|
+
self,
|
|
1398
|
+
shutdown_vps_request_content: ShutdownVpsRequestContent,
|
|
1399
|
+
_request_timeout: Union[
|
|
1400
|
+
None,
|
|
1401
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1402
|
+
Tuple[
|
|
1403
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1404
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1405
|
+
]
|
|
1406
|
+
] = None,
|
|
1407
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1408
|
+
_content_type: Optional[StrictStr] = None,
|
|
1409
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1410
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1411
|
+
) -> RESTResponseType:
|
|
1412
|
+
"""shutdown_vps
|
|
1413
|
+
|
|
1414
|
+
Gracefully shutdown a VPS service. Sends ACPI shutdown signal to guest OS
|
|
1415
|
+
|
|
1416
|
+
:param shutdown_vps_request_content: (required)
|
|
1417
|
+
:type shutdown_vps_request_content: ShutdownVpsRequestContent
|
|
1418
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1419
|
+
number provided, it will be total request
|
|
1420
|
+
timeout. It can also be a pair (tuple) of
|
|
1421
|
+
(connection, read) timeouts.
|
|
1422
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1423
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1424
|
+
request; this effectively ignores the
|
|
1425
|
+
authentication in the spec for a single request.
|
|
1426
|
+
:type _request_auth: dict, optional
|
|
1427
|
+
:param _content_type: force content-type for the request.
|
|
1428
|
+
:type _content_type: str, Optional
|
|
1429
|
+
:param _headers: set to override the headers for a single
|
|
1430
|
+
request; this effectively ignores the headers
|
|
1431
|
+
in the spec for a single request.
|
|
1432
|
+
:type _headers: dict, optional
|
|
1433
|
+
:param _host_index: set to override the host_index for a single
|
|
1434
|
+
request; this effectively ignores the host_index
|
|
1435
|
+
in the spec for a single request.
|
|
1436
|
+
:type _host_index: int, optional
|
|
1437
|
+
:return: Returns the result object.
|
|
1438
|
+
""" # noqa: E501
|
|
1439
|
+
|
|
1440
|
+
_param = self._shutdown_vps_serialize(
|
|
1441
|
+
shutdown_vps_request_content=shutdown_vps_request_content,
|
|
1442
|
+
_request_auth=_request_auth,
|
|
1443
|
+
_content_type=_content_type,
|
|
1444
|
+
_headers=_headers,
|
|
1445
|
+
_host_index=_host_index
|
|
1446
|
+
)
|
|
1447
|
+
|
|
1448
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1449
|
+
'200': "ShutdownVpsResponseContent",
|
|
1450
|
+
'400': "BadRequestErrorResponseContent",
|
|
1451
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1452
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1453
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1454
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1455
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1456
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1457
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1458
|
+
}
|
|
1459
|
+
response_data = self.api_client.call_api(
|
|
1460
|
+
*_param,
|
|
1461
|
+
_request_timeout=_request_timeout
|
|
1462
|
+
)
|
|
1463
|
+
return response_data.response
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
def _shutdown_vps_serialize(
|
|
1467
|
+
self,
|
|
1468
|
+
shutdown_vps_request_content,
|
|
1469
|
+
_request_auth,
|
|
1470
|
+
_content_type,
|
|
1471
|
+
_headers,
|
|
1472
|
+
_host_index,
|
|
1473
|
+
) -> RequestSerialized:
|
|
1474
|
+
|
|
1475
|
+
_host = None
|
|
1476
|
+
|
|
1477
|
+
_collection_formats: Dict[str, str] = {
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
_path_params: Dict[str, str] = {}
|
|
1481
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1482
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1483
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1484
|
+
_files: Dict[
|
|
1485
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1486
|
+
] = {}
|
|
1487
|
+
_body_params: Optional[bytes] = None
|
|
1488
|
+
|
|
1489
|
+
# process the path parameters
|
|
1490
|
+
# process the query parameters
|
|
1491
|
+
# process the header parameters
|
|
1492
|
+
# process the form parameters
|
|
1493
|
+
# process the body parameter
|
|
1494
|
+
if shutdown_vps_request_content is not None:
|
|
1495
|
+
_body_params = shutdown_vps_request_content
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
# set the HTTP header `Accept`
|
|
1499
|
+
if 'Accept' not in _header_params:
|
|
1500
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1501
|
+
[
|
|
1502
|
+
'application/json'
|
|
1503
|
+
]
|
|
1504
|
+
)
|
|
1505
|
+
|
|
1506
|
+
# set the HTTP header `Content-Type`
|
|
1507
|
+
if _content_type:
|
|
1508
|
+
_header_params['Content-Type'] = _content_type
|
|
1509
|
+
else:
|
|
1510
|
+
_default_content_type = (
|
|
1511
|
+
self.api_client.select_header_content_type(
|
|
1512
|
+
[
|
|
1513
|
+
'application/json'
|
|
1514
|
+
]
|
|
1515
|
+
)
|
|
1516
|
+
)
|
|
1517
|
+
if _default_content_type is not None:
|
|
1518
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1519
|
+
|
|
1520
|
+
# authentication setting
|
|
1521
|
+
_auth_settings: List[str] = [
|
|
1522
|
+
'BearerAuth'
|
|
1523
|
+
]
|
|
1524
|
+
|
|
1525
|
+
return self.api_client.param_serialize(
|
|
1526
|
+
method='POST',
|
|
1527
|
+
resource_path='/vps/shutdown',
|
|
1528
|
+
path_params=_path_params,
|
|
1529
|
+
query_params=_query_params,
|
|
1530
|
+
header_params=_header_params,
|
|
1531
|
+
body=_body_params,
|
|
1532
|
+
post_params=_form_params,
|
|
1533
|
+
files=_files,
|
|
1534
|
+
auth_settings=_auth_settings,
|
|
1535
|
+
collection_formats=_collection_formats,
|
|
1536
|
+
_host=_host,
|
|
1537
|
+
_request_auth=_request_auth
|
|
1538
|
+
)
|
|
1539
|
+
|
|
1540
|
+
|
|
1541
|
+
|
|
1542
|
+
|
|
1543
|
+
@validate_call
|
|
1544
|
+
def start_vps(
|
|
1545
|
+
self,
|
|
1546
|
+
start_vps_request_content: StartVpsRequestContent,
|
|
1547
|
+
_request_timeout: Union[
|
|
1548
|
+
None,
|
|
1549
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1550
|
+
Tuple[
|
|
1551
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1552
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1553
|
+
]
|
|
1554
|
+
] = None,
|
|
1555
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1556
|
+
_content_type: Optional[StrictStr] = None,
|
|
1557
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1558
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1559
|
+
) -> StartVpsResponseContent:
|
|
1560
|
+
"""start_vps
|
|
1561
|
+
|
|
1562
|
+
Starts a stopped VPS service
|
|
1563
|
+
|
|
1564
|
+
:param start_vps_request_content: (required)
|
|
1565
|
+
:type start_vps_request_content: StartVpsRequestContent
|
|
1566
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1567
|
+
number provided, it will be total request
|
|
1568
|
+
timeout. It can also be a pair (tuple) of
|
|
1569
|
+
(connection, read) timeouts.
|
|
1570
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1571
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1572
|
+
request; this effectively ignores the
|
|
1573
|
+
authentication in the spec for a single request.
|
|
1574
|
+
:type _request_auth: dict, optional
|
|
1575
|
+
:param _content_type: force content-type for the request.
|
|
1576
|
+
:type _content_type: str, Optional
|
|
1577
|
+
:param _headers: set to override the headers for a single
|
|
1578
|
+
request; this effectively ignores the headers
|
|
1579
|
+
in the spec for a single request.
|
|
1580
|
+
:type _headers: dict, optional
|
|
1581
|
+
:param _host_index: set to override the host_index for a single
|
|
1582
|
+
request; this effectively ignores the host_index
|
|
1583
|
+
in the spec for a single request.
|
|
1584
|
+
:type _host_index: int, optional
|
|
1585
|
+
:return: Returns the result object.
|
|
1586
|
+
""" # noqa: E501
|
|
1587
|
+
|
|
1588
|
+
_param = self._start_vps_serialize(
|
|
1589
|
+
start_vps_request_content=start_vps_request_content,
|
|
1590
|
+
_request_auth=_request_auth,
|
|
1591
|
+
_content_type=_content_type,
|
|
1592
|
+
_headers=_headers,
|
|
1593
|
+
_host_index=_host_index
|
|
1594
|
+
)
|
|
1595
|
+
|
|
1596
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1597
|
+
'200': "StartVpsResponseContent",
|
|
1598
|
+
'400': "BadRequestErrorResponseContent",
|
|
1599
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1600
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1601
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1602
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1603
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1604
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1605
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1606
|
+
}
|
|
1607
|
+
response_data = self.api_client.call_api(
|
|
1608
|
+
*_param,
|
|
1609
|
+
_request_timeout=_request_timeout
|
|
1610
|
+
)
|
|
1611
|
+
response_data.read()
|
|
1612
|
+
return self.api_client.response_deserialize(
|
|
1613
|
+
response_data=response_data,
|
|
1614
|
+
response_types_map=_response_types_map,
|
|
1615
|
+
).data
|
|
1616
|
+
|
|
1617
|
+
|
|
1618
|
+
@validate_call
|
|
1619
|
+
def start_vps_with_http_info(
|
|
1620
|
+
self,
|
|
1621
|
+
start_vps_request_content: StartVpsRequestContent,
|
|
1622
|
+
_request_timeout: Union[
|
|
1623
|
+
None,
|
|
1624
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1625
|
+
Tuple[
|
|
1626
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1627
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1628
|
+
]
|
|
1629
|
+
] = None,
|
|
1630
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1631
|
+
_content_type: Optional[StrictStr] = None,
|
|
1632
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1633
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1634
|
+
) -> ApiResponse[StartVpsResponseContent]:
|
|
1635
|
+
"""start_vps
|
|
1636
|
+
|
|
1637
|
+
Starts a stopped VPS service
|
|
1638
|
+
|
|
1639
|
+
:param start_vps_request_content: (required)
|
|
1640
|
+
:type start_vps_request_content: StartVpsRequestContent
|
|
1641
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1642
|
+
number provided, it will be total request
|
|
1643
|
+
timeout. It can also be a pair (tuple) of
|
|
1644
|
+
(connection, read) timeouts.
|
|
1645
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1646
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1647
|
+
request; this effectively ignores the
|
|
1648
|
+
authentication in the spec for a single request.
|
|
1649
|
+
:type _request_auth: dict, optional
|
|
1650
|
+
:param _content_type: force content-type for the request.
|
|
1651
|
+
:type _content_type: str, Optional
|
|
1652
|
+
:param _headers: set to override the headers for a single
|
|
1653
|
+
request; this effectively ignores the headers
|
|
1654
|
+
in the spec for a single request.
|
|
1655
|
+
:type _headers: dict, optional
|
|
1656
|
+
:param _host_index: set to override the host_index for a single
|
|
1657
|
+
request; this effectively ignores the host_index
|
|
1658
|
+
in the spec for a single request.
|
|
1659
|
+
:type _host_index: int, optional
|
|
1660
|
+
:return: Returns the result object.
|
|
1661
|
+
""" # noqa: E501
|
|
1662
|
+
|
|
1663
|
+
_param = self._start_vps_serialize(
|
|
1664
|
+
start_vps_request_content=start_vps_request_content,
|
|
1665
|
+
_request_auth=_request_auth,
|
|
1666
|
+
_content_type=_content_type,
|
|
1667
|
+
_headers=_headers,
|
|
1668
|
+
_host_index=_host_index
|
|
1669
|
+
)
|
|
1670
|
+
|
|
1671
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1672
|
+
'200': "StartVpsResponseContent",
|
|
1673
|
+
'400': "BadRequestErrorResponseContent",
|
|
1674
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1675
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1676
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1677
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1678
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1679
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1680
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1681
|
+
}
|
|
1682
|
+
response_data = self.api_client.call_api(
|
|
1683
|
+
*_param,
|
|
1684
|
+
_request_timeout=_request_timeout
|
|
1685
|
+
)
|
|
1686
|
+
response_data.read()
|
|
1687
|
+
return self.api_client.response_deserialize(
|
|
1688
|
+
response_data=response_data,
|
|
1689
|
+
response_types_map=_response_types_map,
|
|
1690
|
+
)
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
@validate_call
|
|
1694
|
+
def start_vps_without_preload_content(
|
|
1695
|
+
self,
|
|
1696
|
+
start_vps_request_content: StartVpsRequestContent,
|
|
1697
|
+
_request_timeout: Union[
|
|
1698
|
+
None,
|
|
1699
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1700
|
+
Tuple[
|
|
1701
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1702
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1703
|
+
]
|
|
1704
|
+
] = None,
|
|
1705
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1706
|
+
_content_type: Optional[StrictStr] = None,
|
|
1707
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1708
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1709
|
+
) -> RESTResponseType:
|
|
1710
|
+
"""start_vps
|
|
1711
|
+
|
|
1712
|
+
Starts a stopped VPS service
|
|
1713
|
+
|
|
1714
|
+
:param start_vps_request_content: (required)
|
|
1715
|
+
:type start_vps_request_content: StartVpsRequestContent
|
|
1716
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1717
|
+
number provided, it will be total request
|
|
1718
|
+
timeout. It can also be a pair (tuple) of
|
|
1719
|
+
(connection, read) timeouts.
|
|
1720
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1721
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1722
|
+
request; this effectively ignores the
|
|
1723
|
+
authentication in the spec for a single request.
|
|
1724
|
+
:type _request_auth: dict, optional
|
|
1725
|
+
:param _content_type: force content-type for the request.
|
|
1726
|
+
:type _content_type: str, Optional
|
|
1727
|
+
:param _headers: set to override the headers for a single
|
|
1728
|
+
request; this effectively ignores the headers
|
|
1729
|
+
in the spec for a single request.
|
|
1730
|
+
:type _headers: dict, optional
|
|
1731
|
+
:param _host_index: set to override the host_index for a single
|
|
1732
|
+
request; this effectively ignores the host_index
|
|
1733
|
+
in the spec for a single request.
|
|
1734
|
+
:type _host_index: int, optional
|
|
1735
|
+
:return: Returns the result object.
|
|
1736
|
+
""" # noqa: E501
|
|
1737
|
+
|
|
1738
|
+
_param = self._start_vps_serialize(
|
|
1739
|
+
start_vps_request_content=start_vps_request_content,
|
|
1740
|
+
_request_auth=_request_auth,
|
|
1741
|
+
_content_type=_content_type,
|
|
1742
|
+
_headers=_headers,
|
|
1743
|
+
_host_index=_host_index
|
|
1744
|
+
)
|
|
1745
|
+
|
|
1746
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1747
|
+
'200': "StartVpsResponseContent",
|
|
1748
|
+
'400': "BadRequestErrorResponseContent",
|
|
1749
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1750
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1751
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1752
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1753
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1754
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1755
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1756
|
+
}
|
|
1757
|
+
response_data = self.api_client.call_api(
|
|
1758
|
+
*_param,
|
|
1759
|
+
_request_timeout=_request_timeout
|
|
1760
|
+
)
|
|
1761
|
+
return response_data.response
|
|
1762
|
+
|
|
1763
|
+
|
|
1764
|
+
def _start_vps_serialize(
|
|
1765
|
+
self,
|
|
1766
|
+
start_vps_request_content,
|
|
1767
|
+
_request_auth,
|
|
1768
|
+
_content_type,
|
|
1769
|
+
_headers,
|
|
1770
|
+
_host_index,
|
|
1771
|
+
) -> RequestSerialized:
|
|
1772
|
+
|
|
1773
|
+
_host = None
|
|
1774
|
+
|
|
1775
|
+
_collection_formats: Dict[str, str] = {
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
_path_params: Dict[str, str] = {}
|
|
1779
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1780
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1781
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1782
|
+
_files: Dict[
|
|
1783
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1784
|
+
] = {}
|
|
1785
|
+
_body_params: Optional[bytes] = None
|
|
1786
|
+
|
|
1787
|
+
# process the path parameters
|
|
1788
|
+
# process the query parameters
|
|
1789
|
+
# process the header parameters
|
|
1790
|
+
# process the form parameters
|
|
1791
|
+
# process the body parameter
|
|
1792
|
+
if start_vps_request_content is not None:
|
|
1793
|
+
_body_params = start_vps_request_content
|
|
1794
|
+
|
|
1795
|
+
|
|
1796
|
+
# set the HTTP header `Accept`
|
|
1797
|
+
if 'Accept' not in _header_params:
|
|
1798
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1799
|
+
[
|
|
1800
|
+
'application/json'
|
|
1801
|
+
]
|
|
1802
|
+
)
|
|
1803
|
+
|
|
1804
|
+
# set the HTTP header `Content-Type`
|
|
1805
|
+
if _content_type:
|
|
1806
|
+
_header_params['Content-Type'] = _content_type
|
|
1807
|
+
else:
|
|
1808
|
+
_default_content_type = (
|
|
1809
|
+
self.api_client.select_header_content_type(
|
|
1810
|
+
[
|
|
1811
|
+
'application/json'
|
|
1812
|
+
]
|
|
1813
|
+
)
|
|
1814
|
+
)
|
|
1815
|
+
if _default_content_type is not None:
|
|
1816
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1817
|
+
|
|
1818
|
+
# authentication setting
|
|
1819
|
+
_auth_settings: List[str] = [
|
|
1820
|
+
'BearerAuth'
|
|
1821
|
+
]
|
|
1822
|
+
|
|
1823
|
+
return self.api_client.param_serialize(
|
|
1824
|
+
method='POST',
|
|
1825
|
+
resource_path='/vps/start',
|
|
1826
|
+
path_params=_path_params,
|
|
1827
|
+
query_params=_query_params,
|
|
1828
|
+
header_params=_header_params,
|
|
1829
|
+
body=_body_params,
|
|
1830
|
+
post_params=_form_params,
|
|
1831
|
+
files=_files,
|
|
1832
|
+
auth_settings=_auth_settings,
|
|
1833
|
+
collection_formats=_collection_formats,
|
|
1834
|
+
_host=_host,
|
|
1835
|
+
_request_auth=_request_auth
|
|
1836
|
+
)
|
|
1837
|
+
|
|
1838
|
+
|
|
1839
|
+
|
|
1840
|
+
|
|
1841
|
+
@validate_call
|
|
1842
|
+
def stop_vps(
|
|
1843
|
+
self,
|
|
1844
|
+
stop_vps_request_content: StopVpsRequestContent,
|
|
1845
|
+
_request_timeout: Union[
|
|
1846
|
+
None,
|
|
1847
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1848
|
+
Tuple[
|
|
1849
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1850
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1851
|
+
]
|
|
1852
|
+
] = None,
|
|
1853
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1854
|
+
_content_type: Optional[StrictStr] = None,
|
|
1855
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1856
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1857
|
+
) -> StopVpsResponseContent:
|
|
1858
|
+
"""stop_vps
|
|
1859
|
+
|
|
1860
|
+
Hard stops a running VPS service
|
|
1861
|
+
|
|
1862
|
+
:param stop_vps_request_content: (required)
|
|
1863
|
+
:type stop_vps_request_content: StopVpsRequestContent
|
|
1864
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1865
|
+
number provided, it will be total request
|
|
1866
|
+
timeout. It can also be a pair (tuple) of
|
|
1867
|
+
(connection, read) timeouts.
|
|
1868
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1869
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1870
|
+
request; this effectively ignores the
|
|
1871
|
+
authentication in the spec for a single request.
|
|
1872
|
+
:type _request_auth: dict, optional
|
|
1873
|
+
:param _content_type: force content-type for the request.
|
|
1874
|
+
:type _content_type: str, Optional
|
|
1875
|
+
:param _headers: set to override the headers for a single
|
|
1876
|
+
request; this effectively ignores the headers
|
|
1877
|
+
in the spec for a single request.
|
|
1878
|
+
:type _headers: dict, optional
|
|
1879
|
+
:param _host_index: set to override the host_index for a single
|
|
1880
|
+
request; this effectively ignores the host_index
|
|
1881
|
+
in the spec for a single request.
|
|
1882
|
+
:type _host_index: int, optional
|
|
1883
|
+
:return: Returns the result object.
|
|
1884
|
+
""" # noqa: E501
|
|
1885
|
+
|
|
1886
|
+
_param = self._stop_vps_serialize(
|
|
1887
|
+
stop_vps_request_content=stop_vps_request_content,
|
|
1888
|
+
_request_auth=_request_auth,
|
|
1889
|
+
_content_type=_content_type,
|
|
1890
|
+
_headers=_headers,
|
|
1891
|
+
_host_index=_host_index
|
|
1892
|
+
)
|
|
1893
|
+
|
|
1894
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1895
|
+
'200': "StopVpsResponseContent",
|
|
1896
|
+
'400': "BadRequestErrorResponseContent",
|
|
1897
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1898
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1899
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1900
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1901
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1902
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1903
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1904
|
+
}
|
|
1905
|
+
response_data = self.api_client.call_api(
|
|
1906
|
+
*_param,
|
|
1907
|
+
_request_timeout=_request_timeout
|
|
1908
|
+
)
|
|
1909
|
+
response_data.read()
|
|
1910
|
+
return self.api_client.response_deserialize(
|
|
1911
|
+
response_data=response_data,
|
|
1912
|
+
response_types_map=_response_types_map,
|
|
1913
|
+
).data
|
|
1914
|
+
|
|
1915
|
+
|
|
1916
|
+
@validate_call
|
|
1917
|
+
def stop_vps_with_http_info(
|
|
1918
|
+
self,
|
|
1919
|
+
stop_vps_request_content: StopVpsRequestContent,
|
|
1920
|
+
_request_timeout: Union[
|
|
1921
|
+
None,
|
|
1922
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1923
|
+
Tuple[
|
|
1924
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1925
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1926
|
+
]
|
|
1927
|
+
] = None,
|
|
1928
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1929
|
+
_content_type: Optional[StrictStr] = None,
|
|
1930
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1931
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1932
|
+
) -> ApiResponse[StopVpsResponseContent]:
|
|
1933
|
+
"""stop_vps
|
|
1934
|
+
|
|
1935
|
+
Hard stops a running VPS service
|
|
1936
|
+
|
|
1937
|
+
:param stop_vps_request_content: (required)
|
|
1938
|
+
:type stop_vps_request_content: StopVpsRequestContent
|
|
1939
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1940
|
+
number provided, it will be total request
|
|
1941
|
+
timeout. It can also be a pair (tuple) of
|
|
1942
|
+
(connection, read) timeouts.
|
|
1943
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1944
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1945
|
+
request; this effectively ignores the
|
|
1946
|
+
authentication in the spec for a single request.
|
|
1947
|
+
:type _request_auth: dict, optional
|
|
1948
|
+
:param _content_type: force content-type for the request.
|
|
1949
|
+
:type _content_type: str, Optional
|
|
1950
|
+
:param _headers: set to override the headers for a single
|
|
1951
|
+
request; this effectively ignores the headers
|
|
1952
|
+
in the spec for a single request.
|
|
1953
|
+
:type _headers: dict, optional
|
|
1954
|
+
:param _host_index: set to override the host_index for a single
|
|
1955
|
+
request; this effectively ignores the host_index
|
|
1956
|
+
in the spec for a single request.
|
|
1957
|
+
:type _host_index: int, optional
|
|
1958
|
+
:return: Returns the result object.
|
|
1959
|
+
""" # noqa: E501
|
|
1960
|
+
|
|
1961
|
+
_param = self._stop_vps_serialize(
|
|
1962
|
+
stop_vps_request_content=stop_vps_request_content,
|
|
1963
|
+
_request_auth=_request_auth,
|
|
1964
|
+
_content_type=_content_type,
|
|
1965
|
+
_headers=_headers,
|
|
1966
|
+
_host_index=_host_index
|
|
1967
|
+
)
|
|
1968
|
+
|
|
1969
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1970
|
+
'200': "StopVpsResponseContent",
|
|
1971
|
+
'400': "BadRequestErrorResponseContent",
|
|
1972
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1973
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1974
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1975
|
+
'409': "InvalidStateErrorResponseContent",
|
|
1976
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1977
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1978
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1979
|
+
}
|
|
1980
|
+
response_data = self.api_client.call_api(
|
|
1981
|
+
*_param,
|
|
1982
|
+
_request_timeout=_request_timeout
|
|
1983
|
+
)
|
|
1984
|
+
response_data.read()
|
|
1985
|
+
return self.api_client.response_deserialize(
|
|
1986
|
+
response_data=response_data,
|
|
1987
|
+
response_types_map=_response_types_map,
|
|
1988
|
+
)
|
|
1989
|
+
|
|
1990
|
+
|
|
1991
|
+
@validate_call
|
|
1992
|
+
def stop_vps_without_preload_content(
|
|
1993
|
+
self,
|
|
1994
|
+
stop_vps_request_content: StopVpsRequestContent,
|
|
1995
|
+
_request_timeout: Union[
|
|
1996
|
+
None,
|
|
1997
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1998
|
+
Tuple[
|
|
1999
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2000
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2001
|
+
]
|
|
2002
|
+
] = None,
|
|
2003
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2004
|
+
_content_type: Optional[StrictStr] = None,
|
|
2005
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2006
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2007
|
+
) -> RESTResponseType:
|
|
2008
|
+
"""stop_vps
|
|
2009
|
+
|
|
2010
|
+
Hard stops a running VPS service
|
|
2011
|
+
|
|
2012
|
+
:param stop_vps_request_content: (required)
|
|
2013
|
+
:type stop_vps_request_content: StopVpsRequestContent
|
|
2014
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2015
|
+
number provided, it will be total request
|
|
2016
|
+
timeout. It can also be a pair (tuple) of
|
|
2017
|
+
(connection, read) timeouts.
|
|
2018
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2019
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2020
|
+
request; this effectively ignores the
|
|
2021
|
+
authentication in the spec for a single request.
|
|
2022
|
+
:type _request_auth: dict, optional
|
|
2023
|
+
:param _content_type: force content-type for the request.
|
|
2024
|
+
:type _content_type: str, Optional
|
|
2025
|
+
:param _headers: set to override the headers for a single
|
|
2026
|
+
request; this effectively ignores the headers
|
|
2027
|
+
in the spec for a single request.
|
|
2028
|
+
:type _headers: dict, optional
|
|
2029
|
+
:param _host_index: set to override the host_index for a single
|
|
2030
|
+
request; this effectively ignores the host_index
|
|
2031
|
+
in the spec for a single request.
|
|
2032
|
+
:type _host_index: int, optional
|
|
2033
|
+
:return: Returns the result object.
|
|
2034
|
+
""" # noqa: E501
|
|
2035
|
+
|
|
2036
|
+
_param = self._stop_vps_serialize(
|
|
2037
|
+
stop_vps_request_content=stop_vps_request_content,
|
|
2038
|
+
_request_auth=_request_auth,
|
|
2039
|
+
_content_type=_content_type,
|
|
2040
|
+
_headers=_headers,
|
|
2041
|
+
_host_index=_host_index
|
|
2042
|
+
)
|
|
2043
|
+
|
|
2044
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2045
|
+
'200': "StopVpsResponseContent",
|
|
2046
|
+
'400': "BadRequestErrorResponseContent",
|
|
2047
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
2048
|
+
'403': "ForbiddenErrorResponseContent",
|
|
2049
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
2050
|
+
'409': "InvalidStateErrorResponseContent",
|
|
2051
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
2052
|
+
'500': "InternalServiceErrorResponseContent",
|
|
2053
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
2054
|
+
}
|
|
2055
|
+
response_data = self.api_client.call_api(
|
|
2056
|
+
*_param,
|
|
2057
|
+
_request_timeout=_request_timeout
|
|
2058
|
+
)
|
|
2059
|
+
return response_data.response
|
|
2060
|
+
|
|
2061
|
+
|
|
2062
|
+
def _stop_vps_serialize(
|
|
2063
|
+
self,
|
|
2064
|
+
stop_vps_request_content,
|
|
2065
|
+
_request_auth,
|
|
2066
|
+
_content_type,
|
|
2067
|
+
_headers,
|
|
2068
|
+
_host_index,
|
|
2069
|
+
) -> RequestSerialized:
|
|
2070
|
+
|
|
2071
|
+
_host = None
|
|
2072
|
+
|
|
2073
|
+
_collection_formats: Dict[str, str] = {
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
_path_params: Dict[str, str] = {}
|
|
2077
|
+
_query_params: List[Tuple[str, str]] = []
|
|
2078
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
2079
|
+
_form_params: List[Tuple[str, str]] = []
|
|
2080
|
+
_files: Dict[
|
|
2081
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
2082
|
+
] = {}
|
|
2083
|
+
_body_params: Optional[bytes] = None
|
|
2084
|
+
|
|
2085
|
+
# process the path parameters
|
|
2086
|
+
# process the query parameters
|
|
2087
|
+
# process the header parameters
|
|
2088
|
+
# process the form parameters
|
|
2089
|
+
# process the body parameter
|
|
2090
|
+
if stop_vps_request_content is not None:
|
|
2091
|
+
_body_params = stop_vps_request_content
|
|
2092
|
+
|
|
2093
|
+
|
|
2094
|
+
# set the HTTP header `Accept`
|
|
2095
|
+
if 'Accept' not in _header_params:
|
|
2096
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
2097
|
+
[
|
|
2098
|
+
'application/json'
|
|
2099
|
+
]
|
|
2100
|
+
)
|
|
2101
|
+
|
|
2102
|
+
# set the HTTP header `Content-Type`
|
|
2103
|
+
if _content_type:
|
|
2104
|
+
_header_params['Content-Type'] = _content_type
|
|
2105
|
+
else:
|
|
2106
|
+
_default_content_type = (
|
|
2107
|
+
self.api_client.select_header_content_type(
|
|
2108
|
+
[
|
|
2109
|
+
'application/json'
|
|
2110
|
+
]
|
|
2111
|
+
)
|
|
2112
|
+
)
|
|
2113
|
+
if _default_content_type is not None:
|
|
2114
|
+
_header_params['Content-Type'] = _default_content_type
|
|
2115
|
+
|
|
2116
|
+
# authentication setting
|
|
2117
|
+
_auth_settings: List[str] = [
|
|
2118
|
+
'BearerAuth'
|
|
2119
|
+
]
|
|
2120
|
+
|
|
2121
|
+
return self.api_client.param_serialize(
|
|
2122
|
+
method='POST',
|
|
2123
|
+
resource_path='/vps/stop',
|
|
2124
|
+
path_params=_path_params,
|
|
2125
|
+
query_params=_query_params,
|
|
2126
|
+
header_params=_header_params,
|
|
2127
|
+
body=_body_params,
|
|
2128
|
+
post_params=_form_params,
|
|
2129
|
+
files=_files,
|
|
2130
|
+
auth_settings=_auth_settings,
|
|
2131
|
+
collection_formats=_collection_formats,
|
|
2132
|
+
_host=_host,
|
|
2133
|
+
_request_auth=_request_auth
|
|
2134
|
+
)
|
|
2135
|
+
|
|
2136
|
+
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
@validate_call
|
|
2140
|
+
def update_power_task(
|
|
2141
|
+
self,
|
|
2142
|
+
update_power_task_request_content: UpdatePowerTaskRequestContent,
|
|
2143
|
+
_request_timeout: Union[
|
|
2144
|
+
None,
|
|
2145
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2146
|
+
Tuple[
|
|
2147
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2148
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2149
|
+
]
|
|
2150
|
+
] = None,
|
|
2151
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2152
|
+
_content_type: Optional[StrictStr] = None,
|
|
2153
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2154
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2155
|
+
) -> UpdatePowerTaskResponseContent:
|
|
2156
|
+
"""update_power_task
|
|
2157
|
+
|
|
2158
|
+
Updates an existing power task (scheduled start/stop/restart operation) for a VPS service
|
|
2159
|
+
|
|
2160
|
+
:param update_power_task_request_content: (required)
|
|
2161
|
+
:type update_power_task_request_content: UpdatePowerTaskRequestContent
|
|
2162
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2163
|
+
number provided, it will be total request
|
|
2164
|
+
timeout. It can also be a pair (tuple) of
|
|
2165
|
+
(connection, read) timeouts.
|
|
2166
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2167
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2168
|
+
request; this effectively ignores the
|
|
2169
|
+
authentication in the spec for a single request.
|
|
2170
|
+
:type _request_auth: dict, optional
|
|
2171
|
+
:param _content_type: force content-type for the request.
|
|
2172
|
+
:type _content_type: str, Optional
|
|
2173
|
+
:param _headers: set to override the headers for a single
|
|
2174
|
+
request; this effectively ignores the headers
|
|
2175
|
+
in the spec for a single request.
|
|
2176
|
+
:type _headers: dict, optional
|
|
2177
|
+
:param _host_index: set to override the host_index for a single
|
|
2178
|
+
request; this effectively ignores the host_index
|
|
2179
|
+
in the spec for a single request.
|
|
2180
|
+
:type _host_index: int, optional
|
|
2181
|
+
:return: Returns the result object.
|
|
2182
|
+
""" # noqa: E501
|
|
2183
|
+
|
|
2184
|
+
_param = self._update_power_task_serialize(
|
|
2185
|
+
update_power_task_request_content=update_power_task_request_content,
|
|
2186
|
+
_request_auth=_request_auth,
|
|
2187
|
+
_content_type=_content_type,
|
|
2188
|
+
_headers=_headers,
|
|
2189
|
+
_host_index=_host_index
|
|
2190
|
+
)
|
|
2191
|
+
|
|
2192
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2193
|
+
'200': "UpdatePowerTaskResponseContent",
|
|
2194
|
+
'400': "BadRequestErrorResponseContent",
|
|
2195
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
2196
|
+
'403': "ForbiddenErrorResponseContent",
|
|
2197
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
2198
|
+
'422': "ValidationErrorResponseContent",
|
|
2199
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
2200
|
+
'500': "InternalServiceErrorResponseContent",
|
|
2201
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
2202
|
+
}
|
|
2203
|
+
response_data = self.api_client.call_api(
|
|
2204
|
+
*_param,
|
|
2205
|
+
_request_timeout=_request_timeout
|
|
2206
|
+
)
|
|
2207
|
+
response_data.read()
|
|
2208
|
+
return self.api_client.response_deserialize(
|
|
2209
|
+
response_data=response_data,
|
|
2210
|
+
response_types_map=_response_types_map,
|
|
2211
|
+
).data
|
|
2212
|
+
|
|
2213
|
+
|
|
2214
|
+
@validate_call
|
|
2215
|
+
def update_power_task_with_http_info(
|
|
2216
|
+
self,
|
|
2217
|
+
update_power_task_request_content: UpdatePowerTaskRequestContent,
|
|
2218
|
+
_request_timeout: Union[
|
|
2219
|
+
None,
|
|
2220
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2221
|
+
Tuple[
|
|
2222
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2223
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2224
|
+
]
|
|
2225
|
+
] = None,
|
|
2226
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2227
|
+
_content_type: Optional[StrictStr] = None,
|
|
2228
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2229
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2230
|
+
) -> ApiResponse[UpdatePowerTaskResponseContent]:
|
|
2231
|
+
"""update_power_task
|
|
2232
|
+
|
|
2233
|
+
Updates an existing power task (scheduled start/stop/restart operation) for a VPS service
|
|
2234
|
+
|
|
2235
|
+
:param update_power_task_request_content: (required)
|
|
2236
|
+
:type update_power_task_request_content: UpdatePowerTaskRequestContent
|
|
2237
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2238
|
+
number provided, it will be total request
|
|
2239
|
+
timeout. It can also be a pair (tuple) of
|
|
2240
|
+
(connection, read) timeouts.
|
|
2241
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2242
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2243
|
+
request; this effectively ignores the
|
|
2244
|
+
authentication in the spec for a single request.
|
|
2245
|
+
:type _request_auth: dict, optional
|
|
2246
|
+
:param _content_type: force content-type for the request.
|
|
2247
|
+
:type _content_type: str, Optional
|
|
2248
|
+
:param _headers: set to override the headers for a single
|
|
2249
|
+
request; this effectively ignores the headers
|
|
2250
|
+
in the spec for a single request.
|
|
2251
|
+
:type _headers: dict, optional
|
|
2252
|
+
:param _host_index: set to override the host_index for a single
|
|
2253
|
+
request; this effectively ignores the host_index
|
|
2254
|
+
in the spec for a single request.
|
|
2255
|
+
:type _host_index: int, optional
|
|
2256
|
+
:return: Returns the result object.
|
|
2257
|
+
""" # noqa: E501
|
|
2258
|
+
|
|
2259
|
+
_param = self._update_power_task_serialize(
|
|
2260
|
+
update_power_task_request_content=update_power_task_request_content,
|
|
2261
|
+
_request_auth=_request_auth,
|
|
2262
|
+
_content_type=_content_type,
|
|
2263
|
+
_headers=_headers,
|
|
2264
|
+
_host_index=_host_index
|
|
2265
|
+
)
|
|
2266
|
+
|
|
2267
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2268
|
+
'200': "UpdatePowerTaskResponseContent",
|
|
2269
|
+
'400': "BadRequestErrorResponseContent",
|
|
2270
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
2271
|
+
'403': "ForbiddenErrorResponseContent",
|
|
2272
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
2273
|
+
'422': "ValidationErrorResponseContent",
|
|
2274
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
2275
|
+
'500': "InternalServiceErrorResponseContent",
|
|
2276
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
2277
|
+
}
|
|
2278
|
+
response_data = self.api_client.call_api(
|
|
2279
|
+
*_param,
|
|
2280
|
+
_request_timeout=_request_timeout
|
|
2281
|
+
)
|
|
2282
|
+
response_data.read()
|
|
2283
|
+
return self.api_client.response_deserialize(
|
|
2284
|
+
response_data=response_data,
|
|
2285
|
+
response_types_map=_response_types_map,
|
|
2286
|
+
)
|
|
2287
|
+
|
|
2288
|
+
|
|
2289
|
+
@validate_call
|
|
2290
|
+
def update_power_task_without_preload_content(
|
|
2291
|
+
self,
|
|
2292
|
+
update_power_task_request_content: UpdatePowerTaskRequestContent,
|
|
2293
|
+
_request_timeout: Union[
|
|
2294
|
+
None,
|
|
2295
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2296
|
+
Tuple[
|
|
2297
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2298
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2299
|
+
]
|
|
2300
|
+
] = None,
|
|
2301
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2302
|
+
_content_type: Optional[StrictStr] = None,
|
|
2303
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2304
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2305
|
+
) -> RESTResponseType:
|
|
2306
|
+
"""update_power_task
|
|
2307
|
+
|
|
2308
|
+
Updates an existing power task (scheduled start/stop/restart operation) for a VPS service
|
|
2309
|
+
|
|
2310
|
+
:param update_power_task_request_content: (required)
|
|
2311
|
+
:type update_power_task_request_content: UpdatePowerTaskRequestContent
|
|
2312
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2313
|
+
number provided, it will be total request
|
|
2314
|
+
timeout. It can also be a pair (tuple) of
|
|
2315
|
+
(connection, read) timeouts.
|
|
2316
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2317
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2318
|
+
request; this effectively ignores the
|
|
2319
|
+
authentication in the spec for a single request.
|
|
2320
|
+
:type _request_auth: dict, optional
|
|
2321
|
+
:param _content_type: force content-type for the request.
|
|
2322
|
+
:type _content_type: str, Optional
|
|
2323
|
+
:param _headers: set to override the headers for a single
|
|
2324
|
+
request; this effectively ignores the headers
|
|
2325
|
+
in the spec for a single request.
|
|
2326
|
+
:type _headers: dict, optional
|
|
2327
|
+
:param _host_index: set to override the host_index for a single
|
|
2328
|
+
request; this effectively ignores the host_index
|
|
2329
|
+
in the spec for a single request.
|
|
2330
|
+
:type _host_index: int, optional
|
|
2331
|
+
:return: Returns the result object.
|
|
2332
|
+
""" # noqa: E501
|
|
2333
|
+
|
|
2334
|
+
_param = self._update_power_task_serialize(
|
|
2335
|
+
update_power_task_request_content=update_power_task_request_content,
|
|
2336
|
+
_request_auth=_request_auth,
|
|
2337
|
+
_content_type=_content_type,
|
|
2338
|
+
_headers=_headers,
|
|
2339
|
+
_host_index=_host_index
|
|
2340
|
+
)
|
|
2341
|
+
|
|
2342
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2343
|
+
'200': "UpdatePowerTaskResponseContent",
|
|
2344
|
+
'400': "BadRequestErrorResponseContent",
|
|
2345
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
2346
|
+
'403': "ForbiddenErrorResponseContent",
|
|
2347
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
2348
|
+
'422': "ValidationErrorResponseContent",
|
|
2349
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
2350
|
+
'500': "InternalServiceErrorResponseContent",
|
|
2351
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
2352
|
+
}
|
|
2353
|
+
response_data = self.api_client.call_api(
|
|
2354
|
+
*_param,
|
|
2355
|
+
_request_timeout=_request_timeout
|
|
2356
|
+
)
|
|
2357
|
+
return response_data.response
|
|
2358
|
+
|
|
2359
|
+
|
|
2360
|
+
def _update_power_task_serialize(
|
|
2361
|
+
self,
|
|
2362
|
+
update_power_task_request_content,
|
|
2363
|
+
_request_auth,
|
|
2364
|
+
_content_type,
|
|
2365
|
+
_headers,
|
|
2366
|
+
_host_index,
|
|
2367
|
+
) -> RequestSerialized:
|
|
2368
|
+
|
|
2369
|
+
_host = None
|
|
2370
|
+
|
|
2371
|
+
_collection_formats: Dict[str, str] = {
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
_path_params: Dict[str, str] = {}
|
|
2375
|
+
_query_params: List[Tuple[str, str]] = []
|
|
2376
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
2377
|
+
_form_params: List[Tuple[str, str]] = []
|
|
2378
|
+
_files: Dict[
|
|
2379
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
2380
|
+
] = {}
|
|
2381
|
+
_body_params: Optional[bytes] = None
|
|
2382
|
+
|
|
2383
|
+
# process the path parameters
|
|
2384
|
+
# process the query parameters
|
|
2385
|
+
# process the header parameters
|
|
2386
|
+
# process the form parameters
|
|
2387
|
+
# process the body parameter
|
|
2388
|
+
if update_power_task_request_content is not None:
|
|
2389
|
+
_body_params = update_power_task_request_content
|
|
2390
|
+
|
|
2391
|
+
|
|
2392
|
+
# set the HTTP header `Accept`
|
|
2393
|
+
if 'Accept' not in _header_params:
|
|
2394
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
2395
|
+
[
|
|
2396
|
+
'application/json'
|
|
2397
|
+
]
|
|
2398
|
+
)
|
|
2399
|
+
|
|
2400
|
+
# set the HTTP header `Content-Type`
|
|
2401
|
+
if _content_type:
|
|
2402
|
+
_header_params['Content-Type'] = _content_type
|
|
2403
|
+
else:
|
|
2404
|
+
_default_content_type = (
|
|
2405
|
+
self.api_client.select_header_content_type(
|
|
2406
|
+
[
|
|
2407
|
+
'application/json'
|
|
2408
|
+
]
|
|
2409
|
+
)
|
|
2410
|
+
)
|
|
2411
|
+
if _default_content_type is not None:
|
|
2412
|
+
_header_params['Content-Type'] = _default_content_type
|
|
2413
|
+
|
|
2414
|
+
# authentication setting
|
|
2415
|
+
_auth_settings: List[str] = [
|
|
2416
|
+
'BearerAuth'
|
|
2417
|
+
]
|
|
2418
|
+
|
|
2419
|
+
return self.api_client.param_serialize(
|
|
2420
|
+
method='POST',
|
|
2421
|
+
resource_path='/vps/update-power-task',
|
|
2422
|
+
path_params=_path_params,
|
|
2423
|
+
query_params=_query_params,
|
|
2424
|
+
header_params=_header_params,
|
|
2425
|
+
body=_body_params,
|
|
2426
|
+
post_params=_form_params,
|
|
2427
|
+
files=_files,
|
|
2428
|
+
auth_settings=_auth_settings,
|
|
2429
|
+
collection_formats=_collection_formats,
|
|
2430
|
+
_host=_host,
|
|
2431
|
+
_request_auth=_request_auth
|
|
2432
|
+
)
|
|
2433
|
+
|
|
2434
|
+
|