Power
Power state and power actions, and raw BMC commands.
5 endpoints
Refresh power states
#POST/api/v1/power/refresh
Admin only
Reads the power state of every server (or the given ones) from their BMCs now.
Request body
serverIdsinteger[]max. 1000 items
Example
curl -X POST "https://panel.example.com/api/v1/power/refresh" \
-H "Authorization: Bearer $TRIXOS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"serverIds":[1]}'Live power state
#GET/api/v1/servers/{id}/power
Asks the BMC now. Falls back to the last known state when the server has no usable BMC (cached: true).
Path parameters
idinteger> 0
Example
curl "https://panel.example.com/api/v1/servers/42/power" \
-H "Authorization: Bearer $TRIXOS_TOKEN"Power action
#POST/api/v1/servers/{id}/power
Needs confirm with the hostname
Runs as a job and returns 202 with it. Every action except setPowerOn needs confirm with the hostname.
Path parameters
idinteger> 0
Request body
actionstringrequiredone of
setPowerOn,setPowerOff,setPowerSoft,setPowerReset,setPowerCycle,setBmcResetconfirmstring
Example
curl -X POST "https://panel.example.com/api/v1/servers/42/power" \
-H "Authorization: Bearer $TRIXOS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"setPowerCycle","confirm":"web-01"}'Execute an IPMI command
#POST/api/v1/servers/{id}/bmc/command
Admin onlyNeeds confirm with the hostname
The "Execute IPMI command" dialog of the IPMI device (admins). Plain ipmitool words without options; the connection comes from the server's IPMI device. Status and information commands (power status, chassis status, sel list last 20, sdr list all|full|event, fru print, bmc info|guid|selftest, session info active|all, user list, lan print) run right away. power on|off|soft|reset|cycle|diag, chassis bootdev … and chassis identify change the server: they follow the protected, maintenance and dry-run rules and run as an audited bmc_command job (since 0.8.0 without a typed hostname; confirm is accepted and ignored). Everything else (user set, lan set, raw, mc reset, sol set, channel …) is refused. IPMI devices only.
Path parameters
idinteger> 0
Request body
commandstringrequiredmin. 1 chars, max. 500 chars
confirmstring
Example
curl -X POST "https://panel.example.com/api/v1/servers/42/bmc/command" \
-H "Authorization: Bearer $TRIXOS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"command":"sel list","confirm":"web-01"}'Switch an outlet on, off or power-cycle it
#POST/api/v1/pdu-outlets/{id}/power
Admin onlyNeeds confirm with the hostname
Cuts or restores power at the PDU (a hard power cut for the server). Only for outlets mapped to a server; confirm must be the hostname of that server. Runs as a job of type outlet_power (dry-run unless the panel is in live mode); servers in maintenance follow the same rules as BMC power actions.
Path parameters
idinteger> 0
Request body
actionstringrequiredone of
on,off,cycleconfirmstringmax. 255 chars
Example
curl -X POST "https://panel.example.com/api/v1/pdu-outlets/42/power" \
-H "Authorization: Bearer $TRIXOS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"on"}'