curl --request GET \
--url https://api.example.com/api/v1/devices/counts/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/devices/counts/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/devices/counts/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/devices/counts/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/devices/counts/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/devices/counts/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/devices/counts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"total": 123,
"inventory_only_devices": 123,
"customer_ready": {
"true": 123,
"false": 123
},
"inventory_status": {
"planned": 123,
"staged": 123,
"active": 123,
"failed": 123,
"offline": 123,
"rma": 123,
"returned": 123,
"decommissioning": 123,
"decommissioned": 123,
"inventory": 123,
"unknown": 123
},
"operational_status": {
"unknown": 123,
"quarantine": 123,
"validation": 123,
"available": 123,
"in_use": 123,
"delegated": 123,
"pending_handover": 123,
"drained": 123,
"failed": 123
},
"health_status": {
"unknown": 123,
"healthy": 123,
"degraded": 123,
"critical": 123
}
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}Get device counts
Return per-status device counts for a site, with the device list filters.
Requires site_id to scope the response (matching the compact
list-all/list-all-ids endpoints) and additionally accepts every
DeviceFilter query parameter the paginated list supports (e.g.
device_class, location_id, rack_id, topology_group_id), so
the counts reflect whatever filter the device list is showing. Aggregates
in a single query; the response mirrors the counts object embedded on
the site detail endpoint, including the total.
curl --request GET \
--url https://api.example.com/api/v1/devices/counts/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/devices/counts/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/devices/counts/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/devices/counts/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/devices/counts/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/devices/counts/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/devices/counts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"total": 123,
"inventory_only_devices": 123,
"customer_ready": {
"true": 123,
"false": 123
},
"inventory_status": {
"planned": 123,
"staged": 123,
"active": 123,
"failed": 123,
"offline": 123,
"rma": 123,
"returned": 123,
"decommissioning": 123,
"decommissioned": 123,
"inventory": 123,
"unknown": 123
},
"operational_status": {
"unknown": 123,
"quarantine": 123,
"validation": 123,
"available": 123,
"in_use": 123,
"delegated": 123,
"pending_handover": 123,
"drained": 123,
"failed": 123
},
"health_status": {
"unknown": 123,
"healthy": 123,
"degraded": 123,
"critical": 123
}
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}{
"detail": "<string>",
"code": "error",
"field_errors": [
{
"field": "<string>",
"messages": [
"<string>"
]
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Query Parameters
Multiple values may be separated by commas.
Filter by annotation key=value pairs (AND semantics). Use annotation_eq[key]=value.
Show child attributes
Show child attributes
Filter by annotation key existence (comma-separated, AND semantics).
Multiple values may be separated by commas.
Multiple values may be separated by commas.
cpu_baremetal, cpu_hypervisor, gpu_compute, switch Multiple values may be separated by commas.
Multiple values may be separated by commas.
Multiple values may be separated by commas.
critical, degraded, healthy, unknown Multiple values may be separated by commas.
active, decommissioned, decommissioning, failed, inventory, offline, planned, returned, rma, staged, unknown Multiple values may be separated by commas.
active, adopt failed, adopting, available, clean failed, clean hold, clean wait, cleaning, deleted, deleting, deploy complete, deploy failed, deploy hold, deploying, enroll, error, inspect failed, inspect wait, inspecting, manageable, rebuild, rescue, rescue failed, rescue wait, rescuing, service, service failed, service hold, service wait, servicing, unknown, unrescue failed, unrescuing, verifying, wait call-back Multiple values may be separated by commas.
Multiple values may be separated by commas.
Multiple values may be separated by commas.
available, delegated, drained, failed, in_use, pending_handover, quarantine, unknown, validation Multiple values may be separated by commas.
Multiple values may be separated by commas.
Site ID used to constrain the unpaginated compact response.
SLURM node states. A device matches when its own state list contains any of these. Multiple values may be separated by commas.
ALLOCATED, BLOCKED, CLOUD, COMPLETING, DOWN, DRAIN, DYNAMIC_FUTURE, DYNAMIC_NORM, ERROR, FAIL, FUTURE, IDLE, INVALID_REG, MAINTENANCE, MIXED, NOT_RESPONDING, PLANNED, POWERED_DOWN, POWERING_DOWN, POWERING_UP, POWER_DOWN, POWER_DRAIN, POWER_UP, REBOOT_CANCELED, REBOOT_ISSUED, REBOOT_REQUESTED, RESERVED, RESUME, UNDRAIN, UNKNOWN Filter by tags (comma-separated, OR semantics).
Multiple values may be separated by commas.
Multiple values may be separated by commas.
Response
Schema for the nested counts field on Site responses.
Every bucket bar inventory_only_devices is scoped to FM-managed devices
(see device_status_count_aggregations), so an inventory_only site
legitimately reports zero across them however many inventory rows it holds —
inventory_only_devices is where those rows are counted. Filter the site
list by inventory_only to list the same universe a given bucket measures.
Number of FM-managed devices at the site; excludes inventory-only devices.
Number of inventory-only devices at the site, the population excluded from total and from every status breakdown. Add the two for every device row the site holds.
Counts of customer-ready vs non-customer-ready devices
Show child attributes
Show child attributes
Count of devices per inventory status
Show child attributes
Show child attributes
Count of devices per operational status
Show child attributes
Show child attributes
Count of devices per health status
Show child attributes
Show child attributes