Skip to content

os.php

OS management module for listing available operating systems, searching servers by OS ID, and managing OS presets.

API Methods

Method Action Description
list get list of OS Returns a list of available operating systems, potentially filtered by server hardware configuration or instance presets.
search search servers by OS Searches for available servers that can run a specific operating system.

os/list

Returns a list of available operating systems, potentially filtered by server hardware configuration or instance presets.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: list
token ❌ string Authentication token for permission verification.
id ❌ integer Server ID to filter OS by hardware configuration.
instance_id ❌ integer Instance preset ID to filter OS by preset requirements.
location ❌ string Specific data center location code.
user_location ❌ string The user's current or preferred geographic location.
bill_period ❌ string The billing cycle duration for the operating system.

Request example

curl -s "https://invapi.hostkey.com/os.php" -X POST \
--data "action=list"
Success response example
{
"result": "OK",
"action": "list",
"os_list": [
{
"id": 101,
"name": "Ubuntu 22.04 LTS",
"active": 1,
"price_EUR": 5.5,
"billing_plan": {
"USD": "...",
"EUR": "...",
},
"bm": 0,
"vm": 1,
"gpu": 0,
"vgpu": 0,
"vds": 0,
"cores": 2,
"cpu_sockets": 1,
"ram": 4096,
"hdd": 50,
"location": "NL",
"allow_test_os": true,
"disable_only": false,
"email": "[email protected]",
"exclude_list": "",
"tags": []
}
],
"os_excluded": [
{
"os_id": 105,
"name": "Windows Server 2022",
"foreman_id": 456,
"reason": "OS is excluded by hardware configuration of all available servers"
}
]
}
Error examples
{
"code": -1,
"message": "os/list: no OS found"
}

os/search

Searches for available servers that can run a specific operating system.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: search
token ❌ string Authentication token for permission verification.
os_id ✅ integer The ID of the operating system to search for.

Request example

curl -s "https://invapi.hostkey.com/os.php" -X POST \
--data "action=search" \
--data "os_id=VALUE"
Success response example
{
"result": "OK",
"action": "search",
"servers": [
{
"id": 501,
"type": "server",
"owner": "user",
"status": "sale",
"ip": "192.168.1.1",
"location": "DC-1",
"config": "{}",
"full_location": "Rack-Pos-ID",
"preset": "-"
}
]
}
Error examples
{
"code": -1,
"message": "Error during search"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×