Services
VPS service detail (WHMCS + Virtualizor combined), real-time metrics and OS templates for rebuild. All endpoints sit behind ServiceOwnershipMiddleware — a reseller can only access its own services.
VPS service detail (WHMCS + Virtualizor combined)
Combines the reseller VPS service's WHMCS-side info (domain, IP, billing cycle, next due date, namespace) with the Virtualizor-side runtime metrics (hostname, IP list, virt type, running state).
Terminate the service via the WHMCS module hook (asynchronous)
`WhmcsApiClient::moduleTerminate` is called. The WHMCS provisioning queue runs the Virtualizor `delvs` job async (~60s queue + ~30s delvs). For this reason the response returns **HTTP 202 Accepted**; the reseller then tracks it with GET /services/{id}/status.
Real-time VPS metrics (CPU/RAM/disk/net)
Real-time metric via a Virtualizor `act=vpsstat` call. NO cache — every call goes to the Virtualizor master. A dedicated rate limit bucket is allocated for high-frequency polling.
VPS root access details (username/password/ip/hostname)
Returns the root access details of the reseller's VPS. `password` is decrypted via the WHMCS `DecryptPassword` API action (tblhosting.password is stored encrypted). If it cannot be decrypted (empty in DB, no WHMCS API permission, transport error), `password_available=false` + an empty `password` is returned — in that case the reseller module MUST NOT overwrite the existing password.
OS templates allowed for rebuild on this VPS (service-specific filter)
Selection list for the VPS rebuild operation. **ENH-001 (live test 2026-05-19):** the list is now service-specific — the `ostemplates` field returned by the Virtualizor `act=rebuild&vpsid=X` form-load call is parsed. This is the list filtered by the media group assigned to the VPS in Virtualizor. Previously the global list (`act=ostemplates`, 255+ OS) was returned, and when a reseller picked the wrong OS and rebuilt, Virtualizor threw 'The OS you submitted is invalid'. Now only allowed OSes are shown.
VPS power operation (start/stop/restart/poweroff)
Changes the power state of the reseller's VPS. The `action` URL parameter accepts `start`, `stop`, `restart` or `poweroff`; any other value returns 404 in the Slim route regex.
VPS OS reinstall (asynchronous, 202 Accepted)
Reinstalls the VPS with the selected OS template. ALL data on the disk is deleted. Async job — the Virtualizor `rebuildvps` operation takes 5-30 minutes; the API returns 202 Accepted immediately and the reseller module then tracks it with `GET /services/{id}/status`.
Short-lived (60s) NoVNC connection info
Used to connect directly on the browser side to the `wss://{host}:{port}/{websockify_path}` URL (port = the Virtualizor enduser novnc proxy port, e.g. 4083; NOT the RAW VNC/RFB port). The API does NOT PROXY this websocket stream at all — it only returns connection info (host/port/password/expires_at).
Change the VPS root password
Changes the root password via a Virtualizor `act=editvs` round-trip (the official WHMCS module pattern: first GET the full config, then POST it back with `editvps=1` + `rootpass`).
Suspend the service via the WHMCS module hook
`WhmcsApiClient::moduleSuspend` is called. WHMCS triggers its own virtualizor module, and the queue cron turns it into a Virtualizor `suspendvs` job. In our DB `mod_reseller_provisions.status='suspended'` + `notice='Suspended via API: <reason>'` are set.
Unsuspend the service via the WHMCS module hook
`WhmcsApiClient::moduleUnsuspend` is called. In our DB `mod_reseller_provisions.status='active'` + `notice='Unsuspended via API'` are set.
Upgrade the service's config options
Upgrades the service's configurable options (`resource`-role groups like RAM/CPU/disk) to new values. The WHMCS `UpgradeProduct` action is called with `type=configoptions`; the prorata difference is calculated on the WHMCS side.