curl --request GET \
--url https://{host}/api/fleets/{fleet_id}/inventory \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/fleets/{fleet_id}/inventory"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/fleets/{fleet_id}/inventory', 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://{host}/api/fleets/{fleet_id}/inventory",
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://{host}/api/fleets/{fleet_id}/inventory"
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://{host}/api/fleets/{fleet_id}/inventory")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/fleets/{fleet_id}/inventory")
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{
"fleet_id": "<string>",
"source": "local",
"status": "fresh",
"checked_at": "<string>",
"observed_at": "<string>",
"resources": [
{
"id": "<string>",
"name": "<string>",
"state": "",
"accelerator_series": "<string>",
"accelerator_count": 123,
"node_id": "<string>",
"schedulable": true
}
],
"problem": {
"kind": "<string>",
"detail": ""
},
"accelerators_by_series": {},
"machine_count": 0,
"unreported_machines": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}What this Fleet’s backend says it has, with the provenance to read it by.
Read-only, and the same authorization as reading the Fleet itself: picking a Fleet to submit against is the reason somebody wants to know how big it is.
Separate from /nodes on purpose, and the two are not alternatives.
/nodes is the native identity and management surface: rows this
platform created, each with an id that drain, cordon and remove act on. This
is observation: what the backend reports, normalized across all four
kinds, minting nothing. An external machine listed here has a null
node_id, which is how the console knows it may show the machine and must
not offer to drain it.
Cached for a short window and coalesced, so a Fleet list does not turn one
page load into one backend API call per row. refresh is the detail page’s
explicit “check now”, and still coalesces.
curl --request GET \
--url https://{host}/api/fleets/{fleet_id}/inventory \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/fleets/{fleet_id}/inventory"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/fleets/{fleet_id}/inventory', 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://{host}/api/fleets/{fleet_id}/inventory",
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://{host}/api/fleets/{fleet_id}/inventory"
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://{host}/api/fleets/{fleet_id}/inventory")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/fleets/{fleet_id}/inventory")
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{
"fleet_id": "<string>",
"source": "local",
"status": "fresh",
"checked_at": "<string>",
"observed_at": "<string>",
"resources": [
{
"id": "<string>",
"name": "<string>",
"state": "",
"accelerator_series": "<string>",
"accelerator_count": 123,
"node_id": "<string>",
"schedulable": true
}
],
"problem": {
"kind": "<string>",
"detail": ""
},
"accelerators_by_series": {},
"machine_count": 0,
"unreported_machines": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路径参数
查询参数
Ask the backend now instead of serving the cached observation.
响应
Successful Response
One observation, carrying enough provenance to be read correctly.
The four statuses are four different facts and are never rounded into each other -- which is the defect this contract replaces, where a Kubernetes API that could not be reached produced the same empty capacity as a cluster with nothing in it:
fresh the backend answered completely; zero resources means zero
stale it could not be reached now, and these were seen at observed_at
unknown it could not be reached and nothing earlier is held. Nothing may
be concluded from this -- not emptiness, and not insufficiency
partial some resources were reported; an absent one is not proven gone
local, node, kubernetes, slurm fresh, stale, unknown, partial Show child attributes
Show child attributes
Why an observation is incomplete. Sanitized before it leaves the server.
Show child attributes
Show child attributes
Show child attributes
Show child attributes