os.php¶
Operating system management module: provides methods for adding, removing, updating, and retrieving a list of OS with filtering by hardware compatibility and licenses.
API Methods¶
| Method | Action | Description |
|---|---|---|
list | get OS list | Returns a list of operating systems. If id or instance_id is specified, filters OS by compatibility with hardware or preset. Also returns a list of excluded OS. |
os/list¶
Returns a list of operating systems. If id or instance_id is specified, filters OS by compatibility with hardware or preset. Also returns a list of excluded OS.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: list |
| token | ❌ | string | Authorization token |
| id | ❌ | integer | Server ID for filtering compatible OS |
| instance_id | ❌ | integer | Preset ID for filtering compatible OS |
| location | ❌ | string | Location for filtering |
| user_location | ❌ | string | User location (default COM) |
| bill_period | ❌ | string | Billing period (monthly/hourly) |
Example of a successful response
{
"result": "OK",
"action": "list",
"os_list": [
{
"id": 101,
"name": "Ubuntu 20.04",
"active": 1,
"price_EUR": 0,
"price_RUB": 0,
"billing_plan": {
"USD": {
"hourly": 0.01,
"daily": 0.24,
"monthly": 7.2
},
"EUR": {
"hourly": 0.01,
"daily": 0.24,
"monthly": 7.2
}
},
"tags": [
{
"tag": "linux",
"value": "1",
"internal": 0
}
]
}
],
"os_excluded": [
{
"os_id": 105,
"name": "Windows Server 2019",
"foreman_id": 55
}
]
}
Failure response
``` { "code": -1, "message": "os/list: no OS found" }