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,1234 @@
|
|
|
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_notification_request_content import CreateNotificationRequestContent
|
|
19
|
+
from ha_sdk_python.models.create_notification_response_content import CreateNotificationResponseContent
|
|
20
|
+
from ha_sdk_python.models.delete_notification_request_content import DeleteNotificationRequestContent
|
|
21
|
+
from ha_sdk_python.models.delete_notification_response_content import DeleteNotificationResponseContent
|
|
22
|
+
from ha_sdk_python.models.list_notifications_request_content import ListNotificationsRequestContent
|
|
23
|
+
from ha_sdk_python.models.list_notifications_response_content import ListNotificationsResponseContent
|
|
24
|
+
from ha_sdk_python.models.update_notification_request_content import UpdateNotificationRequestContent
|
|
25
|
+
from ha_sdk_python.models.update_notification_response_content import UpdateNotificationResponseContent
|
|
26
|
+
|
|
27
|
+
from ha_sdk_python.api_client import ApiClient, RequestSerialized
|
|
28
|
+
from ha_sdk_python.api_response import ApiResponse
|
|
29
|
+
from ha_sdk_python.rest import RESTResponseType
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class MonitoringApi:
|
|
33
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
34
|
+
Ref: https://openapi-generator.tech
|
|
35
|
+
|
|
36
|
+
Do not edit the class manually.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def __init__(self, api_client=None) -> None:
|
|
40
|
+
if api_client is None:
|
|
41
|
+
api_client = ApiClient.get_default()
|
|
42
|
+
self.api_client = api_client
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@validate_call
|
|
46
|
+
def create_notification(
|
|
47
|
+
self,
|
|
48
|
+
create_notification_request_content: CreateNotificationRequestContent,
|
|
49
|
+
_request_timeout: Union[
|
|
50
|
+
None,
|
|
51
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
52
|
+
Tuple[
|
|
53
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
54
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
55
|
+
]
|
|
56
|
+
] = None,
|
|
57
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
58
|
+
_content_type: Optional[StrictStr] = None,
|
|
59
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
60
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
61
|
+
) -> CreateNotificationResponseContent:
|
|
62
|
+
"""create_notification
|
|
63
|
+
|
|
64
|
+
Creates a new notification for a VPS service with customizable thresholds for CPU, memory, network, and disk metrics
|
|
65
|
+
|
|
66
|
+
:param create_notification_request_content: (required)
|
|
67
|
+
:type create_notification_request_content: CreateNotificationRequestContent
|
|
68
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
69
|
+
number provided, it will be total request
|
|
70
|
+
timeout. It can also be a pair (tuple) of
|
|
71
|
+
(connection, read) timeouts.
|
|
72
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
73
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
74
|
+
request; this effectively ignores the
|
|
75
|
+
authentication in the spec for a single request.
|
|
76
|
+
:type _request_auth: dict, optional
|
|
77
|
+
:param _content_type: force content-type for the request.
|
|
78
|
+
:type _content_type: str, Optional
|
|
79
|
+
:param _headers: set to override the headers for a single
|
|
80
|
+
request; this effectively ignores the headers
|
|
81
|
+
in the spec for a single request.
|
|
82
|
+
:type _headers: dict, optional
|
|
83
|
+
:param _host_index: set to override the host_index for a single
|
|
84
|
+
request; this effectively ignores the host_index
|
|
85
|
+
in the spec for a single request.
|
|
86
|
+
:type _host_index: int, optional
|
|
87
|
+
:return: Returns the result object.
|
|
88
|
+
""" # noqa: E501
|
|
89
|
+
|
|
90
|
+
_param = self._create_notification_serialize(
|
|
91
|
+
create_notification_request_content=create_notification_request_content,
|
|
92
|
+
_request_auth=_request_auth,
|
|
93
|
+
_content_type=_content_type,
|
|
94
|
+
_headers=_headers,
|
|
95
|
+
_host_index=_host_index
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
99
|
+
'200': "CreateNotificationResponseContent",
|
|
100
|
+
'400': "BadRequestErrorResponseContent",
|
|
101
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
102
|
+
'403': "ForbiddenErrorResponseContent",
|
|
103
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
104
|
+
'422': "ValidationErrorResponseContent",
|
|
105
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
106
|
+
'500': "InternalServiceErrorResponseContent",
|
|
107
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
108
|
+
}
|
|
109
|
+
response_data = self.api_client.call_api(
|
|
110
|
+
*_param,
|
|
111
|
+
_request_timeout=_request_timeout
|
|
112
|
+
)
|
|
113
|
+
response_data.read()
|
|
114
|
+
return self.api_client.response_deserialize(
|
|
115
|
+
response_data=response_data,
|
|
116
|
+
response_types_map=_response_types_map,
|
|
117
|
+
).data
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@validate_call
|
|
121
|
+
def create_notification_with_http_info(
|
|
122
|
+
self,
|
|
123
|
+
create_notification_request_content: CreateNotificationRequestContent,
|
|
124
|
+
_request_timeout: Union[
|
|
125
|
+
None,
|
|
126
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
127
|
+
Tuple[
|
|
128
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
129
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
130
|
+
]
|
|
131
|
+
] = None,
|
|
132
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
133
|
+
_content_type: Optional[StrictStr] = None,
|
|
134
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
135
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
136
|
+
) -> ApiResponse[CreateNotificationResponseContent]:
|
|
137
|
+
"""create_notification
|
|
138
|
+
|
|
139
|
+
Creates a new notification for a VPS service with customizable thresholds for CPU, memory, network, and disk metrics
|
|
140
|
+
|
|
141
|
+
:param create_notification_request_content: (required)
|
|
142
|
+
:type create_notification_request_content: CreateNotificationRequestContent
|
|
143
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
144
|
+
number provided, it will be total request
|
|
145
|
+
timeout. It can also be a pair (tuple) of
|
|
146
|
+
(connection, read) timeouts.
|
|
147
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
148
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
149
|
+
request; this effectively ignores the
|
|
150
|
+
authentication in the spec for a single request.
|
|
151
|
+
:type _request_auth: dict, optional
|
|
152
|
+
:param _content_type: force content-type for the request.
|
|
153
|
+
:type _content_type: str, Optional
|
|
154
|
+
:param _headers: set to override the headers for a single
|
|
155
|
+
request; this effectively ignores the headers
|
|
156
|
+
in the spec for a single request.
|
|
157
|
+
:type _headers: dict, optional
|
|
158
|
+
:param _host_index: set to override the host_index for a single
|
|
159
|
+
request; this effectively ignores the host_index
|
|
160
|
+
in the spec for a single request.
|
|
161
|
+
:type _host_index: int, optional
|
|
162
|
+
:return: Returns the result object.
|
|
163
|
+
""" # noqa: E501
|
|
164
|
+
|
|
165
|
+
_param = self._create_notification_serialize(
|
|
166
|
+
create_notification_request_content=create_notification_request_content,
|
|
167
|
+
_request_auth=_request_auth,
|
|
168
|
+
_content_type=_content_type,
|
|
169
|
+
_headers=_headers,
|
|
170
|
+
_host_index=_host_index
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
174
|
+
'200': "CreateNotificationResponseContent",
|
|
175
|
+
'400': "BadRequestErrorResponseContent",
|
|
176
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
177
|
+
'403': "ForbiddenErrorResponseContent",
|
|
178
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
179
|
+
'422': "ValidationErrorResponseContent",
|
|
180
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
181
|
+
'500': "InternalServiceErrorResponseContent",
|
|
182
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
183
|
+
}
|
|
184
|
+
response_data = self.api_client.call_api(
|
|
185
|
+
*_param,
|
|
186
|
+
_request_timeout=_request_timeout
|
|
187
|
+
)
|
|
188
|
+
response_data.read()
|
|
189
|
+
return self.api_client.response_deserialize(
|
|
190
|
+
response_data=response_data,
|
|
191
|
+
response_types_map=_response_types_map,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
@validate_call
|
|
196
|
+
def create_notification_without_preload_content(
|
|
197
|
+
self,
|
|
198
|
+
create_notification_request_content: CreateNotificationRequestContent,
|
|
199
|
+
_request_timeout: Union[
|
|
200
|
+
None,
|
|
201
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
202
|
+
Tuple[
|
|
203
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
204
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
205
|
+
]
|
|
206
|
+
] = None,
|
|
207
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
208
|
+
_content_type: Optional[StrictStr] = None,
|
|
209
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
210
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
211
|
+
) -> RESTResponseType:
|
|
212
|
+
"""create_notification
|
|
213
|
+
|
|
214
|
+
Creates a new notification for a VPS service with customizable thresholds for CPU, memory, network, and disk metrics
|
|
215
|
+
|
|
216
|
+
:param create_notification_request_content: (required)
|
|
217
|
+
:type create_notification_request_content: CreateNotificationRequestContent
|
|
218
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
219
|
+
number provided, it will be total request
|
|
220
|
+
timeout. It can also be a pair (tuple) of
|
|
221
|
+
(connection, read) timeouts.
|
|
222
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
223
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
224
|
+
request; this effectively ignores the
|
|
225
|
+
authentication in the spec for a single request.
|
|
226
|
+
:type _request_auth: dict, optional
|
|
227
|
+
:param _content_type: force content-type for the request.
|
|
228
|
+
:type _content_type: str, Optional
|
|
229
|
+
:param _headers: set to override the headers for a single
|
|
230
|
+
request; this effectively ignores the headers
|
|
231
|
+
in the spec for a single request.
|
|
232
|
+
:type _headers: dict, optional
|
|
233
|
+
:param _host_index: set to override the host_index for a single
|
|
234
|
+
request; this effectively ignores the host_index
|
|
235
|
+
in the spec for a single request.
|
|
236
|
+
:type _host_index: int, optional
|
|
237
|
+
:return: Returns the result object.
|
|
238
|
+
""" # noqa: E501
|
|
239
|
+
|
|
240
|
+
_param = self._create_notification_serialize(
|
|
241
|
+
create_notification_request_content=create_notification_request_content,
|
|
242
|
+
_request_auth=_request_auth,
|
|
243
|
+
_content_type=_content_type,
|
|
244
|
+
_headers=_headers,
|
|
245
|
+
_host_index=_host_index
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
249
|
+
'200': "CreateNotificationResponseContent",
|
|
250
|
+
'400': "BadRequestErrorResponseContent",
|
|
251
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
252
|
+
'403': "ForbiddenErrorResponseContent",
|
|
253
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
254
|
+
'422': "ValidationErrorResponseContent",
|
|
255
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
256
|
+
'500': "InternalServiceErrorResponseContent",
|
|
257
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
258
|
+
}
|
|
259
|
+
response_data = self.api_client.call_api(
|
|
260
|
+
*_param,
|
|
261
|
+
_request_timeout=_request_timeout
|
|
262
|
+
)
|
|
263
|
+
return response_data.response
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def _create_notification_serialize(
|
|
267
|
+
self,
|
|
268
|
+
create_notification_request_content,
|
|
269
|
+
_request_auth,
|
|
270
|
+
_content_type,
|
|
271
|
+
_headers,
|
|
272
|
+
_host_index,
|
|
273
|
+
) -> RequestSerialized:
|
|
274
|
+
|
|
275
|
+
_host = None
|
|
276
|
+
|
|
277
|
+
_collection_formats: Dict[str, str] = {
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
_path_params: Dict[str, str] = {}
|
|
281
|
+
_query_params: List[Tuple[str, str]] = []
|
|
282
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
283
|
+
_form_params: List[Tuple[str, str]] = []
|
|
284
|
+
_files: Dict[
|
|
285
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
286
|
+
] = {}
|
|
287
|
+
_body_params: Optional[bytes] = None
|
|
288
|
+
|
|
289
|
+
# process the path parameters
|
|
290
|
+
# process the query parameters
|
|
291
|
+
# process the header parameters
|
|
292
|
+
# process the form parameters
|
|
293
|
+
# process the body parameter
|
|
294
|
+
if create_notification_request_content is not None:
|
|
295
|
+
_body_params = create_notification_request_content
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
# set the HTTP header `Accept`
|
|
299
|
+
if 'Accept' not in _header_params:
|
|
300
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
301
|
+
[
|
|
302
|
+
'application/json'
|
|
303
|
+
]
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
# set the HTTP header `Content-Type`
|
|
307
|
+
if _content_type:
|
|
308
|
+
_header_params['Content-Type'] = _content_type
|
|
309
|
+
else:
|
|
310
|
+
_default_content_type = (
|
|
311
|
+
self.api_client.select_header_content_type(
|
|
312
|
+
[
|
|
313
|
+
'application/json'
|
|
314
|
+
]
|
|
315
|
+
)
|
|
316
|
+
)
|
|
317
|
+
if _default_content_type is not None:
|
|
318
|
+
_header_params['Content-Type'] = _default_content_type
|
|
319
|
+
|
|
320
|
+
# authentication setting
|
|
321
|
+
_auth_settings: List[str] = [
|
|
322
|
+
'BearerAuth'
|
|
323
|
+
]
|
|
324
|
+
|
|
325
|
+
return self.api_client.param_serialize(
|
|
326
|
+
method='POST',
|
|
327
|
+
resource_path='/vps/create-notification',
|
|
328
|
+
path_params=_path_params,
|
|
329
|
+
query_params=_query_params,
|
|
330
|
+
header_params=_header_params,
|
|
331
|
+
body=_body_params,
|
|
332
|
+
post_params=_form_params,
|
|
333
|
+
files=_files,
|
|
334
|
+
auth_settings=_auth_settings,
|
|
335
|
+
collection_formats=_collection_formats,
|
|
336
|
+
_host=_host,
|
|
337
|
+
_request_auth=_request_auth
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
@validate_call
|
|
344
|
+
def delete_notification(
|
|
345
|
+
self,
|
|
346
|
+
delete_notification_request_content: DeleteNotificationRequestContent,
|
|
347
|
+
_request_timeout: Union[
|
|
348
|
+
None,
|
|
349
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
350
|
+
Tuple[
|
|
351
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
352
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
353
|
+
]
|
|
354
|
+
] = None,
|
|
355
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
356
|
+
_content_type: Optional[StrictStr] = None,
|
|
357
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
358
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
359
|
+
) -> DeleteNotificationResponseContent:
|
|
360
|
+
"""delete_notification
|
|
361
|
+
|
|
362
|
+
Deletes a notification from a VPS service
|
|
363
|
+
|
|
364
|
+
:param delete_notification_request_content: (required)
|
|
365
|
+
:type delete_notification_request_content: DeleteNotificationRequestContent
|
|
366
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
367
|
+
number provided, it will be total request
|
|
368
|
+
timeout. It can also be a pair (tuple) of
|
|
369
|
+
(connection, read) timeouts.
|
|
370
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
371
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
372
|
+
request; this effectively ignores the
|
|
373
|
+
authentication in the spec for a single request.
|
|
374
|
+
:type _request_auth: dict, optional
|
|
375
|
+
:param _content_type: force content-type for the request.
|
|
376
|
+
:type _content_type: str, Optional
|
|
377
|
+
:param _headers: set to override the headers for a single
|
|
378
|
+
request; this effectively ignores the headers
|
|
379
|
+
in the spec for a single request.
|
|
380
|
+
:type _headers: dict, optional
|
|
381
|
+
:param _host_index: set to override the host_index for a single
|
|
382
|
+
request; this effectively ignores the host_index
|
|
383
|
+
in the spec for a single request.
|
|
384
|
+
:type _host_index: int, optional
|
|
385
|
+
:return: Returns the result object.
|
|
386
|
+
""" # noqa: E501
|
|
387
|
+
|
|
388
|
+
_param = self._delete_notification_serialize(
|
|
389
|
+
delete_notification_request_content=delete_notification_request_content,
|
|
390
|
+
_request_auth=_request_auth,
|
|
391
|
+
_content_type=_content_type,
|
|
392
|
+
_headers=_headers,
|
|
393
|
+
_host_index=_host_index
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
397
|
+
'200': "DeleteNotificationResponseContent",
|
|
398
|
+
'400': "BadRequestErrorResponseContent",
|
|
399
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
400
|
+
'403': "ForbiddenErrorResponseContent",
|
|
401
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
402
|
+
'422': "ValidationErrorResponseContent",
|
|
403
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
404
|
+
'500': "InternalServiceErrorResponseContent",
|
|
405
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
406
|
+
}
|
|
407
|
+
response_data = self.api_client.call_api(
|
|
408
|
+
*_param,
|
|
409
|
+
_request_timeout=_request_timeout
|
|
410
|
+
)
|
|
411
|
+
response_data.read()
|
|
412
|
+
return self.api_client.response_deserialize(
|
|
413
|
+
response_data=response_data,
|
|
414
|
+
response_types_map=_response_types_map,
|
|
415
|
+
).data
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
@validate_call
|
|
419
|
+
def delete_notification_with_http_info(
|
|
420
|
+
self,
|
|
421
|
+
delete_notification_request_content: DeleteNotificationRequestContent,
|
|
422
|
+
_request_timeout: Union[
|
|
423
|
+
None,
|
|
424
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
425
|
+
Tuple[
|
|
426
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
427
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
428
|
+
]
|
|
429
|
+
] = None,
|
|
430
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
431
|
+
_content_type: Optional[StrictStr] = None,
|
|
432
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
433
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
434
|
+
) -> ApiResponse[DeleteNotificationResponseContent]:
|
|
435
|
+
"""delete_notification
|
|
436
|
+
|
|
437
|
+
Deletes a notification from a VPS service
|
|
438
|
+
|
|
439
|
+
:param delete_notification_request_content: (required)
|
|
440
|
+
:type delete_notification_request_content: DeleteNotificationRequestContent
|
|
441
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
442
|
+
number provided, it will be total request
|
|
443
|
+
timeout. It can also be a pair (tuple) of
|
|
444
|
+
(connection, read) timeouts.
|
|
445
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
446
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
447
|
+
request; this effectively ignores the
|
|
448
|
+
authentication in the spec for a single request.
|
|
449
|
+
:type _request_auth: dict, optional
|
|
450
|
+
:param _content_type: force content-type for the request.
|
|
451
|
+
:type _content_type: str, Optional
|
|
452
|
+
:param _headers: set to override the headers for a single
|
|
453
|
+
request; this effectively ignores the headers
|
|
454
|
+
in the spec for a single request.
|
|
455
|
+
:type _headers: dict, optional
|
|
456
|
+
:param _host_index: set to override the host_index for a single
|
|
457
|
+
request; this effectively ignores the host_index
|
|
458
|
+
in the spec for a single request.
|
|
459
|
+
:type _host_index: int, optional
|
|
460
|
+
:return: Returns the result object.
|
|
461
|
+
""" # noqa: E501
|
|
462
|
+
|
|
463
|
+
_param = self._delete_notification_serialize(
|
|
464
|
+
delete_notification_request_content=delete_notification_request_content,
|
|
465
|
+
_request_auth=_request_auth,
|
|
466
|
+
_content_type=_content_type,
|
|
467
|
+
_headers=_headers,
|
|
468
|
+
_host_index=_host_index
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
472
|
+
'200': "DeleteNotificationResponseContent",
|
|
473
|
+
'400': "BadRequestErrorResponseContent",
|
|
474
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
475
|
+
'403': "ForbiddenErrorResponseContent",
|
|
476
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
477
|
+
'422': "ValidationErrorResponseContent",
|
|
478
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
479
|
+
'500': "InternalServiceErrorResponseContent",
|
|
480
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
481
|
+
}
|
|
482
|
+
response_data = self.api_client.call_api(
|
|
483
|
+
*_param,
|
|
484
|
+
_request_timeout=_request_timeout
|
|
485
|
+
)
|
|
486
|
+
response_data.read()
|
|
487
|
+
return self.api_client.response_deserialize(
|
|
488
|
+
response_data=response_data,
|
|
489
|
+
response_types_map=_response_types_map,
|
|
490
|
+
)
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
@validate_call
|
|
494
|
+
def delete_notification_without_preload_content(
|
|
495
|
+
self,
|
|
496
|
+
delete_notification_request_content: DeleteNotificationRequestContent,
|
|
497
|
+
_request_timeout: Union[
|
|
498
|
+
None,
|
|
499
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
500
|
+
Tuple[
|
|
501
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
502
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
503
|
+
]
|
|
504
|
+
] = None,
|
|
505
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
506
|
+
_content_type: Optional[StrictStr] = None,
|
|
507
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
508
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
509
|
+
) -> RESTResponseType:
|
|
510
|
+
"""delete_notification
|
|
511
|
+
|
|
512
|
+
Deletes a notification from a VPS service
|
|
513
|
+
|
|
514
|
+
:param delete_notification_request_content: (required)
|
|
515
|
+
:type delete_notification_request_content: DeleteNotificationRequestContent
|
|
516
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
517
|
+
number provided, it will be total request
|
|
518
|
+
timeout. It can also be a pair (tuple) of
|
|
519
|
+
(connection, read) timeouts.
|
|
520
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
521
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
522
|
+
request; this effectively ignores the
|
|
523
|
+
authentication in the spec for a single request.
|
|
524
|
+
:type _request_auth: dict, optional
|
|
525
|
+
:param _content_type: force content-type for the request.
|
|
526
|
+
:type _content_type: str, Optional
|
|
527
|
+
:param _headers: set to override the headers for a single
|
|
528
|
+
request; this effectively ignores the headers
|
|
529
|
+
in the spec for a single request.
|
|
530
|
+
:type _headers: dict, optional
|
|
531
|
+
:param _host_index: set to override the host_index for a single
|
|
532
|
+
request; this effectively ignores the host_index
|
|
533
|
+
in the spec for a single request.
|
|
534
|
+
:type _host_index: int, optional
|
|
535
|
+
:return: Returns the result object.
|
|
536
|
+
""" # noqa: E501
|
|
537
|
+
|
|
538
|
+
_param = self._delete_notification_serialize(
|
|
539
|
+
delete_notification_request_content=delete_notification_request_content,
|
|
540
|
+
_request_auth=_request_auth,
|
|
541
|
+
_content_type=_content_type,
|
|
542
|
+
_headers=_headers,
|
|
543
|
+
_host_index=_host_index
|
|
544
|
+
)
|
|
545
|
+
|
|
546
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
547
|
+
'200': "DeleteNotificationResponseContent",
|
|
548
|
+
'400': "BadRequestErrorResponseContent",
|
|
549
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
550
|
+
'403': "ForbiddenErrorResponseContent",
|
|
551
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
552
|
+
'422': "ValidationErrorResponseContent",
|
|
553
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
554
|
+
'500': "InternalServiceErrorResponseContent",
|
|
555
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
556
|
+
}
|
|
557
|
+
response_data = self.api_client.call_api(
|
|
558
|
+
*_param,
|
|
559
|
+
_request_timeout=_request_timeout
|
|
560
|
+
)
|
|
561
|
+
return response_data.response
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
def _delete_notification_serialize(
|
|
565
|
+
self,
|
|
566
|
+
delete_notification_request_content,
|
|
567
|
+
_request_auth,
|
|
568
|
+
_content_type,
|
|
569
|
+
_headers,
|
|
570
|
+
_host_index,
|
|
571
|
+
) -> RequestSerialized:
|
|
572
|
+
|
|
573
|
+
_host = None
|
|
574
|
+
|
|
575
|
+
_collection_formats: Dict[str, str] = {
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
_path_params: Dict[str, str] = {}
|
|
579
|
+
_query_params: List[Tuple[str, str]] = []
|
|
580
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
581
|
+
_form_params: List[Tuple[str, str]] = []
|
|
582
|
+
_files: Dict[
|
|
583
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
584
|
+
] = {}
|
|
585
|
+
_body_params: Optional[bytes] = None
|
|
586
|
+
|
|
587
|
+
# process the path parameters
|
|
588
|
+
# process the query parameters
|
|
589
|
+
# process the header parameters
|
|
590
|
+
# process the form parameters
|
|
591
|
+
# process the body parameter
|
|
592
|
+
if delete_notification_request_content is not None:
|
|
593
|
+
_body_params = delete_notification_request_content
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
# set the HTTP header `Accept`
|
|
597
|
+
if 'Accept' not in _header_params:
|
|
598
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
599
|
+
[
|
|
600
|
+
'application/json'
|
|
601
|
+
]
|
|
602
|
+
)
|
|
603
|
+
|
|
604
|
+
# set the HTTP header `Content-Type`
|
|
605
|
+
if _content_type:
|
|
606
|
+
_header_params['Content-Type'] = _content_type
|
|
607
|
+
else:
|
|
608
|
+
_default_content_type = (
|
|
609
|
+
self.api_client.select_header_content_type(
|
|
610
|
+
[
|
|
611
|
+
'application/json'
|
|
612
|
+
]
|
|
613
|
+
)
|
|
614
|
+
)
|
|
615
|
+
if _default_content_type is not None:
|
|
616
|
+
_header_params['Content-Type'] = _default_content_type
|
|
617
|
+
|
|
618
|
+
# authentication setting
|
|
619
|
+
_auth_settings: List[str] = [
|
|
620
|
+
'BearerAuth'
|
|
621
|
+
]
|
|
622
|
+
|
|
623
|
+
return self.api_client.param_serialize(
|
|
624
|
+
method='POST',
|
|
625
|
+
resource_path='/vps/delete-notification',
|
|
626
|
+
path_params=_path_params,
|
|
627
|
+
query_params=_query_params,
|
|
628
|
+
header_params=_header_params,
|
|
629
|
+
body=_body_params,
|
|
630
|
+
post_params=_form_params,
|
|
631
|
+
files=_files,
|
|
632
|
+
auth_settings=_auth_settings,
|
|
633
|
+
collection_formats=_collection_formats,
|
|
634
|
+
_host=_host,
|
|
635
|
+
_request_auth=_request_auth
|
|
636
|
+
)
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
@validate_call
|
|
642
|
+
def list_notifications(
|
|
643
|
+
self,
|
|
644
|
+
list_notifications_request_content: ListNotificationsRequestContent,
|
|
645
|
+
_request_timeout: Union[
|
|
646
|
+
None,
|
|
647
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
648
|
+
Tuple[
|
|
649
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
650
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
651
|
+
]
|
|
652
|
+
] = None,
|
|
653
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
654
|
+
_content_type: Optional[StrictStr] = None,
|
|
655
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
656
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
657
|
+
) -> ListNotificationsResponseContent:
|
|
658
|
+
"""list_notifications
|
|
659
|
+
|
|
660
|
+
Retrieves the list of notifications for a VPS service along with dialog rules for creating notifications
|
|
661
|
+
|
|
662
|
+
:param list_notifications_request_content: (required)
|
|
663
|
+
:type list_notifications_request_content: ListNotificationsRequestContent
|
|
664
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
665
|
+
number provided, it will be total request
|
|
666
|
+
timeout. It can also be a pair (tuple) of
|
|
667
|
+
(connection, read) timeouts.
|
|
668
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
669
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
670
|
+
request; this effectively ignores the
|
|
671
|
+
authentication in the spec for a single request.
|
|
672
|
+
:type _request_auth: dict, optional
|
|
673
|
+
:param _content_type: force content-type for the request.
|
|
674
|
+
:type _content_type: str, Optional
|
|
675
|
+
:param _headers: set to override the headers for a single
|
|
676
|
+
request; this effectively ignores the headers
|
|
677
|
+
in the spec for a single request.
|
|
678
|
+
:type _headers: dict, optional
|
|
679
|
+
:param _host_index: set to override the host_index for a single
|
|
680
|
+
request; this effectively ignores the host_index
|
|
681
|
+
in the spec for a single request.
|
|
682
|
+
:type _host_index: int, optional
|
|
683
|
+
:return: Returns the result object.
|
|
684
|
+
""" # noqa: E501
|
|
685
|
+
|
|
686
|
+
_param = self._list_notifications_serialize(
|
|
687
|
+
list_notifications_request_content=list_notifications_request_content,
|
|
688
|
+
_request_auth=_request_auth,
|
|
689
|
+
_content_type=_content_type,
|
|
690
|
+
_headers=_headers,
|
|
691
|
+
_host_index=_host_index
|
|
692
|
+
)
|
|
693
|
+
|
|
694
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
695
|
+
'200': "ListNotificationsResponseContent",
|
|
696
|
+
'400': "BadRequestErrorResponseContent",
|
|
697
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
698
|
+
'403': "ForbiddenErrorResponseContent",
|
|
699
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
700
|
+
'422': "ValidationErrorResponseContent",
|
|
701
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
702
|
+
'500': "InternalServiceErrorResponseContent",
|
|
703
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
704
|
+
}
|
|
705
|
+
response_data = self.api_client.call_api(
|
|
706
|
+
*_param,
|
|
707
|
+
_request_timeout=_request_timeout
|
|
708
|
+
)
|
|
709
|
+
response_data.read()
|
|
710
|
+
return self.api_client.response_deserialize(
|
|
711
|
+
response_data=response_data,
|
|
712
|
+
response_types_map=_response_types_map,
|
|
713
|
+
).data
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
@validate_call
|
|
717
|
+
def list_notifications_with_http_info(
|
|
718
|
+
self,
|
|
719
|
+
list_notifications_request_content: ListNotificationsRequestContent,
|
|
720
|
+
_request_timeout: Union[
|
|
721
|
+
None,
|
|
722
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
723
|
+
Tuple[
|
|
724
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
725
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
726
|
+
]
|
|
727
|
+
] = None,
|
|
728
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
729
|
+
_content_type: Optional[StrictStr] = None,
|
|
730
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
731
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
732
|
+
) -> ApiResponse[ListNotificationsResponseContent]:
|
|
733
|
+
"""list_notifications
|
|
734
|
+
|
|
735
|
+
Retrieves the list of notifications for a VPS service along with dialog rules for creating notifications
|
|
736
|
+
|
|
737
|
+
:param list_notifications_request_content: (required)
|
|
738
|
+
:type list_notifications_request_content: ListNotificationsRequestContent
|
|
739
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
740
|
+
number provided, it will be total request
|
|
741
|
+
timeout. It can also be a pair (tuple) of
|
|
742
|
+
(connection, read) timeouts.
|
|
743
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
744
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
745
|
+
request; this effectively ignores the
|
|
746
|
+
authentication in the spec for a single request.
|
|
747
|
+
:type _request_auth: dict, optional
|
|
748
|
+
:param _content_type: force content-type for the request.
|
|
749
|
+
:type _content_type: str, Optional
|
|
750
|
+
:param _headers: set to override the headers for a single
|
|
751
|
+
request; this effectively ignores the headers
|
|
752
|
+
in the spec for a single request.
|
|
753
|
+
:type _headers: dict, optional
|
|
754
|
+
:param _host_index: set to override the host_index for a single
|
|
755
|
+
request; this effectively ignores the host_index
|
|
756
|
+
in the spec for a single request.
|
|
757
|
+
:type _host_index: int, optional
|
|
758
|
+
:return: Returns the result object.
|
|
759
|
+
""" # noqa: E501
|
|
760
|
+
|
|
761
|
+
_param = self._list_notifications_serialize(
|
|
762
|
+
list_notifications_request_content=list_notifications_request_content,
|
|
763
|
+
_request_auth=_request_auth,
|
|
764
|
+
_content_type=_content_type,
|
|
765
|
+
_headers=_headers,
|
|
766
|
+
_host_index=_host_index
|
|
767
|
+
)
|
|
768
|
+
|
|
769
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
770
|
+
'200': "ListNotificationsResponseContent",
|
|
771
|
+
'400': "BadRequestErrorResponseContent",
|
|
772
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
773
|
+
'403': "ForbiddenErrorResponseContent",
|
|
774
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
775
|
+
'422': "ValidationErrorResponseContent",
|
|
776
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
777
|
+
'500': "InternalServiceErrorResponseContent",
|
|
778
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
779
|
+
}
|
|
780
|
+
response_data = self.api_client.call_api(
|
|
781
|
+
*_param,
|
|
782
|
+
_request_timeout=_request_timeout
|
|
783
|
+
)
|
|
784
|
+
response_data.read()
|
|
785
|
+
return self.api_client.response_deserialize(
|
|
786
|
+
response_data=response_data,
|
|
787
|
+
response_types_map=_response_types_map,
|
|
788
|
+
)
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
@validate_call
|
|
792
|
+
def list_notifications_without_preload_content(
|
|
793
|
+
self,
|
|
794
|
+
list_notifications_request_content: ListNotificationsRequestContent,
|
|
795
|
+
_request_timeout: Union[
|
|
796
|
+
None,
|
|
797
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
798
|
+
Tuple[
|
|
799
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
800
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
801
|
+
]
|
|
802
|
+
] = None,
|
|
803
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
804
|
+
_content_type: Optional[StrictStr] = None,
|
|
805
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
806
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
807
|
+
) -> RESTResponseType:
|
|
808
|
+
"""list_notifications
|
|
809
|
+
|
|
810
|
+
Retrieves the list of notifications for a VPS service along with dialog rules for creating notifications
|
|
811
|
+
|
|
812
|
+
:param list_notifications_request_content: (required)
|
|
813
|
+
:type list_notifications_request_content: ListNotificationsRequestContent
|
|
814
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
815
|
+
number provided, it will be total request
|
|
816
|
+
timeout. It can also be a pair (tuple) of
|
|
817
|
+
(connection, read) timeouts.
|
|
818
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
819
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
820
|
+
request; this effectively ignores the
|
|
821
|
+
authentication in the spec for a single request.
|
|
822
|
+
:type _request_auth: dict, optional
|
|
823
|
+
:param _content_type: force content-type for the request.
|
|
824
|
+
:type _content_type: str, Optional
|
|
825
|
+
:param _headers: set to override the headers for a single
|
|
826
|
+
request; this effectively ignores the headers
|
|
827
|
+
in the spec for a single request.
|
|
828
|
+
:type _headers: dict, optional
|
|
829
|
+
:param _host_index: set to override the host_index for a single
|
|
830
|
+
request; this effectively ignores the host_index
|
|
831
|
+
in the spec for a single request.
|
|
832
|
+
:type _host_index: int, optional
|
|
833
|
+
:return: Returns the result object.
|
|
834
|
+
""" # noqa: E501
|
|
835
|
+
|
|
836
|
+
_param = self._list_notifications_serialize(
|
|
837
|
+
list_notifications_request_content=list_notifications_request_content,
|
|
838
|
+
_request_auth=_request_auth,
|
|
839
|
+
_content_type=_content_type,
|
|
840
|
+
_headers=_headers,
|
|
841
|
+
_host_index=_host_index
|
|
842
|
+
)
|
|
843
|
+
|
|
844
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
845
|
+
'200': "ListNotificationsResponseContent",
|
|
846
|
+
'400': "BadRequestErrorResponseContent",
|
|
847
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
848
|
+
'403': "ForbiddenErrorResponseContent",
|
|
849
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
850
|
+
'422': "ValidationErrorResponseContent",
|
|
851
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
852
|
+
'500': "InternalServiceErrorResponseContent",
|
|
853
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
854
|
+
}
|
|
855
|
+
response_data = self.api_client.call_api(
|
|
856
|
+
*_param,
|
|
857
|
+
_request_timeout=_request_timeout
|
|
858
|
+
)
|
|
859
|
+
return response_data.response
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
def _list_notifications_serialize(
|
|
863
|
+
self,
|
|
864
|
+
list_notifications_request_content,
|
|
865
|
+
_request_auth,
|
|
866
|
+
_content_type,
|
|
867
|
+
_headers,
|
|
868
|
+
_host_index,
|
|
869
|
+
) -> RequestSerialized:
|
|
870
|
+
|
|
871
|
+
_host = None
|
|
872
|
+
|
|
873
|
+
_collection_formats: Dict[str, str] = {
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
_path_params: Dict[str, str] = {}
|
|
877
|
+
_query_params: List[Tuple[str, str]] = []
|
|
878
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
879
|
+
_form_params: List[Tuple[str, str]] = []
|
|
880
|
+
_files: Dict[
|
|
881
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
882
|
+
] = {}
|
|
883
|
+
_body_params: Optional[bytes] = None
|
|
884
|
+
|
|
885
|
+
# process the path parameters
|
|
886
|
+
# process the query parameters
|
|
887
|
+
# process the header parameters
|
|
888
|
+
# process the form parameters
|
|
889
|
+
# process the body parameter
|
|
890
|
+
if list_notifications_request_content is not None:
|
|
891
|
+
_body_params = list_notifications_request_content
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
# set the HTTP header `Accept`
|
|
895
|
+
if 'Accept' not in _header_params:
|
|
896
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
897
|
+
[
|
|
898
|
+
'application/json'
|
|
899
|
+
]
|
|
900
|
+
)
|
|
901
|
+
|
|
902
|
+
# set the HTTP header `Content-Type`
|
|
903
|
+
if _content_type:
|
|
904
|
+
_header_params['Content-Type'] = _content_type
|
|
905
|
+
else:
|
|
906
|
+
_default_content_type = (
|
|
907
|
+
self.api_client.select_header_content_type(
|
|
908
|
+
[
|
|
909
|
+
'application/json'
|
|
910
|
+
]
|
|
911
|
+
)
|
|
912
|
+
)
|
|
913
|
+
if _default_content_type is not None:
|
|
914
|
+
_header_params['Content-Type'] = _default_content_type
|
|
915
|
+
|
|
916
|
+
# authentication setting
|
|
917
|
+
_auth_settings: List[str] = [
|
|
918
|
+
'BearerAuth'
|
|
919
|
+
]
|
|
920
|
+
|
|
921
|
+
return self.api_client.param_serialize(
|
|
922
|
+
method='POST',
|
|
923
|
+
resource_path='/vps/list-notifications',
|
|
924
|
+
path_params=_path_params,
|
|
925
|
+
query_params=_query_params,
|
|
926
|
+
header_params=_header_params,
|
|
927
|
+
body=_body_params,
|
|
928
|
+
post_params=_form_params,
|
|
929
|
+
files=_files,
|
|
930
|
+
auth_settings=_auth_settings,
|
|
931
|
+
collection_formats=_collection_formats,
|
|
932
|
+
_host=_host,
|
|
933
|
+
_request_auth=_request_auth
|
|
934
|
+
)
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
@validate_call
|
|
940
|
+
def update_notification(
|
|
941
|
+
self,
|
|
942
|
+
update_notification_request_content: UpdateNotificationRequestContent,
|
|
943
|
+
_request_timeout: Union[
|
|
944
|
+
None,
|
|
945
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
946
|
+
Tuple[
|
|
947
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
948
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
949
|
+
]
|
|
950
|
+
] = None,
|
|
951
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
952
|
+
_content_type: Optional[StrictStr] = None,
|
|
953
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
954
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
955
|
+
) -> UpdateNotificationResponseContent:
|
|
956
|
+
"""update_notification
|
|
957
|
+
|
|
958
|
+
Updates an existing notification for a VPS service with customizable thresholds for CPU, memory, network, and disk metrics
|
|
959
|
+
|
|
960
|
+
:param update_notification_request_content: (required)
|
|
961
|
+
:type update_notification_request_content: UpdateNotificationRequestContent
|
|
962
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
963
|
+
number provided, it will be total request
|
|
964
|
+
timeout. It can also be a pair (tuple) of
|
|
965
|
+
(connection, read) timeouts.
|
|
966
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
967
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
968
|
+
request; this effectively ignores the
|
|
969
|
+
authentication in the spec for a single request.
|
|
970
|
+
:type _request_auth: dict, optional
|
|
971
|
+
:param _content_type: force content-type for the request.
|
|
972
|
+
:type _content_type: str, Optional
|
|
973
|
+
:param _headers: set to override the headers for a single
|
|
974
|
+
request; this effectively ignores the headers
|
|
975
|
+
in the spec for a single request.
|
|
976
|
+
:type _headers: dict, optional
|
|
977
|
+
:param _host_index: set to override the host_index for a single
|
|
978
|
+
request; this effectively ignores the host_index
|
|
979
|
+
in the spec for a single request.
|
|
980
|
+
:type _host_index: int, optional
|
|
981
|
+
:return: Returns the result object.
|
|
982
|
+
""" # noqa: E501
|
|
983
|
+
|
|
984
|
+
_param = self._update_notification_serialize(
|
|
985
|
+
update_notification_request_content=update_notification_request_content,
|
|
986
|
+
_request_auth=_request_auth,
|
|
987
|
+
_content_type=_content_type,
|
|
988
|
+
_headers=_headers,
|
|
989
|
+
_host_index=_host_index
|
|
990
|
+
)
|
|
991
|
+
|
|
992
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
993
|
+
'200': "UpdateNotificationResponseContent",
|
|
994
|
+
'400': "BadRequestErrorResponseContent",
|
|
995
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
996
|
+
'403': "ForbiddenErrorResponseContent",
|
|
997
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
998
|
+
'422': "ValidationErrorResponseContent",
|
|
999
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1000
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1001
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1002
|
+
}
|
|
1003
|
+
response_data = self.api_client.call_api(
|
|
1004
|
+
*_param,
|
|
1005
|
+
_request_timeout=_request_timeout
|
|
1006
|
+
)
|
|
1007
|
+
response_data.read()
|
|
1008
|
+
return self.api_client.response_deserialize(
|
|
1009
|
+
response_data=response_data,
|
|
1010
|
+
response_types_map=_response_types_map,
|
|
1011
|
+
).data
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
@validate_call
|
|
1015
|
+
def update_notification_with_http_info(
|
|
1016
|
+
self,
|
|
1017
|
+
update_notification_request_content: UpdateNotificationRequestContent,
|
|
1018
|
+
_request_timeout: Union[
|
|
1019
|
+
None,
|
|
1020
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1021
|
+
Tuple[
|
|
1022
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1023
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1024
|
+
]
|
|
1025
|
+
] = None,
|
|
1026
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1027
|
+
_content_type: Optional[StrictStr] = None,
|
|
1028
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1029
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1030
|
+
) -> ApiResponse[UpdateNotificationResponseContent]:
|
|
1031
|
+
"""update_notification
|
|
1032
|
+
|
|
1033
|
+
Updates an existing notification for a VPS service with customizable thresholds for CPU, memory, network, and disk metrics
|
|
1034
|
+
|
|
1035
|
+
:param update_notification_request_content: (required)
|
|
1036
|
+
:type update_notification_request_content: UpdateNotificationRequestContent
|
|
1037
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1038
|
+
number provided, it will be total request
|
|
1039
|
+
timeout. It can also be a pair (tuple) of
|
|
1040
|
+
(connection, read) timeouts.
|
|
1041
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1042
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1043
|
+
request; this effectively ignores the
|
|
1044
|
+
authentication in the spec for a single request.
|
|
1045
|
+
:type _request_auth: dict, optional
|
|
1046
|
+
:param _content_type: force content-type for the request.
|
|
1047
|
+
:type _content_type: str, Optional
|
|
1048
|
+
:param _headers: set to override the headers for a single
|
|
1049
|
+
request; this effectively ignores the headers
|
|
1050
|
+
in the spec for a single request.
|
|
1051
|
+
:type _headers: dict, optional
|
|
1052
|
+
:param _host_index: set to override the host_index for a single
|
|
1053
|
+
request; this effectively ignores the host_index
|
|
1054
|
+
in the spec for a single request.
|
|
1055
|
+
:type _host_index: int, optional
|
|
1056
|
+
:return: Returns the result object.
|
|
1057
|
+
""" # noqa: E501
|
|
1058
|
+
|
|
1059
|
+
_param = self._update_notification_serialize(
|
|
1060
|
+
update_notification_request_content=update_notification_request_content,
|
|
1061
|
+
_request_auth=_request_auth,
|
|
1062
|
+
_content_type=_content_type,
|
|
1063
|
+
_headers=_headers,
|
|
1064
|
+
_host_index=_host_index
|
|
1065
|
+
)
|
|
1066
|
+
|
|
1067
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1068
|
+
'200': "UpdateNotificationResponseContent",
|
|
1069
|
+
'400': "BadRequestErrorResponseContent",
|
|
1070
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1071
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1072
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1073
|
+
'422': "ValidationErrorResponseContent",
|
|
1074
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1075
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1076
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1077
|
+
}
|
|
1078
|
+
response_data = self.api_client.call_api(
|
|
1079
|
+
*_param,
|
|
1080
|
+
_request_timeout=_request_timeout
|
|
1081
|
+
)
|
|
1082
|
+
response_data.read()
|
|
1083
|
+
return self.api_client.response_deserialize(
|
|
1084
|
+
response_data=response_data,
|
|
1085
|
+
response_types_map=_response_types_map,
|
|
1086
|
+
)
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
@validate_call
|
|
1090
|
+
def update_notification_without_preload_content(
|
|
1091
|
+
self,
|
|
1092
|
+
update_notification_request_content: UpdateNotificationRequestContent,
|
|
1093
|
+
_request_timeout: Union[
|
|
1094
|
+
None,
|
|
1095
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1096
|
+
Tuple[
|
|
1097
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1098
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1099
|
+
]
|
|
1100
|
+
] = None,
|
|
1101
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1102
|
+
_content_type: Optional[StrictStr] = None,
|
|
1103
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1104
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1105
|
+
) -> RESTResponseType:
|
|
1106
|
+
"""update_notification
|
|
1107
|
+
|
|
1108
|
+
Updates an existing notification for a VPS service with customizable thresholds for CPU, memory, network, and disk metrics
|
|
1109
|
+
|
|
1110
|
+
:param update_notification_request_content: (required)
|
|
1111
|
+
:type update_notification_request_content: UpdateNotificationRequestContent
|
|
1112
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1113
|
+
number provided, it will be total request
|
|
1114
|
+
timeout. It can also be a pair (tuple) of
|
|
1115
|
+
(connection, read) timeouts.
|
|
1116
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1117
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1118
|
+
request; this effectively ignores the
|
|
1119
|
+
authentication in the spec for a single request.
|
|
1120
|
+
:type _request_auth: dict, optional
|
|
1121
|
+
:param _content_type: force content-type for the request.
|
|
1122
|
+
:type _content_type: str, Optional
|
|
1123
|
+
:param _headers: set to override the headers for a single
|
|
1124
|
+
request; this effectively ignores the headers
|
|
1125
|
+
in the spec for a single request.
|
|
1126
|
+
:type _headers: dict, optional
|
|
1127
|
+
:param _host_index: set to override the host_index for a single
|
|
1128
|
+
request; this effectively ignores the host_index
|
|
1129
|
+
in the spec for a single request.
|
|
1130
|
+
:type _host_index: int, optional
|
|
1131
|
+
:return: Returns the result object.
|
|
1132
|
+
""" # noqa: E501
|
|
1133
|
+
|
|
1134
|
+
_param = self._update_notification_serialize(
|
|
1135
|
+
update_notification_request_content=update_notification_request_content,
|
|
1136
|
+
_request_auth=_request_auth,
|
|
1137
|
+
_content_type=_content_type,
|
|
1138
|
+
_headers=_headers,
|
|
1139
|
+
_host_index=_host_index
|
|
1140
|
+
)
|
|
1141
|
+
|
|
1142
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1143
|
+
'200': "UpdateNotificationResponseContent",
|
|
1144
|
+
'400': "BadRequestErrorResponseContent",
|
|
1145
|
+
'401': "UnauthorizedErrorResponseContent",
|
|
1146
|
+
'403': "ForbiddenErrorResponseContent",
|
|
1147
|
+
'404': "ResourceNotFoundErrorResponseContent",
|
|
1148
|
+
'422': "ValidationErrorResponseContent",
|
|
1149
|
+
'429': "TooManyRequestsErrorResponseContent",
|
|
1150
|
+
'500': "InternalServiceErrorResponseContent",
|
|
1151
|
+
'503': "ServiceUnavailableErrorResponseContent",
|
|
1152
|
+
}
|
|
1153
|
+
response_data = self.api_client.call_api(
|
|
1154
|
+
*_param,
|
|
1155
|
+
_request_timeout=_request_timeout
|
|
1156
|
+
)
|
|
1157
|
+
return response_data.response
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
def _update_notification_serialize(
|
|
1161
|
+
self,
|
|
1162
|
+
update_notification_request_content,
|
|
1163
|
+
_request_auth,
|
|
1164
|
+
_content_type,
|
|
1165
|
+
_headers,
|
|
1166
|
+
_host_index,
|
|
1167
|
+
) -> RequestSerialized:
|
|
1168
|
+
|
|
1169
|
+
_host = None
|
|
1170
|
+
|
|
1171
|
+
_collection_formats: Dict[str, str] = {
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
_path_params: Dict[str, str] = {}
|
|
1175
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1176
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1177
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1178
|
+
_files: Dict[
|
|
1179
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1180
|
+
] = {}
|
|
1181
|
+
_body_params: Optional[bytes] = None
|
|
1182
|
+
|
|
1183
|
+
# process the path parameters
|
|
1184
|
+
# process the query parameters
|
|
1185
|
+
# process the header parameters
|
|
1186
|
+
# process the form parameters
|
|
1187
|
+
# process the body parameter
|
|
1188
|
+
if update_notification_request_content is not None:
|
|
1189
|
+
_body_params = update_notification_request_content
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
# set the HTTP header `Accept`
|
|
1193
|
+
if 'Accept' not in _header_params:
|
|
1194
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1195
|
+
[
|
|
1196
|
+
'application/json'
|
|
1197
|
+
]
|
|
1198
|
+
)
|
|
1199
|
+
|
|
1200
|
+
# set the HTTP header `Content-Type`
|
|
1201
|
+
if _content_type:
|
|
1202
|
+
_header_params['Content-Type'] = _content_type
|
|
1203
|
+
else:
|
|
1204
|
+
_default_content_type = (
|
|
1205
|
+
self.api_client.select_header_content_type(
|
|
1206
|
+
[
|
|
1207
|
+
'application/json'
|
|
1208
|
+
]
|
|
1209
|
+
)
|
|
1210
|
+
)
|
|
1211
|
+
if _default_content_type is not None:
|
|
1212
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1213
|
+
|
|
1214
|
+
# authentication setting
|
|
1215
|
+
_auth_settings: List[str] = [
|
|
1216
|
+
'BearerAuth'
|
|
1217
|
+
]
|
|
1218
|
+
|
|
1219
|
+
return self.api_client.param_serialize(
|
|
1220
|
+
method='POST',
|
|
1221
|
+
resource_path='/vps/update-notification',
|
|
1222
|
+
path_params=_path_params,
|
|
1223
|
+
query_params=_query_params,
|
|
1224
|
+
header_params=_header_params,
|
|
1225
|
+
body=_body_params,
|
|
1226
|
+
post_params=_form_params,
|
|
1227
|
+
files=_files,
|
|
1228
|
+
auth_settings=_auth_settings,
|
|
1229
|
+
collection_formats=_collection_formats,
|
|
1230
|
+
_host=_host,
|
|
1231
|
+
_request_auth=_request_auth
|
|
1232
|
+
)
|
|
1233
|
+
|
|
1234
|
+
|