Skip to content
VirtlixCP

Documentation / API

KVM VPS

These endpoints come from the VPS package included with VirtlixCP. Admin endpoints are under pkg/vps/; client endpoints are under pkg/vps/my/ and only ever return the signed-in client's own VPSes.

List VPSes

GET /pkg/vps/server

Returns every VPS with its status, IP, size, port speed, bandwidth, client and hypervisor.

View VPS

GET /pkg/vps/server/{id}

Returns the VPS and its recent activity.

Create VPS

POST /pkg/vps/server
Field Type Required Description
hostname string yes Letters, numbers, dashes and dots
template string yes Template slug, from GET /pkg/vps/options
node_id integer yes Hypervisor ID
ip_pool_id integer yes IP pool to take the address from
vcpu integer yes 1 to 128
memory_mb integer yes 256 or more
disk_gb integer yes 5 or more, and at least the template's minimum
root_password string 8 to 128 characters, with root_password_confirmation. Generated if left out
ssh_public_key string One or more public keys, one per line (Linux only)
client_id integer Client who owns the VPS
dns_servers array Up to 3 IPv4 resolvers. The default is 8.8.8.8, 8.8.4.4 and 1.1.1.1
port_speed_in_mbps integer Download speed. 1000 if left out
port_speed_out_mbps integer Upload speed. Same as download if left out
bandwidth_limit_gb integer Monthly transfer allowance
bandwidth_action string none, throttle or suspend, when the allowance runs out
bandwidth_throttle_mbps integer Speed while throttled

Create VPS options

GET /pkg/vps/options

Templates (with the hypervisors each one is downloaded to), hypervisors with free resources, IP pools with free addresses, and the standard port speeds.

Power actions

POST /pkg/vps/server/{id}/{action}

action is start, stop, reboot, force-stop or delete.

POST /pkg/vps/server-bulk
Field Type Required Description
action string yes start, stop, reboot, force-stop or delete
ids array yes 1 to 500 VPS IDs. VPSes not in a state that allows the action are skipped

Manage

POST /pkg/vps/server/{id}/manage/{action}
Action Fields What it does
password optional root_password and root_password_confirmation Sets a new root or Administrator password, generated if left out. The VPS restarts
hostname hostname Renames the VPS. It restarts
dns dns_servers (up to 3, empty for the default) Sets the resolvers inside the VPS. It restarts
reinstall template, optional root_password and confirmation Erases the disk and installs the template
owner client_id (empty to remove) Assigns the VPS to a client
resize vcpu, memory_mb, disk_gb Changes the size. Disks can only grow
network the port speed and bandwidth fields from Create VPS Applies right away, no restart
mac none Switches the VPS to its IP's virtual MAC. It restarts
reset-bandwidth none Sets this month's usage back to zero

Live data

GET /pkg/vps/server/{id}/stats
GET /pkg/vps/server/{id}/bandwidth
POST /pkg/vps/server/{id}/console

stats returns live CPU, memory, disk and network usage. bandwidth returns daily usage for the month. console returns a short-lived path to the browser console.

Hypervisors

GET /pkg/vps/node
POST /pkg/vps/node
POST /pkg/vps/node/{id}/{action}

Creating a hypervisor takes name, address, ssh_port, ssh_user, password (used once to install the panel's SSH key, not stored), network_mode (routed, bridge, direct or nat), network_device and storage_path. action is check, setup or delete.

OS templates

GET /pkg/vps/template
POST /pkg/vps/template/{slug}/cache
DELETE /pkg/vps/template/{slug}/cache

Lists the catalog, and downloads a template to a hypervisor or removes it. Send node_id with the cache calls.

Virtual MACs

GET /pkg/vps/mac
POST /pkg/vps/mac
DELETE /pkg/vps/mac/{id}

POST takes ip_address and mac_address (for example 02:00:00:95:29:2c).

Client endpoints

Clients use the same calls under pkg/vps/my/, limited to their own VPSes:

Endpoint Description
GET /pkg/vps/my/server Their VPSes
GET /pkg/vps/my/server/{id} One VPS and its activity
POST /pkg/vps/my/server/{id}/{action} start, stop, reboot or force-stop
POST /pkg/vps/my/server/{id}/manage/{action} password, hostname, dns or reinstall
GET /pkg/vps/my/server/{id}/templates Templates they can reinstall with
GET /pkg/vps/my/server/{id}/stats Live usage
GET /pkg/vps/my/server/{id}/bandwidth Daily usage
POST /pkg/vps/my/server/{id}/console Browser console

Another client's VPS returns 404. Resizing and deleting return 403.