From 2f023de72aff5e8fc2c1d4cd5d0da94434aabd89 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Fri, 15 Jan 2021 01:04:44 +0300 Subject: [PATCH] Update api.md --- pages/api.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/pages/api.md b/pages/api.md index 4b190823..31645e11 100644 --- a/pages/api.md +++ b/pages/api.md @@ -168,19 +168,40 @@ Each category is represented by its own event in the websocket (`info_hw_state`, On `GET` this handle will display messages from all KVMD services as plain text. The `follow=1` request parameter turns the request into an infinite one and you will receive new log messages in real time. The seek parameter runs the log for the specified time in seconds. For example, `seek=3600` will show the log for the last hour. Both the `seek` and `follow` parameters can be used together. ## Get ATX state: `/api/atx` -On `GET` it will show current ATX state +On `GET` it will show current ATX state. +
+ Example + +```js +{ + "ok": true, + "result": { + "busy": false, // True if ATX is busy performing an operation and does not accept commands + "enabled": true, + "leds": { + "hdd": false, + "power": false + } + } +} +``` +
## Set ATX PSU state: `/api/atx/power` On `POST` it will change ATX power supply state to desired. Parameters: -- `action` describes desired state: `on` — turned on (do nothing in case PSU is already on), `off` — turned off (aka soft-off). Emulates short-press on POWER button, `off_hard` — will emulate long (4+ seconds) press on power button, `reset_hard` — emulates pressing RESET button (hardware cold reset) -- `wait` Boolean. Says if call should return immediately or just after finishing operation +- `action` describes desired state: + * `on` - turned on (do nothing in case PSU is already on); + * `off` - turned off (aka soft-off), emulates short-press on the power button; + * `off_hard` - emulates long (5+ seconds) press on the power button; + * `reset_hard` emulates pressing reset button (hardware hot reset). +- `wait` - boolean. Says if call should return immediately or just after finishing operation. ## Emulate pressing buttons on computer case: `/api/atx/click` On `POST` send button press events to {front-}panel header (like you pressing buttins on your computer's case). Parameters: - `button` specifies the desired computer case button you would like to press. Currently supported options are: `power` — for short press on power button, `power_long` — for pressing POWER button for 4+ seconds (force OFF), `reset` — to initiate cold-reset -- `wait` Boolean. Says if call should return immediately or just after finishing operation +- `wait` Boolean. Says if call should return immediately or just after finishing operation. # To be continued ===> Unfortunately, the developer doesn't have enough time to fully describe the API. You can find all existing APIs in the [KVMD source tree](https://github.com/pikvm/kvmd/tree/master/kvmd/apps/kvmd/api). We would appreciate your help with documentation.