Update api.md

This commit is contained in:
Maxim Devaev 2021-01-15 01:04:44 +03:00 committed by GitHub
parent 6a05d13506
commit 2f023de72a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 4 deletions

View File

@ -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.
<details>
<summary>Example</summary>
```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
}
}
}
```
</details>
## 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.