schema: re-introspect Unraid API against 7.3
7.3 findings (all existing queries confirmed working — no breaking changes): - ArrayParity/ArrayCache no longer exist as named types; everything is ArrayDisk - InfoOs gained: kernel, arch, fqdn, build, codename, platform, serial, uefi - InfoCpu gained: manufacturer, model, speed, speedmin/max, processors, socket, topology - ArrayDisk gained: idx, numReads/Writes/Errors, warning/critical temps, color, fsType - MemoryUtilization gained: free, active, buffcache, swapFree, percentSwapTotal Changes: - Add kernel to master GQL query (useful for display) - Update schema comments to reflect 7.3 reality - Remove ArrayParity/ArrayCache from api_test.php introspection (now null types) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
4187d52bac
commit
b093cae70d
@@ -2,14 +2,20 @@
|
||||
// Unraid GraphQL API — single-request master fetch + per-function fallback tracking.
|
||||
// All API-first functions call vv_api_data() then fall back to local reads on null.
|
||||
//
|
||||
// Confirmed schema (introspected 2026-05-29):
|
||||
// InfoOs: hostname, uptime (String), release — no version/uptime-as-int
|
||||
// InfoCpu: brand, threads, cores — no physicalCores/currentLoad
|
||||
// InfoMemory: layout only — NO usage fields; memory usage stays as local read
|
||||
// ArrayDisk: single list for all types (DATA/PARITY/CACHE); fields: name, device,
|
||||
// type (ArrayDiskType enum), status (ArrayDiskStatus enum), size (BigInt),
|
||||
// fsSize, fsFree, fsUsed (BigInt), temp, transport (String), rotational,
|
||||
// isSpinning — no free/mounted
|
||||
// Confirmed schema (introspected 2026-05-31, Unraid 7.3):
|
||||
// InfoOs: hostname, uptime (String), release, kernel (NEW 7.3), arch (NEW 7.3)
|
||||
// — also new but unused: fqdn, build, codename, platform, distro, serial, uefi
|
||||
// — no version/uptime-as-int
|
||||
// InfoCpu: brand, threads, cores — also new but unused: manufacturer, model, speed,
|
||||
// speedmin, speedmax, processors, socket, topology, packages
|
||||
// InfoMemory: layout only — NO usage fields; memory usage via metrics.memory
|
||||
// ArrayDisk: used for parities/disks/caches (ArrayParity/ArrayCache named types removed in 7.3)
|
||||
// fields: name, device, type (ArrayDiskType enum), status (ArrayDiskStatus enum),
|
||||
// size (BigInt), fsSize, fsFree, fsUsed (BigInt), temp, transport (String),
|
||||
// rotational, isSpinning, fsType (String) — also new: numReads, numWrites,
|
||||
// numErrors (BigInt), idx, warning, critical, color, exportable, comment, format
|
||||
// MemoryUtilization: percentTotal, total, used, available, swapTotal, swapUsed —
|
||||
// also new: free, active, buffcache, swapFree, percentSwapTotal
|
||||
// VmDomain: name, state (VmState enum) — no memory/vcpus
|
||||
|
||||
require_once __DIR__ . '/config.php';
|
||||
@@ -52,13 +58,14 @@ function vv_api_data(): ?array {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fields verified against live schema introspection (2026-05-29).
|
||||
// Fields verified against live schema introspection (2026-05-31, Unraid 7.3).
|
||||
// array.parities / .disks / .caches are SEPARATE lists — .disks is DATA only.
|
||||
// ArrayParity/ArrayCache are no longer named types in 7.3 but the query structure is unchanged.
|
||||
// metrics.cpu.percentTotal and metrics.memory.* provide real-time utilisation.
|
||||
$gql = <<<'GQL'
|
||||
{
|
||||
info {
|
||||
os { hostname uptime release }
|
||||
os { hostname uptime release kernel }
|
||||
cpu { brand threads cores }
|
||||
}
|
||||
metrics {
|
||||
@@ -180,7 +187,7 @@ function vv_api_node_metrics(?array $d): array {
|
||||
];
|
||||
}
|
||||
|
||||
// ── Confirmed schema (Unraid 7.2.5, introspected 2026-05-29) ─────────────────
|
||||
// ── Confirmed schema (Unraid 7.3, introspected 2026-05-31) ───────────────────
|
||||
// Adding a new host: add HOSTn="hostname" to master.conf and HOSTn_UNRAID_API_KEY
|
||||
// to hostn.conf, then run Deployment/deploy.sh. No schema work needed.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user