hostinger-api 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hostinger_api/__init__.py +105 -0
- hostinger_api/api/__init__.py +21 -0
- hostinger_api/api/billing_catalog_api.py +282 -0
- hostinger_api/api/billing_orders_api.py +313 -0
- hostinger_api/api/billing_payment_methods_api.py +819 -0
- hostinger_api/api/billing_subscriptions_api.py +584 -0
- hostinger_api/api/domains_portfolio_api.py +282 -0
- hostinger_api/api/vps_actions_api.py +599 -0
- hostinger_api/api/vps_backups_api.py +882 -0
- hostinger_api/api/vps_data_centers_api.py +282 -0
- hostinger_api/api/vps_firewall_api.py +2872 -0
- hostinger_api/api/vps_malware_scanner_api.py +842 -0
- hostinger_api/api/vps_post_install_scripts_api.py +1419 -0
- hostinger_api/api/vps_public_keys_api.py +1154 -0
- hostinger_api/api/vps_recovery_api.py +597 -0
- hostinger_api/api/vps_snapshots_api.py +1100 -0
- hostinger_api/api/vps_virtual_machine_api.py +3714 -0
- hostinger_api/api/vpsos_templates_api.py +551 -0
- hostinger_api/api/vpsptr_records_api.py +565 -0
- hostinger_api/api_client.py +795 -0
- hostinger_api/api_response.py +21 -0
- hostinger_api/configuration.py +579 -0
- hostinger_api/exceptions.py +214 -0
- hostinger_api/models/__init__.py +72 -0
- hostinger_api/models/billing_v1_catalog_catalog_item_price_resource.py +107 -0
- hostinger_api/models/billing_v1_catalog_catalog_item_resource.py +99 -0
- hostinger_api/models/billing_v1_order_order_billing_address_resource.py +145 -0
- hostinger_api/models/billing_v1_order_order_resource.py +116 -0
- hostinger_api/models/billing_v1_order_store_request.py +97 -0
- hostinger_api/models/billing_v1_order_store_request_items_inner.py +87 -0
- hostinger_api/models/billing_v1_payment_method_payment_method_resource.py +102 -0
- hostinger_api/models/billing_v1_subscription_cancel_request.py +117 -0
- hostinger_api/models/billing_v1_subscription_subscription_resource.py +130 -0
- hostinger_api/models/common_schema_error_response_schema.py +87 -0
- hostinger_api/models/common_schema_pagination_meta_schema.py +89 -0
- hostinger_api/models/common_schema_unauthorized_response_schema.py +87 -0
- hostinger_api/models/common_schema_unprocessable_content_response_schema.py +93 -0
- hostinger_api/models/common_schema_unprocessable_content_response_schema_errors.py +87 -0
- hostinger_api/models/common_success_empty_resource.py +85 -0
- hostinger_api/models/domains_v1_domain_domain_resource.py +126 -0
- hostinger_api/models/vps_get_action_list_v1200_response.py +99 -0
- hostinger_api/models/vps_get_backup_list_v1200_response.py +99 -0
- hostinger_api/models/vps_get_firewall_list_v1200_response.py +99 -0
- hostinger_api/models/vps_get_post_install_script_list_v1200_response.py +99 -0
- hostinger_api/models/vps_get_public_key_list_v1200_response.py +99 -0
- hostinger_api/models/vpsv1_action_action_resource.py +104 -0
- hostinger_api/models/vpsv1_backup_backup_resource.py +90 -0
- hostinger_api/models/vpsv1_data_center_data_center_resource.py +113 -0
- hostinger_api/models/vpsv1_firewall_firewall_resource.py +104 -0
- hostinger_api/models/vpsv1_firewall_firewall_rule_resource.py +115 -0
- hostinger_api/models/vpsv1_firewall_rules_store_request.py +105 -0
- hostinger_api/models/vpsv1_firewall_store_request.py +85 -0
- hostinger_api/models/vpsv1_ip_address_ip_address_resource.py +94 -0
- hostinger_api/models/vpsv1_malware_metrics_resource.py +101 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection.py +149 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_cpu_usage.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_disk_space.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_incoming_traffic.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_outgoing_traffic.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_ram_usage.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_collection_uptime.py +127 -0
- hostinger_api/models/vpsv1_metrics_metrics_resource.py +87 -0
- hostinger_api/models/vpsv1_post_install_script_post_install_script_resource.py +94 -0
- hostinger_api/models/vpsv1_post_install_script_store_request.py +87 -0
- hostinger_api/models/vpsv1_public_key_attach_request.py +85 -0
- hostinger_api/models/vpsv1_public_key_public_key_resource.py +89 -0
- hostinger_api/models/vpsv1_public_key_store_request.py +87 -0
- hostinger_api/models/vpsv1_snapshot_snapshot_resource.py +90 -0
- hostinger_api/models/vpsv1_template_template_resource.py +96 -0
- hostinger_api/models/vpsv1_virtual_machine_hostname_update_request.py +85 -0
- hostinger_api/models/vpsv1_virtual_machine_metric_get_request.py +88 -0
- hostinger_api/models/vpsv1_virtual_machine_nameservers_update_request.py +87 -0
- hostinger_api/models/vpsv1_virtual_machine_panel_password_update_request.py +86 -0
- hostinger_api/models/vpsv1_virtual_machine_recovery_start_request.py +85 -0
- hostinger_api/models/vpsv1_virtual_machine_recreate_request.py +90 -0
- hostinger_api/models/vpsv1_virtual_machine_root_password_update_request.py +86 -0
- hostinger_api/models/vpsv1_virtual_machine_setup_request.py +108 -0
- hostinger_api/models/vpsv1_virtual_machine_setup_request_public_key.py +87 -0
- hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource.py +190 -0
- hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_ipv4.py +131 -0
- hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_ipv6.py +131 -0
- hostinger_api/models/vpsv1_virtual_machine_virtual_machine_resource_template.py +127 -0
- hostinger_api/py.typed +0 -0
- hostinger_api/rest.py +256 -0
- hostinger_api-1.0.0.dist-info/METADATA +26 -0
- hostinger_api-1.0.0.dist-info/RECORD +88 -0
- hostinger_api-1.0.0.dist-info/WHEEL +5 -0
- hostinger_api-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Hostinger API Python SDK
|
|
5
|
+
|
|
6
|
+
API Version: 0.0.1-beta
|
|
7
|
+
|
|
8
|
+
NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
|
+
If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
10
|
+
""" # noqa: E501
|
|
11
|
+
|
|
12
|
+
import warnings
|
|
13
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
14
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
15
|
+
from typing_extensions import Annotated
|
|
16
|
+
|
|
17
|
+
from typing import List
|
|
18
|
+
from hostinger_api.models.vpsv1_data_center_data_center_resource import VPSV1DataCenterDataCenterResource
|
|
19
|
+
|
|
20
|
+
from hostinger_api.api_client import ApiClient, RequestSerialized
|
|
21
|
+
from hostinger_api.api_response import ApiResponse
|
|
22
|
+
from hostinger_api.rest import RESTResponseType
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class VPSDataCentersApi:
|
|
26
|
+
|
|
27
|
+
def __init__(self, api_client=None) -> None:
|
|
28
|
+
if api_client is None:
|
|
29
|
+
api_client = ApiClient.get_default()
|
|
30
|
+
self.api_client = api_client
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@validate_call
|
|
34
|
+
def get_data_centers_list_v1(
|
|
35
|
+
self,
|
|
36
|
+
_request_timeout: Union[
|
|
37
|
+
None,
|
|
38
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
39
|
+
Tuple[
|
|
40
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
41
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
42
|
+
]
|
|
43
|
+
] = None,
|
|
44
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
45
|
+
_content_type: Optional[StrictStr] = None,
|
|
46
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
47
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
48
|
+
) -> List[VPSV1DataCenterDataCenterResource]:
|
|
49
|
+
"""Get data centers list
|
|
50
|
+
|
|
51
|
+
This endpoint retrieves a list of all data centers available.
|
|
52
|
+
|
|
53
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
54
|
+
number provided, it will be total request
|
|
55
|
+
timeout. It can also be a pair (tuple) of
|
|
56
|
+
(connection, read) timeouts.
|
|
57
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
58
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
59
|
+
request; this effectively ignores the
|
|
60
|
+
authentication in the spec for a single request.
|
|
61
|
+
:type _request_auth: dict, optional
|
|
62
|
+
:param _content_type: force content-type for the request.
|
|
63
|
+
:type _content_type: str, Optional
|
|
64
|
+
:param _headers: set to override the headers for a single
|
|
65
|
+
request; this effectively ignores the headers
|
|
66
|
+
in the spec for a single request.
|
|
67
|
+
:type _headers: dict, optional
|
|
68
|
+
:param _host_index: set to override the host_index for a single
|
|
69
|
+
request; this effectively ignores the host_index
|
|
70
|
+
in the spec for a single request.
|
|
71
|
+
:type _host_index: int, optional
|
|
72
|
+
:return: Returns the result object.
|
|
73
|
+
""" # noqa: E501
|
|
74
|
+
|
|
75
|
+
_param = self._get_data_centers_list_v1_serialize(
|
|
76
|
+
_request_auth=_request_auth,
|
|
77
|
+
_content_type=_content_type,
|
|
78
|
+
_headers=_headers,
|
|
79
|
+
_host_index=_host_index
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
83
|
+
'200': "List[VPSV1DataCenterDataCenterResource]",
|
|
84
|
+
'401': "CommonSchemaUnauthorizedResponseSchema",
|
|
85
|
+
'500': "CommonSchemaErrorResponseSchema",
|
|
86
|
+
}
|
|
87
|
+
response_data = self.api_client.call_api(
|
|
88
|
+
*_param,
|
|
89
|
+
_request_timeout=_request_timeout
|
|
90
|
+
)
|
|
91
|
+
response_data.read()
|
|
92
|
+
return self.api_client.response_deserialize(
|
|
93
|
+
response_data=response_data,
|
|
94
|
+
response_types_map=_response_types_map,
|
|
95
|
+
).data
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@validate_call
|
|
99
|
+
def get_data_centers_list_v1_with_http_info(
|
|
100
|
+
self,
|
|
101
|
+
_request_timeout: Union[
|
|
102
|
+
None,
|
|
103
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
104
|
+
Tuple[
|
|
105
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
106
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
107
|
+
]
|
|
108
|
+
] = None,
|
|
109
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
110
|
+
_content_type: Optional[StrictStr] = None,
|
|
111
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
112
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
113
|
+
) -> ApiResponse[List[VPSV1DataCenterDataCenterResource]]:
|
|
114
|
+
"""Get data centers list
|
|
115
|
+
|
|
116
|
+
This endpoint retrieves a list of all data centers available.
|
|
117
|
+
|
|
118
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
119
|
+
number provided, it will be total request
|
|
120
|
+
timeout. It can also be a pair (tuple) of
|
|
121
|
+
(connection, read) timeouts.
|
|
122
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
123
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
124
|
+
request; this effectively ignores the
|
|
125
|
+
authentication in the spec for a single request.
|
|
126
|
+
:type _request_auth: dict, optional
|
|
127
|
+
:param _content_type: force content-type for the request.
|
|
128
|
+
:type _content_type: str, Optional
|
|
129
|
+
:param _headers: set to override the headers for a single
|
|
130
|
+
request; this effectively ignores the headers
|
|
131
|
+
in the spec for a single request.
|
|
132
|
+
:type _headers: dict, optional
|
|
133
|
+
:param _host_index: set to override the host_index for a single
|
|
134
|
+
request; this effectively ignores the host_index
|
|
135
|
+
in the spec for a single request.
|
|
136
|
+
:type _host_index: int, optional
|
|
137
|
+
:return: Returns the result object.
|
|
138
|
+
""" # noqa: E501
|
|
139
|
+
|
|
140
|
+
_param = self._get_data_centers_list_v1_serialize(
|
|
141
|
+
_request_auth=_request_auth,
|
|
142
|
+
_content_type=_content_type,
|
|
143
|
+
_headers=_headers,
|
|
144
|
+
_host_index=_host_index
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
148
|
+
'200': "List[VPSV1DataCenterDataCenterResource]",
|
|
149
|
+
'401': "CommonSchemaUnauthorizedResponseSchema",
|
|
150
|
+
'500': "CommonSchemaErrorResponseSchema",
|
|
151
|
+
}
|
|
152
|
+
response_data = self.api_client.call_api(
|
|
153
|
+
*_param,
|
|
154
|
+
_request_timeout=_request_timeout
|
|
155
|
+
)
|
|
156
|
+
response_data.read()
|
|
157
|
+
return self.api_client.response_deserialize(
|
|
158
|
+
response_data=response_data,
|
|
159
|
+
response_types_map=_response_types_map,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
@validate_call
|
|
164
|
+
def get_data_centers_list_v1_without_preload_content(
|
|
165
|
+
self,
|
|
166
|
+
_request_timeout: Union[
|
|
167
|
+
None,
|
|
168
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
169
|
+
Tuple[
|
|
170
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
171
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
172
|
+
]
|
|
173
|
+
] = None,
|
|
174
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
175
|
+
_content_type: Optional[StrictStr] = None,
|
|
176
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
177
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
178
|
+
) -> RESTResponseType:
|
|
179
|
+
"""Get data centers list
|
|
180
|
+
|
|
181
|
+
This endpoint retrieves a list of all data centers available.
|
|
182
|
+
|
|
183
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
184
|
+
number provided, it will be total request
|
|
185
|
+
timeout. It can also be a pair (tuple) of
|
|
186
|
+
(connection, read) timeouts.
|
|
187
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
188
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
189
|
+
request; this effectively ignores the
|
|
190
|
+
authentication in the spec for a single request.
|
|
191
|
+
:type _request_auth: dict, optional
|
|
192
|
+
:param _content_type: force content-type for the request.
|
|
193
|
+
:type _content_type: str, Optional
|
|
194
|
+
:param _headers: set to override the headers for a single
|
|
195
|
+
request; this effectively ignores the headers
|
|
196
|
+
in the spec for a single request.
|
|
197
|
+
:type _headers: dict, optional
|
|
198
|
+
:param _host_index: set to override the host_index for a single
|
|
199
|
+
request; this effectively ignores the host_index
|
|
200
|
+
in the spec for a single request.
|
|
201
|
+
:type _host_index: int, optional
|
|
202
|
+
:return: Returns the result object.
|
|
203
|
+
""" # noqa: E501
|
|
204
|
+
|
|
205
|
+
_param = self._get_data_centers_list_v1_serialize(
|
|
206
|
+
_request_auth=_request_auth,
|
|
207
|
+
_content_type=_content_type,
|
|
208
|
+
_headers=_headers,
|
|
209
|
+
_host_index=_host_index
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
213
|
+
'200': "List[VPSV1DataCenterDataCenterResource]",
|
|
214
|
+
'401': "CommonSchemaUnauthorizedResponseSchema",
|
|
215
|
+
'500': "CommonSchemaErrorResponseSchema",
|
|
216
|
+
}
|
|
217
|
+
response_data = self.api_client.call_api(
|
|
218
|
+
*_param,
|
|
219
|
+
_request_timeout=_request_timeout
|
|
220
|
+
)
|
|
221
|
+
return response_data.response
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def _get_data_centers_list_v1_serialize(
|
|
225
|
+
self,
|
|
226
|
+
_request_auth,
|
|
227
|
+
_content_type,
|
|
228
|
+
_headers,
|
|
229
|
+
_host_index,
|
|
230
|
+
) -> RequestSerialized:
|
|
231
|
+
|
|
232
|
+
_host = None
|
|
233
|
+
|
|
234
|
+
_collection_formats: Dict[str, str] = {
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
_path_params: Dict[str, str] = {}
|
|
238
|
+
_query_params: List[Tuple[str, str]] = []
|
|
239
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
240
|
+
_form_params: List[Tuple[str, str]] = []
|
|
241
|
+
_files: Dict[
|
|
242
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
243
|
+
] = {}
|
|
244
|
+
_body_params: Optional[bytes] = None
|
|
245
|
+
|
|
246
|
+
# process the path parameters
|
|
247
|
+
# process the query parameters
|
|
248
|
+
# process the header parameters
|
|
249
|
+
# process the form parameters
|
|
250
|
+
# process the body parameter
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
# set the HTTP header `Accept`
|
|
254
|
+
if 'Accept' not in _header_params:
|
|
255
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
256
|
+
[
|
|
257
|
+
'application/json'
|
|
258
|
+
]
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
# authentication setting
|
|
263
|
+
_auth_settings: List[str] = [
|
|
264
|
+
'apiToken'
|
|
265
|
+
]
|
|
266
|
+
|
|
267
|
+
return self.api_client.param_serialize(
|
|
268
|
+
method='GET',
|
|
269
|
+
resource_path='/api/vps/v1/data-centers',
|
|
270
|
+
path_params=_path_params,
|
|
271
|
+
query_params=_query_params,
|
|
272
|
+
header_params=_header_params,
|
|
273
|
+
body=_body_params,
|
|
274
|
+
post_params=_form_params,
|
|
275
|
+
files=_files,
|
|
276
|
+
auth_settings=_auth_settings,
|
|
277
|
+
collection_formats=_collection_formats,
|
|
278
|
+
_host=_host,
|
|
279
|
+
_request_auth=_request_auth
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
|