Data disk APIs use UDisks2 info (#1727)

This commit is contained in:
Mike Degatano 2023-03-27 12:09:31 -04:00 committed by GitHub
parent dab13a9432
commit 4b1a500956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 7 deletions

View File

@ -2035,7 +2035,7 @@ Returns information about the OS.
"update_available": true, "update_available": true,
"board": "ova", "board": "ova",
"boot": "slot1", "boot": "slot1",
"data_disk": "/dev/sda" "data_disk": "BJTD4R-0x123456789"
} }
``` ```
@ -2059,17 +2059,38 @@ Returns possible targets for the new data partition.
**Returned data:** **Returned data:**
| key | type | description | | key | type | description |
| ---------------- | ------- | ------------------------------------------------------------ | | ---------------- | ------- | ----------------------------------------------------------------------------------- |
| devices | list | List with devices paths of possible disk targets | | 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:** **Example response:**
```json ```json
{ {
"devices": [ "devices": [
"/dev/sda", "Generic-Flash-Disk-123ABC456",
"/dev/sdb" "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 | | 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 |
</ApiEndpoint> </ApiEndpoint>

View File

@ -254,3 +254,15 @@ The `content` key of a backup object contains the following keys:
| by_id | string or null | Udev by ID link | | by_id | string or null | Udev by ID link |
| attributes | dict | A dict with pure udev device attributes for debug and understanding | | attributes | dict | A dict with pure udev device attributes for debug and understanding |
| children | list | A list of path to the children sysfs devices | | 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 |