Minor re-work (#1661)

* Minor re-work

* Fix typo
This commit is contained in:
Fabian Affolter 2020-04-14 10:27:10 +02:00 committed by GitHub
parent 83e8f935fd
commit e82d6b1ea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

67
API.md
View File

@ -2,7 +2,8 @@
## Supervisor RESTful API ## Supervisor RESTful API
Interface for Home Assistant to control things from supervisor. The RESTful API for Home Assistant allows you to control things around
around the Supervisor and other components.
On error / Code 400: On error / Code 400:
@ -22,8 +23,10 @@ On success / Code 200:
} }
``` ```
For access to API you need use a authorization header with a `Bearer` token. To access the API you need use an authorization header with a `Bearer` token.
They are available for Add-ons and the Home Assistant using the `SUPERVISOR_TOKEN` environment variable.
The token is available for add-ons and Home Assistant using the
`SUPERVISOR_TOKEN` environment variable.
### Supervisor ### Supervisor
@ -33,7 +36,7 @@ This API call don't need a token.
- GET `/supervisor/info` - GET `/supervisor/info`
The addons from `addons` are only installed one. Shows the installed add-ons from `addons`.
```json ```json
{ {
@ -90,11 +93,11 @@ Optional:
- POST `/supervisor/reload` - POST `/supervisor/reload`
Reload addons/version. Reload the add-ons/version.
- GET `/supervisor/logs` - GET `/supervisor/logs`
Output is the raw docker log. Output is the raw Docker log.
- GET `/supervisor/stats` - GET `/supervisor/stats`
@ -113,7 +116,7 @@ Output is the raw docker log.
- GET `/supervisor/repair` - GET `/supervisor/repair`
Repair overlayfs issue and restore lost images Repair overlayfs issue and restore lost images.
### Snapshot ### Snapshot
@ -134,7 +137,6 @@ Repair overlayfs issue and restore lost images
``` ```
- POST `/snapshots/reload` - POST `/snapshots/reload`
- POST `/snapshots/new/upload` - POST `/snapshots/new/upload`
return: return:
@ -208,9 +210,7 @@ return:
``` ```
- POST `/snapshots/{slug}/remove` - POST `/snapshots/{slug}/remove`
- GET `/snapshots/{slug}/download` - GET `/snapshots/{slug}/download`
- POST `/snapshots/{slug}/restore/full` - POST `/snapshots/{slug}/restore/full`
```json ```json
@ -233,11 +233,8 @@ return:
### Host ### Host
- POST `/host/reload` - POST `/host/reload`
- POST `/host/shutdown` - POST `/host/shutdown`
- POST `/host/reboot` - POST `/host/reboot`
- GET `/host/info` - GET `/host/info`
```json ```json
@ -254,7 +251,7 @@ return:
- GET `/host/logs` - GET `/host/logs`
Return host dmesg Return the host log messages (dmesg).
- POST `/host/options` - POST `/host/options`
@ -311,7 +308,7 @@ Return host dmesg
- POST `/os/config/sync` - POST `/os/config/sync`
Load host configs from a USB stick. Load host configurations from an USB stick.
### Hardware ### Hardware
@ -354,7 +351,7 @@ Load host configs from a USB stick.
- POST `/hardware/trigger` - POST `/hardware/trigger`
Trigger an udev reload Trigger an UDEV reload.
### Home Assistant ### Home Assistant
@ -414,7 +411,7 @@ Output is the raw Docker log.
} }
``` ```
Image with `null` and version_latest with `null` reset this options. Image with `null` and `version_latest` with `null` reset this options.
- POST/GET `/core/api` - POST/GET `/core/api`
@ -551,13 +548,9 @@ Get all available add-ons.
``` ```
- GET `/addons/{addon}/icon` - GET `/addons/{addon}/icon`
- GET `/addons/{addon}/logo` - GET `/addons/{addon}/logo`
- GET `/addons/{addon}/changelog` - GET `/addons/{addon}/changelog`
- GET `/addons/{addon}/documentation` - GET `/addons/{addon}/documentation`
- POST `/addons/{addon}/options` - POST `/addons/{addon}/options`
```json ```json
@ -574,7 +567,7 @@ Get all available add-ons.
} }
``` ```
Reset custom network/audio/options, set it `null`. Reset custom network, audio and options, set it to `null`.
- POST `/addons/{addon}/security` - POST `/addons/{addon}/security`
@ -587,28 +580,22 @@ This function is not callable by itself.
``` ```
- POST `/addons/{addon}/start` - POST `/addons/{addon}/start`
- POST `/addons/{addon}/stop` - POST `/addons/{addon}/stop`
- POST `/addons/{addon}/install` - POST `/addons/{addon}/install`
- POST `/addons/{addon}/uninstall` - POST `/addons/{addon}/uninstall`
- POST `/addons/{addon}/update` - POST `/addons/{addon}/update`
- GET `/addons/{addon}/logs` - GET `/addons/{addon}/logs`
Output is the raw Docker log. Output is the raw Docker log.
- POST `/addons/{addon}/restart` - POST `/addons/{addon}/restart`
- POST `/addons/{addon}/rebuild` - POST `/addons/{addon}/rebuild`
Only supported for local build addons Only supported for local build add-ons.
- POST `/addons/{addon}/stdin` - POST `/addons/{addon}/stdin`
Write data to add-on stdin Write data to add-on stdin.
- GET `/addons/{addon}/stats` - GET `/addons/{addon}/stats`
@ -629,7 +616,7 @@ Write data to add-on stdin
- POST `/ingress/session` - POST `/ingress/session`
Create a new Session for access to ingress service. Create a new session for access to the ingress service.
```json ```json
{ {
@ -656,8 +643,8 @@ Return a list of enabled panels.
- VIEW `/ingress/{token}` - VIEW `/ingress/{token}`
Ingress WebUI for this Add-on. The addon need support HASS Auth! Ingress WebUI for this add-on. The add-on need support for the Home Assistant
Need ingress session as cookie. authentication system. Needs an ingress session as cookie.
### discovery ### discovery
@ -1113,18 +1100,18 @@ return:
} }
``` ```
### Auth / SSO API ### Authentication/SSO API
You can use the user system on homeassistant. We handle this auth system on You can use the user system from Home Assistant. The auth system can be handled
supervisor. with the Supervisor.
You can call post `/auth` `/auth` is accepting POST calls.
We support: We support:
- Json `{ "user|name": "...", "password": "..." }` - JSON: `{ "user|name": "...", "password": "..." }`
- application/x-www-form-urlencoded `user|name=...&password=...` - `application/x-www-form-urlencoded`: `user|name=...&password=...`
- BasicAuth - Basic Authentication
* POST `/auth/reset` * POST `/auth/reset`