diff --git a/Plugin/unraid/api/api_test.php b/Plugin/unraid/api/api_test.php index 044f725..ed86a87 100644 --- a/Plugin/unraid/api/api_test.php +++ b/Plugin/unraid/api/api_test.php @@ -67,7 +67,8 @@ if ($key) { // ── Schema introspection — discover actual field names ──────────────────────── if ($key) { - $types = ['InfoOs','InfoCpu','InfoMemory','ArrayDisk','ArrayParity','ArrayCache','Vm','Domain','VmDomain']; + // ArrayParity and ArrayCache were separate named types in 7.2.5 — removed in 7.3 (now same as ArrayDisk) + $types = ['InfoOs','InfoCpu','InfoMemory','ArrayDisk','VmDomain']; $introspectGql = '{ ' . implode(' ', array_map(fn($t) => "{$t}: __type(name: \"{$t}\") { fields { name type { name kind ofType { name kind } } } }", $types diff --git a/Plugin/unraid/include/unraid_api.php b/Plugin/unraid/include/unraid_api.php index 8e2c27f..1762b7b 100644 --- a/Plugin/unraid/include/unraid_api.php +++ b/Plugin/unraid/include/unraid_api.php @@ -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. //