diff --git a/docs/add-ons/configuration.md b/docs/add-ons/configuration.md index 7336450f..d9c4e203 100644 --- a/docs/add-ons/configuration.md +++ b/docs/add-ons/configuration.md @@ -179,10 +179,10 @@ image: repo/{arch}-my-custom-addon | panel_icon | string | no | Default: `mdi:puzzle`. MDI icon for the menu panel integration. | panel_title | string | no | Default is the add-on name, but can be modified with this option. | panel_admin | bool | no | Default `true`. Make menu entry only available with admin privileged. -| snapshot | string | no | `hot` (default) or `cold`. If `cold`, the supervisor turns the add-on off before taking a snapshot (the `pre/post` options are ignored when `cold` is used). -| snapshot_pre | string | no | Command to execute in the context of the add-on before the snapshot is taken. -| snapshot_post | string | no | Command to execute in the context of the add-on after the snapshot was taken. -| snapshot_exclude | list | no | List of file/path (with glob support) that are excluded from snapshots. +| backup | string | no | `hot` (default) or `cold`. If `cold`, the supervisor turns the add-on off before taking a backup (the `pre/post` options are ignored when `cold` is used). +| backup_pre | string | no | Command to execute in the context of the add-on before the backup is taken. +| backup_post | string | no | Command to execute in the context of the add-on after the backup was taken. +| backup_exclude | list | no | List of file/path (with glob support) that are excluded from backups. | advanced | bool | no | Default `false`. Make addon visible in simple mode. | stage | string | no | Default `stable`. Flag add-on with follow attribute: `stable`, `experimental` or `deprecated` | init | bool | no | Default `true`. Disable the Docker default system init. Use this if the image has its own init system. diff --git a/docs/add-ons/security.md b/docs/add-ons/security.md index a5505bf7..1b9558c4 100644 --- a/docs/add-ons/security.md +++ b/docs/add-ons/security.md @@ -14,7 +14,7 @@ For access to Supervisor API you need define a role or you run in default mode. |------|-------------| | default | Have access to all `info` calls | | homeassistant | Can access all Home Assistant API endpoints | -| backup | Can access all snapshot API endpoints | +| backup | Can access all backup API endpoints | | manager | Is for Add-ons that run CLIs and need extended rights | | admin | Have access to every API call. That is the only one they can disable/enable the Add-on protection mode | diff --git a/docs/api/supervisor/endpoints.md b/docs/api/supervisor/endpoints.md index 509f82fd..e5ce36ce 100644 --- a/docs/api/supervisor/endpoints.md +++ b/docs/api/supervisor/endpoints.md @@ -694,6 +694,149 @@ Reset internal authentication cache, this is useful if you have changed the pass +### Backup + + + +Return a list of [Backups](api/supervisor/models.md#backup) + +**Example response:** + +```json +{ + "backups": [ + { + "slug": "skuwe823", + "date": "2020-09-30T20:25:34.273Z", + "name": "Awesome backup", + "type": "partial", + "protected": true, + "content": { + "homeassistant": true, + "addons": ["awesome_addon"], + "folders": ["ssl", "media"] + } + } + ] +} +``` + + + + + +Create a full backup. + +**Payload:** + +| key | type | optional | description | +| -------- | ------ | -------- | ------------------------------------------ | +| name | string | True | The name you want to give the backup | +| password | string | True | The password you want to give the backup | + +**Example response:** + +```json +{ + "slug": "skuwe823" +} +``` + + + + + +Upload a backup. + +**Example response:** + +```json +{ + "slug": "skuwe823" +} +``` + + + + + +Create a partial backup. + +**Payload:** + +| key | type | optional | description | +| -------- | ------ | -------- | ------------------------------------------- | +| name | string | True | The name you want to give the backup | +| password | string | True | The password you want to give the backup | +| addons | list | True | A list of strings representing add-on slugs | +| folders | list | True | A list of strings representing directories | + +**You need to supply at least one key in the payload.** + +**Example response:** + +```json +{ + "slug": "skuwe823" +} +``` + + + + + +Reload backup from storage. + + + + + +Download the backup file with the given slug. + + + + + +Returns a [Backup details model](api/supervisor/models.md#backup-details) for the add-on. + + + + + +Removes the backup file with the given slug. + + + + + +Does a full restore of the backup with the given slug. + +**Payload:** + +| key | type | optional | description | +| -------- | ------ | -------- | ------------------------------------ | +| password | string | True | The password for the backup if any | + + + + + +Does a partial restore of the backup with the given slug. + +**Payload:** + +| key | type | optional | description | +| ------------- | ------- | -------- | ---------------------------------------------- | +| homeassistant | boolean | True | `true` if Home Assistant should be restored | +| addons | list | True | A list of add-on slugs that should be restored | +| folders | list | True | A list of directories that should be restored | +| password | string | True | The password for the backup if any | + +**You need to supply at least one key in the payload.** + + + + ### CLI @@ -1713,7 +1856,7 @@ Update Home Assistant OS "suggestions": [ { "uuid": "B9923620C9A11EBBDC3C403FC2CA371", - "type": "clear_snapshots", + "type": "clear_backups", "context": "system", "reference": null } @@ -1899,149 +2042,6 @@ Deletes the service definitions -### Snapshot - - - -Return a list of [Snapshot models](api/supervisor/models.md#snapshot) - -**Example response:** - -```json -{ - "snapshots": [ - { - "slug": "skuwe823", - "date": "2020-09-30T20:25:34.273Z", - "name": "Awesome snapshot", - "type": "partial", - "protected": true, - "content": { - "homeassistant": true, - "addons": ["awesome_addon"], - "folders": ["ssl", "media"] - } - } - ] -} -``` - - - - - -Create a full snapshot. - -**Payload:** - -| key | type | optional | description | -| -------- | ------ | -------- | ------------------------------------------ | -| name | string | True | The name you want to give the snapshot | -| password | string | True | The password you want to give the snapshot | - -**Example response:** - -```json -{ - "slug": "skuwe823" -} -``` - - - - - -Upload a snapshot. - -**Example response:** - -```json -{ - "slug": "skuwe823" -} -``` - - - - - -Create a partial snapshot. - -**Payload:** - -| key | type | optional | description | -| -------- | ------ | -------- | ------------------------------------------- | -| name | string | True | The name you want to give the snapshot | -| password | string | True | The password you want to give the snapshot | -| addons | list | True | A list of strings representing add-on slugs | -| folders | list | True | A list of strings representing directories | - -**You need to supply at least one key in the payload.** - -**Example response:** - -```json -{ - "slug": "skuwe823" -} -``` - - - - - -Reload snapshots from storage. - - - - - -Download the snapshot file with the given slug. - - - - - -Returns a [Snapshot details model](api/supervisor/models.md#snapshot-details) for the add-on. - - - - - -Removes the snapshot file with the given slug. - - - - - -Does a full restore of the snapshot with the given slug. - -**Payload:** - -| key | type | optional | description | -| -------- | ------ | -------- | ------------------------------------ | -| password | string | True | The password for the snapshot if any | - - - - - -Does a partial restore of the snapshot with the given slug. - -**Payload:** - -| key | type | optional | description | -| ------------- | ------- | -------- | ---------------------------------------------- | -| homeassistant | boolean | True | `true` if Home Assistant should be restored | -| addons | list | True | A list of add-on slugs that should be restored | -| folders | list | True | A list of directories that should be restored | -| password | string | True | The password for the snapshot if any | - -**You need to supply at least one key in the payload.** - - - - ### Store @@ -2380,6 +2380,6 @@ Some of the endpoints uses placeholders indicated with `<...>` in the endpoint U | interface | A valid interface name, example `eth0`, to get the interface name you can call `/network/info`. You can use `default` to get the primary interface | | registry | A registry hostname defined in the container registry configuration, to get the hostname you can call `/docker/registries` | | service | The service name for a service on the host. | -| snapshot | A valid snapshot slug, example `skuwe823`, to get the slug you can call `/snapshots` | -| suggestion | A valid suggestion, example `clear_full_snapshot`, to get the suggestion you can call `/resolution` | +| backup | A valid backup slug, example `skuwe823`, to get the slug you can call `/backups` | +| suggestion | A valid suggestion, example `clear_full_backup`, to get the suggestion you can call `/resolution` | | uuid | The UUID of a discovery service, to get the UUID you can call `/discovery` | diff --git a/docs/api/supervisor/models.md b/docs/api/supervisor/models.md index b75ca8c5..bd42cdb3 100644 --- a/docs/api/supervisor/models.md +++ b/docs/api/supervisor/models.md @@ -166,39 +166,39 @@ These models are describing objects that are getting returned from the superviso | available | boolean | `true` if the service is available | | providers | list | A list of providers for the service | -## Snapshot +## Backup | key | type | description | | --------- | ------- | --------------------------------------------------------------------- | -| slug | string | A generated slug for the snapshot | -| date | string | ISO date string representation of the date the snapshot was created | -| name | string | The name given to the snapshot | -| type | string | The type of snapshot (full, partial) | -| protected | boolean | `true` if the snapshot is password protected | -| content | dictionary | A dictionary describing the content of the snapshot | +| slug | string | A generated slug for the backup | +| date | string | ISO date string representation of the date the backup was created | +| name | string | The name given to the backup | +| type | string | The type of backup (full, partial) | +| protected | boolean | `true` if the backup is password protected | +| content | dictionary | A dictionary describing the content of the backup | -### Snapshot -> content +### Backup -> content -The `content` key of a snapshot object contains the following keys: +The `content` key of a backup object contains the following keys: | key | type | description | | --------- | ------- | --------------------------------------------------------------------- | -| homeassistant | boolean | `true` if the snapshot contains homeassistant -| addons | list | A list of add-on slugs included in the snapshot -| folders | list | A list of folder names included in the snapshot +| homeassistant | boolean | `true` if the backup contains homeassistant +| addons | list | A list of add-on slugs included in the backup +| folders | list | A list of folder names included in the backup -## Snapshot details +## Backup details | key | type | description | | ------------- | ------- | -------------------------------------------------------------------------------------------------------------------------- | -| slug | string | A generated slug for the snapshot | -| type | string | The type of snapshot (full, partial) | -| name | string | The name given to the snapshot | -| date | string | ISO date string representation of the date the snapshot was created | -| size | string | The size of the snapshot in MB | -| protected | boolean | `true` if the snapshot is password protected | +| slug | string | A generated slug for the backup | +| type | string | The type of backup (full, partial) | +| name | string | The name given to the backup | +| date | string | ISO date string representation of the date the backup was created | +| size | string | The size of the backup in MB | +| protected | boolean | `true` if the backup is password protected | | homeassistant | string | The version of Home Assistant that was in use | -| addons | list | A list of add-ons in the snapshot, addons are represented as a dictionary with these keys [`slug`,`name`,`version`,`size`] | +| addons | list | A list of add-ons in the backup, addons are represented as a dictionary with these keys [`slug`,`name`,`version`,`size`] | | repositories | list | A list of add-on repository URL's as strings | | folders | list | A list of strings representing directories | diff --git a/docs/frontend/data.md b/docs/frontend/data.md index 3f43a04a..d443d8cc 100644 --- a/docs/frontend/data.md +++ b/docs/frontend/data.md @@ -130,11 +130,11 @@ this.hass.callWS({ ### `hass.callApi(method, path, data)` -Call an API on the Home Assistant server. For example, if you want to fetch all Home Assistant snapshots by issuing a GET request to `/api/hassio/snapshots`: +Call an API on the Home Assistant server. For example, if you want to fetch all Home Assistant backups by issuing a GET request to `/api/hassio/backups`: ```js -hass.callApi('get', 'hassio/snapshots') - .then(snapshots => console.log('Received snapshots!', snapshots)); +hass.callApi('get', 'hassio/backups') + .then(backups => console.log('Received backups!', backups)); ``` If you need to pass in data, pass a third argument: