1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00
Files
supervisor/API.md
Pascal Vizeli ff640c598d Support for repository store. (#26)
* Support for repository store.

* Fix api

* part 1 of restruct and migrate pathlib

* Migrate p2

* fix lint / cleanups

* fix lint p2

* fix lint p3
2017-05-02 00:02:55 +02:00

3.6 KiB

HassIO Server

HassIO REST API

Interface for HomeAssistant to control things from supervisor.

On error:

{
    "result": "error",
    "message": ""
}

On success

{
    "result": "ok",
    "data": { }
}

HassIO

  • GET /supervisor/ping

  • GET /supervisor/info

The addons from addons are only installed one.

{
    "version": "INSTALL_VERSION",
    "last_version": "LAST_VERSION",
    "beta_channel": "true|false",
    "addons": [
        {
            "name": "xy bla",
            "slug": "xy",
            "version": "INSTALL_VERSION",
            "last_version": "VERSION_FOR_UPDATE",
            "detached": "bool",
            "description": "description"
        }
    ],
    "addons_repositories": [
        "REPO_URL"
    ]
}
  • GET /supervisor/addons

Get all available addons

{
    "addons": [
        {
            "name": "xy bla",
            "slug": "xy",
            "repository": "12345678|null",
            "version": "LAST_VERSION",
            "installed": "none|INSTALL_VERSION",
            "detached": "bool",
            "description": "description"
        }
    ],
    "repositories": [
        {
            "slug": "12345678",
            "name": "Repitory Name",
            "url": "WEBSITE",
            "maintainer": "BLA BLU <fla@dld.ch>"
        }
    ]
}
  • POST /supervisor/update Optional:
{
    "version": "VERSION"
}
  • POST /supervisor/options
{
    "beta_channel": "true|false",
    "addons_repositories": [
        "REPO_URL"
    ]
}
  • POST /supervisor/reload

Reload addons/version.

  • GET /supervisor/logs

Output the raw docker log

Host

  • POST /host/shutdown

  • POST /host/reboot

  • GET /host/info See HostControl info command.

{
    "type": "",
    "version": "",
    "last_version": "",
    "features": ["shutdown", "reboot", "update", "network_info", "network_control"],
    "hostname": "",
    "os": ""
}
  • POST /host/update Optional:
{
    "version": "VERSION"
}

Network

  • GET /network/info

  • POST /network/options

{
    "hostname": "",
    "mode": "dhcp|fixed",
    "ssid": "",
    "ip": "",
    "netmask": "",
    "gateway": ""
}

HomeAssistant

  • GET /homeassistant/info
{
    "version": "INSTALL_VERSION",
    "last_version": "LAST_VERSION"
}
  • POST /homeassistant/update Optional:
{
    "version": "VERSION"
}
  • GET /homeassistant/logs

Output the raw docker log

REST API addons

  • GET /addons/{addon}/info
{
    "version": "VERSION",
    "last_version": "LAST_VERSION",
    "state": "started|stopped",
    "boot": "auto|manual",
    "options": {},
}
  • POST /addons/{addon}/options
{
    "boot": "auto|manual",
    "options": {},
}
  • POST /addons/{addon}/start

  • POST /addons/{addon}/stop

  • POST /addons/{addon}/install Optional:

{
    "version": "VERSION"
}
  • POST /addons/{addon}/uninstall

  • POST /addons/{addon}/update Optional:

{
    "version": "VERSION"
}
  • GET /addons/{addon}/logs

Output the raw docker log

Host Control

Communicate over unix socket with a host daemon.

  • commands
# info
-> {'type', 'version', 'last_version', 'features', 'hostname'}
# reboot
# shutdown
# host-update [v]

# network info
# network hostname xy
# network wlan ssd xy
# network wlan password xy
# network int ip xy
# network int netmask xy
# network int route xy

features:

  • shutdown
  • reboot
  • update
  • network_info
  • network_control

Answer:

{}|OK|ERROR|WRONG
  • {}: json
  • OK: call was successfully
  • ERROR: error on call
  • WRONG: not supported