Add drive info to /hardware/info (#1684)

This commit is contained in:
Mike Degatano 2024-03-22 06:39:33 -04:00 committed by GitHub
parent 9b8f42920d
commit aba5b6af91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 53 additions and 0 deletions

View File

@ -1430,6 +1430,31 @@ Get hardware information.
"/sys/devices/soc/platform/00ef"
]
}
],
"drives": [
{
"vendor": "Generic",
"model": "Flash Disk",
"revision": "8.07",
"serial": "AABBCCDD",
"id": "Generic-Flash-Disk-AABBCCDD",
"size": 8054112256,
"time_detected": "2023-02-15T21:44:22.504878+00:00",
"connection_bus": "usb",
"seat": "seat0",
"removable": true,
"ejectable": true,
"filesystems": [
{
"device": "/dev/sda1",
"id": "by-uuid-1122-1ABA",
"size": 67108864,
"name": "",
"system": false,
"mount_points": []
}
]
}
]
}
```
@ -1439,6 +1464,7 @@ Get hardware information.
| key | description |
| -------- | ------------------------------------------------------------ |
| devices | A list of [Device models](api/supervisor/models.md#device) |
| drives | A list of [Drive models](api/supervisor/models.md#drive)
</ApiEndpoint>

View File

@ -315,3 +315,30 @@ Response only fields will be in responses but cannot be included in requests.
| 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 |
## Drive
| key | type | description |
| -------------- | -------- | ----------------------------------------------------------- |
| vendor | string | Drive vendor |
| model | string | Drive model |
| serial | string | Drive serial number |
| id | string | Unique and persistent id for drive |
| size | int | Size of the drive in bytes |
| time_detected | datetime | Time drive was detected by system |
| connection_bus | string | Physical connection bus of the drive (USB, etc.) |
| seat | string | Identifier of seat drive is plugged into |
| removable | boolean | Is the drive removable by the user? |
| ejectable | boolean | Is the drive ejectable by the system? |
| filesystems | list | A list of [filesystem partitions](#filesystem) on the drive |
## Filesystem
| key | type | description |
| ------------ | ------- | --------------------------------------------------------- |
| device | string | Special device file for the filesystem (e.g. `/dev/sda1`) |
| id | string | Unique and persistent id for filesystem |
| size | int | Size of the filesystem in bytes |
| name | string | Name of the filesystem (if known) |
| system | boolean | `true` if filesystem considered a system/internal device |
| mount_points | list | List of paths where the filesystem is mounted. |