curl --request GET \
--url https://api.example.com/api/v1/devices/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/devices/"
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/', 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/",
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/"
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/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/devices/")
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{
"count": 123,
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nvswitch_rack_slot": "ST0",
"nvswitch_switch_role": "",
"nvswitch_nvos_hostname": "<string>",
"enrollment_validated_ref": "<string>",
"current_instance_uuid": "<string>",
"device_type_kind": "<string>",
"device_type_vendor": "<string>",
"device_type_model": "<string>",
"device_type_resource_class": "<string>",
"role_name": "<string>",
"role_slug": "<string>",
"device_class": "gpu_compute",
"rack_name": "<string>",
"rack_serial_number": "",
"location_name": "<string>",
"site_name": "<string>",
"site_slug": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_slug": "<string>",
"links": {
"self": "<string>",
"collection": "<string>",
"device_type": "<string>",
"role": "<string>",
"rack": "<string>",
"location": "<string>",
"site": "<string>",
"jobs": "<string>",
"job_device_statuses": "<string>",
"netbox": "<string>"
},
"customer_ready": true,
"topology": {},
"topology_group_types": {},
"short_name": "<string>",
"current_tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"current_tenant_name": "<string>",
"current_allocation_annotations": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"nvswitch_ztp_completed_at": "2023-11-07T05:31:56Z",
"nvswitch_ztp_evidence_source": "<string>",
"position": "<string>",
"enrollment_proof_source": "enrolled",
"entered_triage_at": "2023-11-07T05:31:56Z",
"inventory_only": true,
"device_type": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rack": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"site": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"annotations": {},
"tags": [
"<string>"
],
"serial_number": "<string>",
"infrastructure_ref": "<string>",
"ironic_provision_state": "enroll",
"placement_traits": [
"<string>"
],
"slurm_states": [
"ALLOCATED"
],
"slurm_state_updated_at": "2023-11-07T05:31:56Z",
"slurm_state_reason": "<string>",
"operational_failure_reason": "<string>",
"operational_failure_details": "<string>",
"ironic_maintenance": true,
"ironic_maintenance_reason": "<string>",
"ironic_fault": "<string>",
"ironic_last_error": "<string>",
"triage_ticket_url": "<string>",
"parent_ticket_url": "<string>",
"netbox_id": 1073741823,
"interfaces": [
{
"name": "<string>",
"type": "<string>",
"type_display": "<string>",
"ip_addresses": [
"<string>"
],
"mac_address": "<string>",
"ib_device_guid": "<string>"
}
],
"inventory_status": "planned",
"operational_status": "unknown",
"health_status": "unknown",
"platform_class": "<string>",
"entered_service_at": "2023-11-07T05:31:56Z",
"in_triage": true,
"chad_ignore": true
}
],
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2"
}{
"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>"
]
}
]
}List devices
List, retrieve, create and update devices for a site.
curl --request GET \
--url https://api.example.com/api/v1/devices/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/devices/"
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/', 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/",
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/"
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/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/devices/")
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{
"count": 123,
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nvswitch_rack_slot": "ST0",
"nvswitch_switch_role": "",
"nvswitch_nvos_hostname": "<string>",
"enrollment_validated_ref": "<string>",
"current_instance_uuid": "<string>",
"device_type_kind": "<string>",
"device_type_vendor": "<string>",
"device_type_model": "<string>",
"device_type_resource_class": "<string>",
"role_name": "<string>",
"role_slug": "<string>",
"device_class": "gpu_compute",
"rack_name": "<string>",
"rack_serial_number": "",
"location_name": "<string>",
"site_name": "<string>",
"site_slug": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_slug": "<string>",
"links": {
"self": "<string>",
"collection": "<string>",
"device_type": "<string>",
"role": "<string>",
"rack": "<string>",
"location": "<string>",
"site": "<string>",
"jobs": "<string>",
"job_device_statuses": "<string>",
"netbox": "<string>"
},
"customer_ready": true,
"topology": {},
"topology_group_types": {},
"short_name": "<string>",
"current_tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"current_tenant_name": "<string>",
"current_allocation_annotations": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"nvswitch_ztp_completed_at": "2023-11-07T05:31:56Z",
"nvswitch_ztp_evidence_source": "<string>",
"position": "<string>",
"enrollment_proof_source": "enrolled",
"entered_triage_at": "2023-11-07T05:31:56Z",
"inventory_only": true,
"device_type": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rack": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"site": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"annotations": {},
"tags": [
"<string>"
],
"serial_number": "<string>",
"infrastructure_ref": "<string>",
"ironic_provision_state": "enroll",
"placement_traits": [
"<string>"
],
"slurm_states": [
"ALLOCATED"
],
"slurm_state_updated_at": "2023-11-07T05:31:56Z",
"slurm_state_reason": "<string>",
"operational_failure_reason": "<string>",
"operational_failure_details": "<string>",
"ironic_maintenance": true,
"ironic_maintenance_reason": "<string>",
"ironic_fault": "<string>",
"ironic_last_error": "<string>",
"triage_ticket_url": "<string>",
"parent_ticket_url": "<string>",
"netbox_id": 1073741823,
"interfaces": [
{
"name": "<string>",
"type": "<string>",
"type_display": "<string>",
"ip_addresses": [
"<string>"
],
"mac_address": "<string>",
"ib_device_guid": "<string>"
}
],
"inventory_status": "planned",
"operational_status": "unknown",
"health_status": "unknown",
"platform_class": "<string>",
"entered_service_at": "2023-11-07T05:31:56Z",
"in_triage": true,
"chad_ignore": true
}
],
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2"
}{
"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.
Number of results to return per page.
1 <= x <= 500Multiple values may be separated by commas.
Multiple values may be separated by commas.
available, delegated, drained, failed, in_use, pending_handover, quarantine, unknown, validation Which field to use when ordering the results.
name, -name, created_at, -created_at, updated_at, -updated_at A page number within the paginated result set.
Multiple values may be separated by commas.
Multiple values may be separated by commas.
Multiple values may be separated by commas.
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.