supervisor/API.md
Pascal Vizeli 76cead72e8 Update API for hass api v2 (#14)
* Update API for hass api v2

* fix lint

* Refactory the old version of host_control

* cleanup

* Cleanup name inside addons/data

* Cleanup name inside addons/data p2

* Rename api list

* Fix path bug

* Fix wrong config set
2017-04-26 11:15:56 +02:00

2.8 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

  • /supervisor/ping

  • /supervisor/info

{
    "version": "INSTALL_VERSION",
    "last_version": "CURRENT_VERSION",
    "beta_channel": "true|false",
    "addons": [
        {
            "name": "xy bla",
            "slug": "xy",
            "version": "LAST_VERSION",
            "installed": "none|INSTALL_VERSION",
            "dedicated": "bool",
            "description": "description"
        }
    ]
}
  • /supervisor/update Optional:
{
    "version": "VERSION"
}
  • /supervisor/option
{
    "beta_channel": "true|false"
}
  • /supervisor/reload

Reload addons/version.

  • /supervisor/logs

Output the raw docker log

Host

  • /host/shutdown

  • /host/reboot

  • /host/info See HostControl info command.

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

Network

  • /network/info

  • /network/options

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

HomeAssistant

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

Output the raw docker log

REST API addons

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

  • /addons/{addon}/stop

  • /addons/{addon}/install Optional:

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

  • /addons/{addon}/update Optional:

{
    "version": "VERSION"
}
  • /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