From 4b1a50095637be5d5575cd4982fc913afc995c8b Mon Sep 17 00:00:00 2001 From: Mike Degatano Date: Mon, 27 Mar 2023 12:09:31 -0400 Subject: [PATCH] Data disk APIs use UDisks2 info (#1727) --- docs/api/supervisor/endpoints.md | 35 +++++++++++++++++++++++++------- docs/api/supervisor/models.md | 12 +++++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/docs/api/supervisor/endpoints.md b/docs/api/supervisor/endpoints.md index 08730977..9cbceef5 100644 --- a/docs/api/supervisor/endpoints.md +++ b/docs/api/supervisor/endpoints.md @@ -2035,7 +2035,7 @@ Returns information about the OS. "update_available": true, "board": "ova", "boot": "slot1", - "data_disk": "/dev/sda" + "data_disk": "BJTD4R-0x123456789" } ``` @@ -2059,17 +2059,38 @@ Returns possible targets for the new data partition. **Returned data:** -| key | type | description | -| ---------------- | ------- | ------------------------------------------------------------ | -| devices | list | List with devices paths of possible disk targets | +| key | type | description | +| ---------------- | ------- | ----------------------------------------------------------------------------------- | +| devices | list | List of IDs of possible data disk targets | +| disks | list | List of [disks](api/supervisor/models.md#disk) which are possible data disk targets | **Example response:** ```json { "devices": [ - "/dev/sda", - "/dev/sdb" + "Generic-Flash-Disk-123ABC456", + "SSK-SSK-Storage-ABC123DEF" + ], + "disks": [ + { + "name": "Generic Flash Disk (123ABC456)", + "vendor": "Generic", + "model": "Flash Disk", + "serial": "123ABC456", + "size": 8054112256, + "id": "Generic-Flash-Disk-123ABC456", + "dev_path": "/dev/sda" + }, + { + "name": "SSK SSK Storage (ABC123DEF)", + "vendor": "SSK", + "model": "SSK Storage", + "serial": "ABC123DEF", + "size": 250059350016, + "id": "SSK-SSK-Storage-ABC123DEF", + "dev_path": "/dev/sdb" + } ] } ``` @@ -2084,7 +2105,7 @@ Move datadisk to a new location, **This will also reboot the device!** | key | type | description | | ------- | ------ | ----------------------------------------------------------------- | -| device | string | Path to the new device which should be use as the target for the data migration | +| device | string | ID of the disk device which should be used as the target for the data migration | diff --git a/docs/api/supervisor/models.md b/docs/api/supervisor/models.md index 06d72cf7..f83f972b 100644 --- a/docs/api/supervisor/models.md +++ b/docs/api/supervisor/models.md @@ -254,3 +254,15 @@ The `content` key of a backup object contains the following keys: | by_id | string or null | Udev by ID link | | attributes | dict | A dict with pure udev device attributes for debug and understanding | | children | list | A list of path to the children sysfs devices | + +## Disk + +| key | type | description | +| ---------- | -------------- | ---------------------------------------------------------------------- | +| name | string | Name of the disk device | +| vendor | string | Vendor of the disk device | +| model | string | Model of the disk device | +| serial | string | Serial number of the disk device | +| size | int | Size of disk in bytes | +| id | string | Unique ID for the disk device (either UDisks2 drive ID or device path) | +| dev_path | string | Device path for the disk device |