diff --git a/API.md b/API.md index 333f4a61c..fda9b6134 100644 --- a/API.md +++ b/API.md @@ -32,206 +32,206 @@ The token is available for add-ons and Home Assistant using the - GET `/supervisor/ping` -This API call don't need a token. + This API call doesn't need a token. - GET `/supervisor/info` -Shows the installed add-ons from `addons`. + `addons` returns all the installed add-ons. -```json -{ - "version": "INSTALL_VERSION", - "version_latest": "version_latest", - "arch": "armhf|aarch64|i386|amd64", - "channel": "stable|beta|dev", - "timezone": "TIMEZONE", - "healthy": "bool", - "supported": "bool", - "logging": "debug|info|warning|error|critical", - "ip_address": "ip address", - "wait_boot": "int", - "debug": "bool", - "debug_block": "bool", - "diagnostics": "None|bool", - "addons": [ - { - "name": "xy bla", - "slug": "xy", - "description": "description", - "repository": "12345678|null", - "version": "LATEST_VERSION", - "installed": "INSTALL_VERSION", - "icon": "bool", - "logo": "bool", - "state": "started|stopped" - } - ], - "addons_repositories": ["REPO_URL"] -} -``` + ```json + { + "version": "INSTALL_VERSION", + "version_latest": "version_latest", + "arch": "armhf|aarch64|i386|amd64", + "channel": "stable|beta|dev", + "timezone": "TIMEZONE", + "healthy": "bool", + "supported": "bool", + "logging": "debug|info|warning|error|critical", + "ip_address": "ip address", + "wait_boot": "int", + "debug": "bool", + "debug_block": "bool", + "diagnostics": "None|bool", + "addons": [ + { + "name": "xy bla", + "slug": "xy", + "description": "description", + "repository": "12345678|null", + "version": "LATEST_VERSION", + "installed": "INSTALL_VERSION", + "icon": "bool", + "logo": "bool", + "state": "started|stopped" + } + ], + "addons_repositories": ["REPO_URL"] + } + ``` - POST `/supervisor/update` -Optional: + Optional: -```json -{ - "version": "VERSION" -} -``` + ```json + { + "version": "VERSION" + } + ``` - POST `/supervisor/options` -```json -{ - "channel": "stable|beta|dev", - "timezone": "TIMEZONE", - "wait_boot": "int", - "debug": "bool", - "debug_block": "bool", - "logging": "debug|info|warning|error|critical", - "addons_repositories": ["REPO_URL"] -} -``` + ```json + { + "channel": "stable|beta|dev", + "timezone": "TIMEZONE", + "wait_boot": "int", + "debug": "bool", + "debug_block": "bool", + "logging": "debug|info|warning|error|critical", + "addons_repositories": ["REPO_URL"] + } + ``` - POST `/supervisor/reload` -Reload the add-ons/version. + Reload the add-ons/version. - GET `/supervisor/logs` -Output is the raw Docker log. + Output is the raw Docker log. - GET `/supervisor/stats` -```json -{ - "cpu_percent": 0.0, - "memory_usage": 283123, - "memory_limit": 329392, - "memory_percent": 1.4, - "network_tx": 0, - "network_rx": 0, - "blk_read": 0, - "blk_write": 0 -} -``` + ```json + { + "cpu_percent": 0.0, + "memory_usage": 283123, + "memory_limit": 329392, + "memory_percent": 1.4, + "network_tx": 0, + "network_rx": 0, + "blk_read": 0, + "blk_write": 0 + } + ``` - GET `/supervisor/repair` -Repair overlayfs issue and restore lost images. + Repair overlayfs issue and restore lost images. ### Snapshot - GET `/snapshots` -```json -{ - "snapshots": [ - { - "slug": "SLUG", - "date": "ISO", - "name": "Custom name", - "type": "full|partial", - "protected": "bool" - } - ] -} -``` + ```json + { + "snapshots": [ + { + "slug": "SLUG", + "date": "ISO", + "name": "Custom name", + "type": "full|partial", + "protected": "bool" + } + ] + } + ``` - POST `/snapshots/reload` - POST `/snapshots/new/upload` -return: + return: -```json -{ - "slug": "" -} -``` + ```json + { + "slug": "" + } + ``` - POST `/snapshots/new/full` -```json -{ - "name": "Optional", - "password": "Optional" -} -``` + ```json + { + "name": "Optional", + "password": "Optional" + } + ``` -return: + return: -```json -{ - "slug": "" -} -``` + ```json + { + "slug": "" + } + ``` - POST `/snapshots/new/partial` -```json -{ - "name": "Optional", - "addons": ["ADDON_SLUG"], - "folders": ["FOLDER_NAME"], - "password": "Optional" -} -``` + ```json + { + "name": "Optional", + "addons": ["ADDON_SLUG"], + "folders": ["FOLDER_NAME"], + "password": "Optional" + } + ``` -return: + return: -```json -{ - "slug": "" -} -``` + ```json + { + "slug": "" + } + ``` - POST `/snapshots/reload` - GET `/snapshots/{slug}/info` -```json -{ - "slug": "SNAPSHOT ID", - "type": "full|partial", - "name": "custom snapshot name / description", - "date": "ISO", - "size": "SIZE_IN_MB", - "protected": "bool", - "homeassistant": "version", - "addons": [ - { - "slug": "ADDON_SLUG", - "name": "NAME", - "version": "INSTALLED_VERSION", - "size": "SIZE_IN_MB" - } - ], - "repositories": ["URL"], - "folders": ["NAME"] -} -``` + ```json + { + "slug": "SNAPSHOT ID", + "type": "full|partial", + "name": "custom snapshot name / description", + "date": "ISO", + "size": "SIZE_IN_MB", + "protected": "bool", + "homeassistant": "version", + "addons": [ + { + "slug": "ADDON_SLUG", + "name": "NAME", + "version": "INSTALLED_VERSION", + "size": "SIZE_IN_MB" + } + ], + "repositories": ["URL"], + "folders": ["NAME"] + } + ``` - POST `/snapshots/{slug}/remove` - GET `/snapshots/{slug}/download` - POST `/snapshots/{slug}/restore/full` -```json -{ - "password": "Optional" -} -``` + ```json + { + "password": "Optional" + } + ``` - POST `/snapshots/{slug}/restore/partial` -```json -{ - "homeassistant": "bool", - "addons": ["ADDON_SLUG"], - "folders": ["FOLDER_NAME"], - "password": "Optional" -} -``` + ```json + { + "homeassistant": "bool", + "addons": ["ADDON_SLUG"], + "folders": ["FOLDER_NAME"], + "password": "Optional" + } + ``` ### Host @@ -240,20 +240,20 @@ return: - POST `/host/reboot` - GET `/host/info` -```json -{ - "chassis": "specific|null", - "cpe": "xy|null", - "deployment": "stable|beta|dev|null", - "disk_total": 32.0, - "disk_used": 30.0, - "disk_free": 2.0, - "features": ["shutdown", "reboot", "hostname", "services", "hassos"], - "hostname": "hostname|null", - "kernel": "4.15.7|null", - "operating_system": "HassOS XY|Ubuntu 16.4|null" -} -``` + ```json + { + "chassis": "specific|null", + "cpe": "xy|null", + "deployment": "stable|beta|dev|null", + "disk_total": 32.0, + "disk_used": 30.0, + "disk_free": 2.0, + "features": ["shutdown", "reboot", "hostname", "services", "hassos"], + "hostname": "hostname|null", + "kernel": "4.15.7|null", + "operating_system": "HassOS XY|Ubuntu 16.4|null" + } + ``` - GET `/host/logs` @@ -261,11 +261,11 @@ Return the host log messages (dmesg). - POST `/host/options` -```json -{ - "hostname": "" -} -``` + ```json + { + "hostname": "" + } + ``` - POST `/host/reload` @@ -273,17 +273,17 @@ Return the host log messages (dmesg). - GET `/host/services` -```json -{ - "services": [ - { - "name": "xy.service", - "description": "XY ...", - "state": "active|" - } - ] -} -``` + ```json + { + "services": [ + { + "name": "xy.service", + "description": "XY ...", + "state": "active|" + } + ] + } + ``` - POST `/host/service/{unit}/stop` @@ -295,105 +295,105 @@ Return the host log messages (dmesg). - GET `/os/info` -```json -{ - "version": "2.3", - "version_latest": "2.4", - "board": "ova|rpi", - "boot": "rauc boot slot" -} -``` + ```json + { + "version": "2.3", + "version_latest": "2.4", + "board": "ova|rpi", + "boot": "rauc boot slot" + } + ``` - POST `/os/update` -```json -{ - "version": "optional" -} -``` + ```json + { + "version": "optional" + } + ``` - POST `/os/config/sync` -Load host configurations from an USB stick. + Load host configurations from an USB stick. ### Hardware - GET `/hardware/info` -```json -{ - "serial": ["/dev/xy"], - "input": ["Input device name"], - "disk": ["/dev/sdax"], - "gpio": ["gpiochip0", "gpiochip100"], - "audio": { - "CARD_ID": { - "name": "xy", - "type": "microphone", - "devices": [ - "chan_id": "channel ID", - "chan_type": "type of device" - ] - } - } -} -``` + ```json + { + "serial": ["/dev/xy"], + "input": ["Input device name"], + "disk": ["/dev/sdax"], + "gpio": ["gpiochip0", "gpiochip100"], + "audio": { + "CARD_ID": { + "name": "xy", + "type": "microphone", + "devices": [ + "chan_id": "channel ID", + "chan_type": "type of device" + ] + } + } + } + ``` - GET `/hardware/audio` -```json -{ - "audio": { - "input": { - "0,0": "Mic" - }, - "output": { - "1,0": "Jack", - "1,1": "HDMI" + ```json + { + "audio": { + "input": { + "0,0": "Mic" + }, + "output": { + "1,0": "Jack", + "1,1": "HDMI" + } } } -} -``` + ``` - POST `/hardware/trigger` -Trigger an UDEV reload. + Trigger a UDEV reload. ### Home Assistant - GET `/core/info` -```json -{ - "version": "INSTALL_VERSION", - "version_latest": "version_latest", - "arch": "arch", - "machine": "Image machine type", - "ip_address": "ip address", - "image": "str", - "boot": "bool", - "port": 8123, - "ssl": "bool", - "watchdog": "bool", - "wait_boot": 600, - "audio_input": "null|profile", - "audio_output": "null|profile" -} -``` + ```json + { + "version": "INSTALL_VERSION", + "version_latest": "version_latest", + "arch": "arch", + "machine": "Image machine type", + "ip_address": "ip address", + "image": "str", + "boot": "bool", + "port": 8123, + "ssl": "bool", + "watchdog": "bool", + "wait_boot": 600, + "audio_input": "null|profile", + "audio_output": "null|profile" + } + ``` - POST `/core/update` -Optional: + Optional: -```json -{ - "version": "VERSION" -} -``` + ```json + { + "version": "VERSION" + } + ``` - GET `/core/logs` -Output is the raw Docker log. + Output is the raw Docker log. - POST `/core/restart` - POST `/core/check` @@ -403,44 +403,44 @@ Output is the raw Docker log. - POST `/core/options` -```json -{ - "image": "Optional|null", - "version_latest": "Optional for custom image|null", - "port": "port for access core", - "ssl": "bool", - "refresh_token": "", - "watchdog": "bool", - "wait_boot": 600, - "audio_input": "null|profile", - "audio_output": "null|profile" -} -``` + ```json + { + "image": "Optional|null", + "version_latest": "Optional for custom image|null", + "port": "port for access core", + "ssl": "bool", + "refresh_token": "", + "watchdog": "bool", + "wait_boot": 600, + "audio_input": "null|profile", + "audio_output": "null|profile" + } + ``` -Image with `null` and `version_latest` with `null` reset this options. + Passing `image` with `null` and `version_latest` with `null` resets these options. - POST/GET `/core/api` -Proxy to the Home Assistant Core instance. + Proxy to Home Assistant Core instance. - GET `/core/websocket` -Proxy to Home Assistant Core websocket. + Proxy to Home Assistant Core websocket. - GET `/core/stats` -```json -{ - "cpu_percent": 0.0, - "memory_usage": 283123, - "memory_limit": 329392, - "memory_percent": 1.4, - "network_tx": 0, - "network_rx": 0, - "blk_read": 0, - "blk_write": 0 -} -``` + ```json + { + "cpu_percent": 0.0, + "memory_usage": 283123, + "memory_limit": 329392, + "memory_percent": 1.4, + "network_tx": 0, + "network_rx": 0, + "blk_read": 0, + "blk_write": 0 + } + ``` ### Network @@ -501,119 +501,119 @@ _All options are optional._ The result will be a updated object. -### RESTful for API add-ons +### RESTful API for add-ons If an add-on will call itself, you can use `/addons/self/...`. - GET `/addons` -Get all available add-ons. + Get all available add-ons. -```json -{ - "addons": [ - { - "name": "xy bla", - "slug": "xy", - "description": "description", - "advanced": "bool", - "stage": "stable|experimental|deprecated", - "repository": "core|local|REP_ID", - "version": "version_latest", - "installed": "none|INSTALL_VERSION", - "detached": "bool", - "available": "bool", - "build": "bool", - "url": "null|url", - "icon": "bool", - "logo": "bool" - } - ], - "repositories": [ - { - "slug": "12345678", - "name": "Repitory Name|unknown", - "source": "URL_OF_REPOSITORY", - "url": "WEBSITE|REPOSITORY", - "maintainer": "BLA BLU |unknown" - } - ] -} -``` + ```json + { + "addons": [ + { + "name": "xy bla", + "slug": "xy", + "description": "description", + "advanced": "bool", + "stage": "stable|experimental|deprecated", + "repository": "core|local|REP_ID", + "version": "version_latest", + "installed": "none|INSTALL_VERSION", + "detached": "bool", + "available": "bool", + "build": "bool", + "url": "null|url", + "icon": "bool", + "logo": "bool" + } + ], + "repositories": [ + { + "slug": "12345678", + "name": "Repitory Name|unknown", + "source": "URL_OF_REPOSITORY", + "url": "WEBSITE|REPOSITORY", + "maintainer": "BLA BLU |unknown" + } + ] + } + ``` - POST `/addons/reload` - GET `/addons/{addon}/info` -```json -{ - "name": "xy bla", - "slug": "xdssd_xybla", - "hostname": "xdssd-xybla", - "dns": [], - "description": "description", - "long_description": "null|markdown", - "auto_update": "bool", - "url": "null|url of addon", - "detached": "bool", - "available": "bool", - "advanced": "bool", - "stage": "stable|experimental|deprecated", - "arch": ["armhf", "aarch64", "i386", "amd64"], - "machine": "[raspberrypi2, tinker]", - "homeassistant": "null|min Home Assistant Core version", - "repository": "12345678|null", - "version": "null|VERSION_INSTALLED", - "version_latest": "version_latest", - "state": "none|started|stopped", - "startup": "initialize|system|services|application|once", - "boot": "auto|manual", - "build": "bool", - "options": "{}", - "schema": "{}|null", - "network": "{}|null", - "network_description": "{}|null", - "host_network": "bool", - "host_pid": "bool", - "host_ipc": "bool", - "host_dbus": "bool", - "privileged": ["NET_ADMIN", "SYS_ADMIN"], - "apparmor": "disable|default|profile", - "devices": ["/dev/xy"], - "udev": "bool", - "auto_uart": "bool", - "icon": "bool", - "logo": "bool", - "changelog": "bool", - "documentation": "bool", - "hassio_api": "bool", - "hassio_role": "default|homeassistant|manager|admin", - "homeassistant_api": "bool", - "auth_api": "bool", - "full_access": "bool", - "protected": "bool", - "rating": "1-6", - "stdin": "bool", - "webui": "null|http(s)://[HOST]:port/xy/zx", - "gpio": "bool", - "usb": "[physical_path_to_usb_device]", - "kernel_modules": "bool", - "devicetree": "bool", - "docker_api": "bool", - "video": "bool", - "audio": "bool", - "audio_input": "null|0,0", - "audio_output": "null|0,0", - "services_role": "['service:access']", - "discovery": "['service']", - "ip_address": "ip address", - "ingress": "bool", - "ingress_entry": "null|/api/hassio_ingress/slug", - "ingress_url": "null|/api/hassio_ingress/slug/entry.html", - "ingress_port": "null|int", - "ingress_panel": "null|bool", - "watchdog": "null|bool" -} -``` + ```json + { + "name": "xy bla", + "slug": "xdssd_xybla", + "hostname": "xdssd-xybla", + "dns": [], + "description": "description", + "long_description": "null|markdown", + "auto_update": "bool", + "url": "null|url of addon", + "detached": "bool", + "available": "bool", + "advanced": "bool", + "stage": "stable|experimental|deprecated", + "arch": ["armhf", "aarch64", "i386", "amd64"], + "machine": "[raspberrypi2, tinker]", + "homeassistant": "null|min Home Assistant Core version", + "repository": "12345678|null", + "version": "null|VERSION_INSTALLED", + "version_latest": "version_latest", + "state": "none|started|stopped", + "startup": "initialize|system|services|application|once", + "boot": "auto|manual", + "build": "bool", + "options": "{}", + "schema": "{}|null", + "network": "{}|null", + "network_description": "{}|null", + "host_network": "bool", + "host_pid": "bool", + "host_ipc": "bool", + "host_dbus": "bool", + "privileged": ["NET_ADMIN", "SYS_ADMIN"], + "apparmor": "disable|default|profile", + "devices": ["/dev/xy"], + "udev": "bool", + "auto_uart": "bool", + "icon": "bool", + "logo": "bool", + "changelog": "bool", + "documentation": "bool", + "hassio_api": "bool", + "hassio_role": "default|homeassistant|manager|admin", + "homeassistant_api": "bool", + "auth_api": "bool", + "full_access": "bool", + "protected": "bool", + "rating": "1-6", + "stdin": "bool", + "webui": "null|http(s)://[HOST]:port/xy/zx", + "gpio": "bool", + "usb": "[physical_path_to_usb_device]", + "kernel_modules": "bool", + "devicetree": "bool", + "docker_api": "bool", + "video": "bool", + "audio": "bool", + "audio_input": "null|0,0", + "audio_output": "null|0,0", + "services_role": "['service:access']", + "discovery": "['service']", + "ip_address": "ip address", + "ingress": "bool", + "ingress_entry": "null|/api/hassio_ingress/slug", + "ingress_url": "null|/api/hassio_ingress/slug/entry.html", + "ingress_port": "null|int", + "ingress_panel": "null|bool", + "watchdog": "null|bool" + } + ``` - GET `/addons/{addon}/icon` - GET `/addons/{addon}/logo` @@ -622,32 +622,32 @@ Get all available add-ons. - POST `/addons/{addon}/options` - POST `/addons/{addon}/options/validate` -```json -{ - "boot": "auto|manual", - "auto_update": "bool", - "network": { - "CONTAINER": "port|[ip, port]" - }, - "options": {}, - "audio_output": "null|0,0", - "audio_input": "null|0,0", - "ingress_panel": "bool", - "watchdog": "bool" -} -``` + ```json + { + "boot": "auto|manual", + "auto_update": "bool", + "network": { + "CONTAINER": "port|[ip, port]" + }, + "options": {}, + "audio_output": "null|0,0", + "audio_input": "null|0,0", + "ingress_panel": "bool", + "watchdog": "bool" + } + ``` -Reset custom network, audio and options, set it to `null`. +To reset customized network/audio/options, set it `null`. - POST `/addons/{addon}/security` -This function is not callable by itself. + This function is not callable by itself. -```json -{ - "protected": "bool" -} -``` + ```json + { + "protected": "bool" + } + ``` - POST `/addons/{addon}/start` - POST `/addons/{addon}/stop` @@ -656,113 +656,113 @@ This function is not callable by itself. - POST `/addons/{addon}/update` - GET `/addons/{addon}/logs` -Output is the raw Docker log. + Output is the raw Docker log. - POST `/addons/{addon}/restart` - POST `/addons/{addon}/rebuild` -Only supported for local build add-ons. + Only supported for local build add-ons. - POST `/addons/{addon}/stdin` -Write data to add-on stdin. + Write data to add-on stdin. - GET `/addons/{addon}/stats` -```json -{ - "cpu_percent": 0.0, - "memory_usage": 283123, - "memory_limit": 329392, - "memory_percent": 1.4, - "network_tx": 0, - "network_rx": 0, - "blk_read": 0, - "blk_write": 0 -} -``` + ```json + { + "cpu_percent": 0.0, + "memory_usage": 283123, + "memory_limit": 329392, + "memory_percent": 1.4, + "network_tx": 0, + "network_rx": 0, + "blk_read": 0, + "blk_write": 0 + } + ``` ### ingress - POST `/ingress/session` -Create a new session for access to the ingress service. + Create a new session for access to the ingress service. -```json -{ - "session": "token" -} -``` + ```json + { + "session": "token" + } + ``` - GET `/ingress/panels` -Return a list of enabled panels. + Return a list of enabled panels. -```json -{ - "panels": { - "addon_slug": { - "enable": "boolean", - "icon": "mdi:...", - "title": "title", - "admin": "boolean" + ```json + { + "panels": { + "addon_slug": { + "enable": "boolean", + "icon": "mdi:...", + "title": "title", + "admin": "boolean" + } } } -} -``` + ``` - VIEW `/ingress/{token}` -Ingress WebUI for this add-on. The add-on need support for the Home Assistant -authentication system. Needs an ingress session as cookie. + Ingress WebUI for this add-on. The add-on needs support for the Home Assistant + authentication system. Needs an ingress session as cookie. ### discovery - GET `/discovery` -```json -{ - "discovery": [ - { - "addon": "slug", - "service": "name", - "uuid": "uuid", - "config": {} + ```json + { + "discovery": [ + { + "addon": "slug", + "service": "name", + "uuid": "uuid", + "config": {} + } + ], + "services": { + "ozw": ["core_zwave"] } - ], - "services": { - "ozw": ["core_zwave"] } -} -``` + ``` - GET `/discovery/{UUID}` -```json -{ - "addon": "slug", - "service": "name", - "uuid": "uuid", - "config": {} -} -``` + ```json + { + "addon": "slug", + "service": "name", + "uuid": "uuid", + "config": {} + } + ``` - POST `/discovery` -```json -{ - "service": "name", - "config": {} -} -``` + ```json + { + "service": "name", + "config": {} + } + ``` -return: + return: -```json -{ - "uuid": "uuid" -} -``` + ```json + { + "uuid": "uuid" + } + ``` - DEL `/discovery/{UUID}` @@ -770,46 +770,46 @@ return: - GET `/services` -```json -{ - "services": [ - { - "slug": "name", - "available": "bool", - "providers": "list" - } - ] -} -``` + ```json + { + "services": [ + { + "slug": "name", + "available": "bool", + "providers": "list" + } + ] + } + ``` #### MQTT - GET `/services/mqtt` -```json -{ - "addon": "name", - "host": "xy", - "port": "8883", - "ssl": "bool", - "username": "optional", - "password": "optional", - "protocol": "3.1.1" -} -``` + ```json + { + "addon": "name", + "host": "xy", + "port": "8883", + "ssl": "bool", + "username": "optional", + "password": "optional", + "protocol": "3.1.1" + } + ``` - POST `/services/mqtt` -```json -{ - "host": "xy", - "port": "8883", - "ssl": "bool|optional", - "username": "optional", - "password": "optional", - "protocol": "3.1.1" -} -``` + ```json + { + "host": "xy", + "port": "8883", + "ssl": "bool|optional", + "username": "optional", + "password": "optional", + "protocol": "3.1.1" + } + ``` - DEL `/services/mqtt` @@ -817,26 +817,26 @@ return: - GET `/services/mysql` -```json -{ - "addon": "name", - "host": "xy", - "port": "8883", - "username": "optional", - "password": "optional" -} -``` + ```json + { + "addon": "name", + "host": "xy", + "port": "8883", + "username": "optional", + "password": "optional" + } + ``` - POST `/services/mysql` -```json -{ - "host": "xy", - "port": "8883", - "username": "optional", - "password": "optional" -} -``` + ```json + { + "host": "xy", + "port": "8883", + "username": "optional", + "password": "optional" + } + ``` - DEL `/services/mysql` @@ -844,54 +844,54 @@ return: - GET `/info` -```json -{ - "supervisor": "version", - "homeassistant": "version", - "hassos": "null|version", - "docker": "version", - "hostname": "name", - "operating_system": "HassOS XY|Ubuntu 16.4|null", - "features": ["shutdown", "reboot", "hostname", "services", "hassos"], - "machine": "type", - "arch": "arch", - "supported_arch": ["arch1", "arch2"], - "supported": "bool", - "channel": "stable|beta|dev", - "logging": "debug|info|warning|error|critical", - "timezone": "Europe/Zurich" -} -``` + ```json + { + "supervisor": "version", + "homeassistant": "version", + "hassos": "null|version", + "docker": "version", + "hostname": "name", + "operating_system": "HassOS XY|Ubuntu 16.4|null", + "features": ["shutdown", "reboot", "hostname", "services", "hassos"], + "machine": "type", + "arch": "arch", + "supported_arch": ["arch1", "arch2"], + "supported": "bool", + "channel": "stable|beta|dev", + "logging": "debug|info|warning|error|critical", + "timezone": "Europe/Zurich" + } + ``` ### DNS - GET `/dns/info` -```json -{ - "host": "ip-address", - "version": "1", - "version_latest": "2", - "servers": ["dns://8.8.8.8"], - "locals": ["dns://xy"] -} -``` + ```json + { + "host": "ip-address", + "version": "1", + "version_latest": "2", + "servers": ["dns://8.8.8.8"], + "locals": ["dns://xy"] + } + ``` - POST `/dns/options` -```json -{ - "servers": ["dns://8.8.8.8"] -} -``` + ```json + { + "servers": ["dns://8.8.8.8"] + } + ``` - POST `/dns/update` -```json -{ - "version": "VERSION" -} -``` + ```json + { + "version": "VERSION" + } + ``` - POST `/dns/restart` @@ -901,106 +901,106 @@ return: - GET `/dns/stats` -```json -{ - "cpu_percent": 0.0, - "memory_usage": 283123, - "memory_limit": 329392, - "memory_percent": 1.4, - "network_tx": 0, - "network_rx": 0, - "blk_read": 0, - "blk_write": 0 -} -``` + ```json + { + "cpu_percent": 0.0, + "memory_usage": 283123, + "memory_limit": 329392, + "memory_percent": 1.4, + "network_tx": 0, + "network_rx": 0, + "blk_read": 0, + "blk_write": 0 + } + ``` ### CLI - GET `/cli/info` -```json -{ - "version": "1", - "version_latest": "2" -} -``` + ```json + { + "version": "1", + "version_latest": "2" + } + ``` - POST `/cli/update` -```json -{ - "version": "VERSION" -} -``` + ```json + { + "version": "VERSION" + } + ``` - GET `/cli/stats` -```json -{ - "cpu_percent": 0.0, - "memory_usage": 283123, - "memory_limit": 329392, - "memory_percent": 1.4, - "network_tx": 0, - "network_rx": 0, - "blk_read": 0, - "blk_write": 0 -} -``` + ```json + { + "cpu_percent": 0.0, + "memory_usage": 283123, + "memory_limit": 329392, + "memory_percent": 1.4, + "network_tx": 0, + "network_rx": 0, + "blk_read": 0, + "blk_write": 0 + } + ``` ### Observer - GET `/observer/info` -```json -{ - "host": "ip-address", - "version": "1", - "version_latest": "2" -} -``` + ```json + { + "host": "ip-address", + "version": "1", + "version_latest": "2" + } + ``` - POST `/observer/update` -```json -{ - "version": "VERSION" -} -``` + ```json + { + "version": "VERSION" + } + ``` - GET `/observer/stats` -```json -{ - "cpu_percent": 0.0, - "memory_usage": 283123, - "memory_limit": 329392, - "memory_percent": 1.4, - "network_tx": 0, - "network_rx": 0, - "blk_read": 0, - "blk_write": 0 -} -``` + ```json + { + "cpu_percent": 0.0, + "memory_usage": 283123, + "memory_limit": 329392, + "memory_percent": 1.4, + "network_tx": 0, + "network_rx": 0, + "blk_read": 0, + "blk_write": 0 + } + ``` ### Multicast - GET `/multicast/info` -```json -{ - "version": "1", - "version_latest": "2" -} -``` + ```json + { + "version": "1", + "version_latest": "2" + } + ``` - POST `/multicast/update` -```json -{ - "version": "VERSION" -} -``` + ```json + { + "version": "VERSION" + } + ``` - POST `/multicast/restart` @@ -1008,109 +1008,109 @@ return: - GET `/multicast/stats` -```json -{ - "cpu_percent": 0.0, - "memory_usage": 283123, - "memory_limit": 329392, - "memory_percent": 1.4, - "network_tx": 0, - "network_rx": 0, - "blk_read": 0, - "blk_write": 0 -} -``` + ```json + { + "cpu_percent": 0.0, + "memory_usage": 283123, + "memory_limit": 329392, + "memory_percent": 1.4, + "network_tx": 0, + "network_rx": 0, + "blk_read": 0, + "blk_write": 0 + } + ``` ### Audio - GET `/audio/info` -```json -{ - "host": "ip-address", - "version": "1", - "latest_version": "2", - "audio": { - "card": [ - { - "name": "...", - "index": 1, - "driver": "...", - "profiles": [ - { - "name": "...", - "description": "...", - "active": false - } - ] - } - ], - "input": [ - { - "name": "...", - "index": 0, - "description": "...", - "volume": 0.3, - "mute": false, - "default": false, - "card": "null|int", - "applications": [ - { - "name": "...", - "index": 0, - "stream_index": 0, - "stream_type": "INPUT", - "volume": 0.3, - "mute": false, - "addon": "" - } - ] - } - ], - "output": [ - { - "name": "...", - "index": 0, - "description": "...", - "volume": 0.3, - "mute": false, - "default": false, - "card": "null|int", - "applications": [ - { - "name": "...", - "index": 0, - "stream_index": 0, - "stream_type": "OUTPUT", - "volume": 0.3, - "mute": false, - "addon": "" - } - ] - } - ], - "application": [ - { - "name": "...", - "index": 0, - "stream_index": 0, - "stream_type": "OUTPUT", - "volume": 0.3, - "mute": false, - "addon": "" - } - ] + ```json + { + "host": "ip-address", + "version": "1", + "latest_version": "2", + "audio": { + "card": [ + { + "name": "...", + "index": 1, + "driver": "...", + "profiles": [ + { + "name": "...", + "description": "...", + "active": false + } + ] + } + ], + "input": [ + { + "name": "...", + "index": 0, + "description": "...", + "volume": 0.3, + "mute": false, + "default": false, + "card": "null|int", + "applications": [ + { + "name": "...", + "index": 0, + "stream_index": 0, + "stream_type": "INPUT", + "volume": 0.3, + "mute": false, + "addon": "" + } + ] + } + ], + "output": [ + { + "name": "...", + "index": 0, + "description": "...", + "volume": 0.3, + "mute": false, + "default": false, + "card": "null|int", + "applications": [ + { + "name": "...", + "index": 0, + "stream_index": 0, + "stream_type": "OUTPUT", + "volume": 0.3, + "mute": false, + "addon": "" + } + ] + } + ], + "application": [ + { + "name": "...", + "index": 0, + "stream_index": 0, + "stream_type": "OUTPUT", + "volume": 0.3, + "mute": false, + "addon": "" + } + ] + } } -} -``` + ``` - POST `/audio/update` -```json -{ - "version": "VERSION" -} -``` + ```json + { + "version": "VERSION" + } + ``` - POST `/audio/restart` @@ -1120,97 +1120,97 @@ return: - POST `/audio/volume/input` -```json -{ - "index": "...", - "volume": 0.5 -} -``` + ```json + { + "index": "...", + "volume": 0.5 + } + ``` - POST `/audio/volume/output` -```json -{ - "index": "...", - "volume": 0.5 -} -``` + ```json + { + "index": "...", + "volume": 0.5 + } + ``` - POST `/audio/volume/{output|input}/application` -```json -{ - "index": "...", - "volume": 0.5 -} -``` + ```json + { + "index": "...", + "volume": 0.5 + } + ``` - POST `/audio/mute/input` -```json -{ - "index": "...", - "active": false -} -``` + ```json + { + "index": "...", + "active": false + } + ``` - POST `/audio/mute/output` -```json -{ - "index": "...", - "active": false -} -``` + ```json + { + "index": "...", + "active": false + } + ``` - POST `/audio/mute/{output|input}/application` -```json -{ - "index": "...", - "active": false -} -``` + ```json + { + "index": "...", + "active": false + } + ``` - POST `/audio/default/input` -```json -{ - "name": "..." -} -``` + ```json + { + "name": "..." + } + ``` - POST `/audio/default/output` -```json -{ - "name": "..." -} -``` + ```json + { + "name": "..." + } + ``` - POST `/audio/profile` -```json -{ - "card": "...", - "name": "..." -} -``` + ```json + { + "card": "...", + "name": "..." + } + ``` - GET `/audio/stats` -```json -{ - "cpu_percent": 0.0, - "memory_usage": 283123, - "memory_limit": 329392, - "memory_percent": 1.4, - "network_tx": 0, - "network_rx": 0, - "blk_read": 0, - "blk_write": 0 -} -``` + ```json + { + "cpu_percent": 0.0, + "memory_usage": 283123, + "memory_limit": 329392, + "memory_percent": 1.4, + "network_tx": 0, + "network_rx": 0, + "blk_read": 0, + "blk_write": 0 + } + ``` ### Authentication/SSO API @@ -1227,9 +1227,9 @@ We support: * POST `/auth/reset` -```json -{ - "username": "xy", - "password": "new-password" -} -``` + ```json + { + "username": "xy", + "password": "new-password" + } + ```