HTTP API Reference
13 min
GET /ping
curl -x GET http://localhost:3005/pingGET /logs.txt?unit=$unit_id&from=$timestamp&until=$timestamp
curl -x GET http://localhost:3005/logs.txtPOST /reboot
curl -x POST http://localhost:3005/rebootPOST /shutdown
curl -x POST http://localhost:3005/shutdownWS /connect
client -> server: start-log-stream(from = timestamp)
client -> server: stop-log-stream() -> timestamp
server -> client: logs
client -> server: start-service-status-stream()
client -> server: stop-service-status-stream()
server -> client: ServiceUpdate
client -> server: start-machine-status-stream()
client -> server: stop-machine-status-stream()
server -> client: MachineStatusUpdatewebsocat ws://localhost:3005/connect
SEND: {"kind": "start-service-status-stream"}
RECV: {"kind":"service-status-update","data":[{"id":"test.service","names":["test.service"],"description":"test.service","active_state":"inactive","substate":"dead"}]}GET /unit/$unit_id
curl -x GET http://localhost:3005/service/test.servicePOST /unit/$unit_id/start
curl -x POST http://localhost:3005/service/test.service/startPOST /unit/$unit_id/stop
curl -x POST http://localhost:3005/service/test.service/stopPOST /unit/$unit_id/restart
curl -x POST http://localhost:3005/service/test.service/restartGET /machine-status
curl -x GET http://localhost:3005/machine-statustype ServiceUpdate = Vec<ServiceInfo>;struct ServiceInfo {
unit_id: String,
active_state: ServiceState,
substate: String,
}struct MachineStatusUpdate {
device_name: Option<String>,
network_interfaces: Option<Vec<NetworkInterface>>,
system_version: Option<String>,
host_os_version: Option<String>,
boot_time: Option<DateTime/Timestamp>,
}struct NetworkInterface {
name: String,
mac_address: String,
ip_addresses: Vec<String>,
}