presets.php¶
Server preset management module: retrieving lists, grouping, searching for suitable servers, and detailed configuration information with prices in different currencies.
API Methods¶
| Method | Action | Description |
|---|---|---|
groups | get groups | Returns a list of available preset groups |
info | get info | Returns a list of available currencies for displaying preset prices. By default, it returns EUR and USD. |
list | get list | Returns a list of available presets considering the user's location and access rights |
search | search servers | Returns a list of suitable servers for a specific preset by its name, scope, and location |
show | get preset info | Returns detailed information about a specific preset by its ID or name, taking into account restrictions for certain regions and payment parameters. |
presets/groups¶
Returns a list of available preset groups
HTTP-method: POST|GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: groups |
| token | ✅ | string | Authorization token |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "Error while retrieving groups" }
```
presets/info¶
Returns a list of available currencies for displaying preset prices. By default, it returns EUR and USD.
HTTP-method: GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: info |
| token | ❌ | string | Authorization token |
| currencies | ❌ | string | List of currencies separated by commas (e.g.: USD,EUR) |
Failure response
``` { "code": -1, "message": "action required" }
```
presets/list¶
Returns a list of available presets considering the user's location and access rights
HTTP-method: GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication API token |
| location | ❌ | string | Location (code or ID) |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "presets/list error: no presets found" }
```
presets/search¶
Returns a list of suitable servers for a specific preset by its name, scope, and location
HTTP-method: POST|GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Action (search) |
| token | ❌ | string | Authorization token |
| name | ❌ | string | Preset name |
| scope | ❌ | string | Scope (free or all) |
| location | ❌ | string | Location |
Example Request
Example of a successful response
{
"result": "OK",
"action": "search",
"servers": [
{
"id": 123,
"server_id": 123,
"type": "Component1.ref_tableName",
"owner": "Component1.owner",
"status": "Component1.Condition_Component",
"location": "dataCenterLocation.Code",
"config": "Component1.hwconfig",
"full_location": "Rack1.description-pos-id",
"ip": "string",
"days_left": 30,
"due_date": "2024-12-31T23:59:59Z"
}
]
}
Failure response
``` { "code": -1, "message": "Authentication required" }
```
presets/show¶
Returns detailed information about a specific preset by its ID or name, taking into account restrictions for certain regions and payment parameters.
HTTP-method: GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: show |
| token | ❌ | string | User authorization token |
| id | ❌ | integer | Preset ID |
| name | ❌ | string | Preset name |
| limit | ❌ | integer | Results limit |
Example of a successful response
{
"result": "OK",
"action": "show",
"presets": [
{
"id": 123,
"name": "High Performance",
"cpu": "4 Cores",
"ram": 16,
"hdd": 500,
"gpu": "NVIDIA RTX 3080",
"virtual": true,
"description": "Powerful preset for gaming",
"locations": [
"NL",
"DE"
],
"monthly_eur": 49.99,
"monthly_com": 55.0,
"monthly_usd": 60.0,
"hourly_usd": 0.0382,
"hourly_com": 0.0382,
"hourly_eur": 0.04,
"regions": {
"NL": "10+"
},
"server_type": "Instant Server",
"tags": [
{
"id": 1,
"name": "gaming"
}
]
}
]
}
Failure response
``` { "code": -1, "message": "JSON encode failed" }