From a7f7da3084d8f446d1a4d9f7ebe981bdbed4b5eb Mon Sep 17 00:00:00 2001 From: Mike Degatano Date: Thu, 21 Mar 2024 13:47:06 -0400 Subject: [PATCH] Document new /os/boot-slot endpoint (#2107) * Document new /os/boot-slot endpoint * `boot_name` to `boot_slot` --- docs/api/supervisor/endpoints.md | 43 +++++++++++++++++++++++++------- docs/api/supervisor/models.md | 8 ++++++ 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/docs/api/supervisor/endpoints.md b/docs/api/supervisor/endpoints.md index 16ffd321..a57bdb54 100644 --- a/docs/api/supervisor/endpoints.md +++ b/docs/api/supervisor/endpoints.md @@ -2270,14 +2270,15 @@ Returns information about the OS. **Returned data:** -| key | type | description | -| ---------------- | ------- | ------------------------------------------------------------ | -| version | string | The current version of the OS | -| version_latest | string | The latest published version of the OS in the active channel | -| update_available | boolean | `true` if an update is available | -| board | string | The name of the board | -| boot | string | Which slot that are in use | -| data_disk | string | Device which is used for holding OS data persistent | +| key | type | description | +| ---------------- | ------- | ---------------------------------------------------------------------------- | +| version | string | The current version of the OS | +| version_latest | string | The latest published version of the OS in the active channel | +| update_available | boolean | `true` if an update is available | +| board | string | The name of the board | +| boot | string | Which slot that are in use | +| data_disk | string | Device which is used for holding OS data persistent | +| boot_slots | dict | Dictionary of [boot slots](api/supervisor/models.md#boot-slot) keyed by name | **Example response:** @@ -2288,7 +2289,19 @@ Returns information about the OS. "update_available": true, "board": "ova", "boot": "slot1", - "data_disk": "BJTD4R-0x123456789" + "data_disk": "BJTD4R-0x123456789", + "boot_slots": { + "A": { + "state": "inactive", + "status": "good", + "version": "10.1" + }, + "B": { + "state": "active", + "status": "good", + "version": "10.2" + } + } } ``` @@ -2306,6 +2319,18 @@ Update Home Assistant OS + + +Change the active boot slot, **This will also reboot the device!** + +**Payload:** + +| key | type | description | +| --------- | ------ | ------------------------------------------------------------------------ | +| boot_slot | string | Boot slot to change to. See options in `boot_slots` from `/os/info` API. | + + + Returns possible targets for the new data partition. diff --git a/docs/api/supervisor/models.md b/docs/api/supervisor/models.md index 70852155..cdbc198e 100644 --- a/docs/api/supervisor/models.md +++ b/docs/api/supervisor/models.md @@ -307,3 +307,11 @@ Response only fields will be in responses but cannot be included in requests. | ---------- | ------- | ---------------------------------------------- | | type | string | Type of error that occurred | | message | string | Human-readable description of what went wrong | + +## Boot Slot + +| key | type | description | +| ---------- | ------- | ----------------------------------------------- | +| state | string | Active or inactive (active slot is in use) | +| status | string | Status of the last boot from slot (good or bad) | +| version | string | Version of OS installed |