Get server metrics
/api/v1/servers/:id/metrics
Read stored machine metrics. latest is the most recent report; samples are historical points, with a different shape.
Request example
curl "https://tovahub.com/api/v1/servers/507f1f77bcf86cd799439012/metrics?period=24hr" \
-H "Authorization: Bearer $TOVAHUB_TOKEN"Examples only. No requests are sent from this page.
Illustrative response
{
"period": "24hr",
"serverStatus": "running",
"metrics": {
"online": false,
"reportingMode": 1,
"reportInterval": 60,
"lastReportedAt": null,
"lastSampledAt": null,
"bootChangedAt": null,
"shutdownAt": null
},
"latest": null,
"samples": []
}Parameters
idPath · Requiredstring
Resource ID: 24 hexadecimal characters. Use the platform ID returned by the matching list endpoint, not a supplier instance ID.
periodQuery · Optional"1hr" | "24hr" | "7d"
Defaults to 24hr.
Response
HTTP status 200
Read stored host metrics, the latest report, and history samples.
periodstring ('1hr' | '24hr' | '7d')Requested history period.
serverStatusstringNormalized saved server status.
metricsobjectMonitoring liveness metadata.
metrics.onlinebooleanWhether recent reports indicate an online agent.
metrics.reportingModenumberCurrent configured reporting mode; defaults to one.
metrics.reportIntervalnumberExpected reporting interval in seconds.
metrics.lastReportedAtstring (ISO 8601) | nullLast report-receipt timestamp.
metrics.lastSampledAtstring (ISO 8601) | nullLast sampled timestamp.
metrics.bootChangedAtstring (ISO 8601) | nullLast detected boot change.
metrics.shutdownAtstring (ISO 8601) | nullLast reported shutdown.
latestobject | nullMost recent stored metrics or shutdown report, or null when no report is available. Its fields differ from history samples.
latest.version1Report format version.
latest.kind"metrics" | "shutdown"Report kind.
latest.bootIdstring (UUID)Identifier of the reported boot.
latest.intervalnumberSampling interval in seconds, 5–300.
latest.uptimenumberUptime in seconds.
latest.sampledAtnumber (optional)Client sample timestamp in milliseconds since Unix epoch.
latest.cpunumber | nullCPU usage from 0 to 100 percent, or null when unavailable.
latest.memoryUsednumberUsed memory in bytes.
latest.memoryTotalnumberTotal memory in bytes.
latest.swapUsednumberUsed swap in bytes.
latest.swapTotalnumberTotal swap in bytes.
latest.diskReadnumber | nullDisk read rate in bytes per second.
latest.diskWritenumber | nullDisk write rate in bytes per second.
latest.netInnumber | nullNetwork receive rate in bytes per second.
latest.netOutnumber | nullNetwork transmit rate in bytes per second.
latest.disksobject[]Up to 32 mounted disks with mount (string), total (bytes) and used (bytes).
samplesarrayUp to 600 time-ordered history points. Numeric values are bucket averages; low and high retain per-metric extrema.
samples[].atstring (ISO 8601)History sample timestamp.
samples[].cpunumber | nullCPU usage percentage, or null when unavailable.
samples[].memoryUsednumber | nullCapacity in bytes, or null when unavailable.
samples[].memoryTotalnumber | nullCapacity in bytes, or null when unavailable.
samples[].swapUsednumber | nullCapacity in bytes, or null when unavailable.
samples[].swapTotalnumber | nullCapacity in bytes, or null when unavailable.
samples[].diskReadnumber | nullTransfer rate in bytes per second, or null when unavailable.
samples[].diskWritenumber | nullTransfer rate in bytes per second, or null when unavailable.
samples[].netInnumber | nullTransfer rate in bytes per second, or null when unavailable.
samples[].netOutnumber | nullTransfer rate in bytes per second, or null when unavailable.
samples[].uptimenumber | nullUptime in seconds, or null when unavailable.
samples[].disksarrayMounted disks: {mount: string, used: number, total: number}. Capacities are bytes.
samples[].lowobjectPer-metric minimum values, keyed by the same ten numeric metric names.
samples[].highobjectPer-metric maximum values, keyed by the same ten numeric metric names.