curl --request POST \
--url https://api.example.com/api/v1/racks/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"location": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"annotations": {},
"tags": [
"<string>"
],
"serial_number": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/racks/"
payload = {
"name": "<string>",
"location": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"annotations": {},
"tags": ["<string>"],
"serial_number": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
location: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
annotations: {},
tags: ['<string>'],
serial_number: '<string>'
})
};
fetch('https://api.example.com/api/v1/racks/', 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/racks/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'location' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'annotations' => [
],
'tags' => [
'<string>'
],
'serial_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/racks/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"location\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"annotations\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"serial_number\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/racks/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"location\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"annotations\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"serial_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/racks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"location\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"annotations\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"serial_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_name": "<string>",
"site_name": "<string>",
"links": {
"self": "<string>",
"collection": "<string>",
"location": "<string>",
"site": "<string>",
"devices": "<string>"
},
"operational_status_counts": {
"unknown": 123,
"quarantine": 123,
"validation": 123,
"available": 123,
"in_use": 123,
"delegated": 123,
"pending_handover": 123,
"drained": 123,
"failed": 123
},
"device_count": 123,
"triage_count": 123,
"device_hostlist": "<string>",
"triage_hostlist": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"location": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"site": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"annotations": {},
"tags": [
"<string>"
],
"serial_number": "<string>",
"status": "reserved"
}{
"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>"
]
}
]
}Create rack
List, retrieve, create and update racks.
curl --request POST \
--url https://api.example.com/api/v1/racks/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"location": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"annotations": {},
"tags": [
"<string>"
],
"serial_number": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/racks/"
payload = {
"name": "<string>",
"location": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"annotations": {},
"tags": ["<string>"],
"serial_number": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
location: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
annotations: {},
tags: ['<string>'],
serial_number: '<string>'
})
};
fetch('https://api.example.com/api/v1/racks/', 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/racks/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'location' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'annotations' => [
],
'tags' => [
'<string>'
],
'serial_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/racks/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"location\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"annotations\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"serial_number\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/racks/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"location\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"annotations\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"serial_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/racks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"location\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"annotations\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"serial_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_name": "<string>",
"site_name": "<string>",
"links": {
"self": "<string>",
"collection": "<string>",
"location": "<string>",
"site": "<string>",
"devices": "<string>"
},
"operational_status_counts": {
"unknown": 123,
"quarantine": 123,
"validation": 123,
"available": 123,
"in_use": 123,
"delegated": 123,
"pending_handover": 123,
"drained": 123,
"failed": 123
},
"device_count": 123,
"triage_count": 123,
"device_hostlist": "<string>",
"triage_hostlist": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"location": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"site": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"annotations": {},
"tags": [
"<string>"
],
"serial_number": "<string>",
"status": "reserved"
}{
"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.
Body
Serializer for Rack model.
255Key-value annotations. Keys must start with a lowercase letter and contain only lowercase alphanumeric segments joined by hyphens or underscores (e.g. 'org-id', 'gpu_ready').
Show child attributes
Show child attributes
Tags for the resource. Must start with a lowercase letter and contain only lowercase alphanumeric segments joined by hyphens or underscores (e.g. 'gpu-ready', 'needs_review'). Stored deduplicated and sorted.
Rack serial number, sourced from NetBox by the netbox-agent reconciler. The reconciler is the sole automated writer; this field remains writable via the API as an operator-override escape hatch for manual correction (e.g. fixing a value before the next reconciliation cycle). See docs/specs/0007-fleet-1207-rack-serial-sync.md.
50reserved- Reservedavailable- Availableplanned- Plannedactive- Activedeprecated- Deprecatedunknown- Unknown
reserved, available, planned, active, deprecated, unknown Response
Serializer for Rack model.
Serializer for rack links.
Show child attributes
Show child attributes
Count of the rack's devices per operational status, every status present and defaulting to zero. Scoped to the rack's FM-managed devices excluding switches, so the Racks page can read these counts without fetching the whole site's operations/racks/standup payload. That endpoint selects the same class of device but scopes by site rather than by rack, so the two differ for a device whose site and rack.location.site have drifted apart. Deliberately narrower than a Site's counts.operational_status, which includes switches.
Show child attributes
Show child attributes
Number of devices this rack's hostlists name. Carried explicitly so a caller need not derive it, matching device_count on the jobs list. It is the sum of operational_status_counts for every device holding a known status value; a row left on a retired status would be counted here and in no status bucket.
Number of the rack's devices currently in triage. Not derivable from triage_hostlist without expanding it, and a client needs the number to show "all" rather than a count.
Compressed hostlist of the rack's devices, over the same population as operational_status_counts. Empty string when the rack holds none. Null when the caller may not read device names — these name individual devices, so they need device:read on top of the rack:read this endpoint requires; the counts are unaffected.
Compressed hostlist of the rack's devices currently in triage, a subset of device_hostlist. Empty string means nothing in the rack is in triage; null means the caller may not read device names, as for device_hostlist.
255Key-value annotations. Keys must start with a lowercase letter and contain only lowercase alphanumeric segments joined by hyphens or underscores (e.g. 'org-id', 'gpu_ready').
Show child attributes
Show child attributes
Tags for the resource. Must start with a lowercase letter and contain only lowercase alphanumeric segments joined by hyphens or underscores (e.g. 'gpu-ready', 'needs_review'). Stored deduplicated and sorted.
Rack serial number, sourced from NetBox by the netbox-agent reconciler. The reconciler is the sole automated writer; this field remains writable via the API as an operator-override escape hatch for manual correction (e.g. fixing a value before the next reconciliation cycle). See docs/specs/0007-fleet-1207-rack-serial-sync.md.
50reserved- Reservedavailable- Availableplanned- Plannedactive- Activedeprecated- Deprecatedunknown- Unknown
reserved, available, planned, active, deprecated, unknown