diff --git a/docs/api/supervisor/endpoints.md b/docs/api/supervisor/endpoints.md index 7cb26350..75bdc457 100644 --- a/docs/api/supervisor/endpoints.md +++ b/docs/api/supervisor/endpoints.md @@ -770,6 +770,7 @@ Create a full backup. | compressed | boolean | True | `false` to create uncompressed backups | | location | string or null | True | Name of a backup mount or `null` for /backup | | homeassistant_exclude_database | boolean | True | Exclude the Home Assistant database file from backup | +| background | boolean | True | Return `job_id` immediately, do not wait for backup to complete. Clients must check job for status and slug. | **Example response:** @@ -789,10 +790,18 @@ Upload a backup. ```json { - "slug": "skuwe823" + "slug": "skuwe823", + "job_id": "abc123" } ``` +:::note + +Error responses from this API may also include a `job_id` if the message alone cannot accurately describe what happened. +Callers should direct users to review the job or supervisor logs to get an understanding of what occurred. + +::: + @@ -811,6 +820,7 @@ Create a partial backup. | compressed | boolean | True | `false` to create uncompressed backups | | location | string or null | True | Name of a backup mount or `null` for /backup | | homeassistant_exclude_database | boolean | True | Exclude the Home Assistant database file from backup | +| background | boolean | True | Return `job_id` immediately, do not wait for backup to complete. Clients must check job for status and slug. | **You need to supply at least one key in the payload.** @@ -818,10 +828,18 @@ Create a partial backup. ```json { - "slug": "skuwe823" + "slug": "skuwe823", + "job_id": "abc123" } ``` +:::note + +Error responses from this API may also include a `job_id` if the message alone cannot accurately describe what happened. +Callers should direct users to review the job or supervisor logs to get an understanding of what occurred. + +::: + @@ -893,9 +911,25 @@ 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 | +| key | type | optional | description | +| ---------- | ------- | -------- | ------------------------------------ | +| password | string | True | The password for the backup if any | +| background | boolean | True | Return `job_id` immediately, do not wait for restore to complete. Clients must check job for status. | + +**Example response:** + +```json +{ + "job_id": "abc123" +} +``` + +:::note + +Error responses from this API may also include a `job_id` if the message alone cannot accurately describe what happened. +Callers should direct users to review the job or supervisor logs to get an understanding of what occurred. + +::: @@ -910,10 +944,26 @@ Does a partial restore of the backup with the given slug. | 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 | +| password | string | True | The password for the backup if any | +| background | boolean | True | Return `job_id` immediately, do not wait for restore to complete. Clients must check job for status. | **You need to supply at least one key in the payload.** +**Example response:** + +```json +{ + "job_id": "abc123" +} +``` + +:::note + +Error responses from this API may also include a `job_id` if the message alone cannot accurately describe what happened. +Callers should direct users to review the job or supervisor logs to get an understanding of what occurred. + +::: + ### CLI diff --git a/docs/api/supervisor/models.md b/docs/api/supervisor/models.md index e396426c..9bbec2cd 100644 --- a/docs/api/supervisor/models.md +++ b/docs/api/supervisor/models.md @@ -275,7 +275,7 @@ The `content` key of a backup object contains the following keys: | ---------- | -------------- | ---------------------------------------------------------------------- | ---------------- | | name | string | Name of the mount | both | | type | string | Type of the mount (cifs or nfs) | both | -| usage | string | Usage of the mount (backup, media, or share) | both | +| usage | string | Usage of the mount (backup, media, or share) | both | | server | string | IP address or hostname of the network share server | both | | port | int | Port to use (if not using the standard one for the mount type) | both | | path | string | (nfs mounts only) Path to mount from the network share | both | @@ -298,3 +298,11 @@ Response only fields will be in responses but cannot be included in requests. | stage | string | A name for the stage the job is in (if applicable) | | done | boolean | Is the job complete | | child_jobs | list | A list of child [jobs](#job) started by this one | +| errors | list | A list of [errors](#job-error) that occurred during execution | + +## Job Error + +| key | type | description | +| ---------- | ------- | ---------------------------------------------- | +| type | string | Type of error that occurred | +| message | string | Human-readable description of what went wrong |