Join Fleet
curl --request POST \
--url https://{host}/api/fleets/{fleet_id}/nodes \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>",
"address": "",
"connection": "direct",
"node_version": "",
"protocol": 0,
"inventory": {
"accelerator_series": "",
"accelerator_name": "",
"accelerator_count": 0,
"driver": "",
"runtime": "",
"storage_root_visible": false,
"disk_free_bytes": 0,
"cpu_count": 0,
"memory_bytes": 0
}
}
'import requests
url = "https://{host}/api/fleets/{fleet_id}/nodes"
payload = {
"token": "<string>",
"address": "",
"connection": "direct",
"node_version": "",
"protocol": 0,
"inventory": {
"accelerator_series": "",
"accelerator_name": "",
"accelerator_count": 0,
"driver": "",
"runtime": "",
"storage_root_visible": False,
"disk_free_bytes": 0,
"cpu_count": 0,
"memory_bytes": 0
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
token: '<string>',
address: '',
connection: 'direct',
node_version: '',
protocol: 0,
inventory: {
accelerator_series: '',
accelerator_name: '',
accelerator_count: 0,
driver: '',
runtime: '',
storage_root_visible: false,
disk_free_bytes: 0,
cpu_count: 0,
memory_bytes: 0
}
})
};
fetch('https://{host}/api/fleets/{fleet_id}/nodes', 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}/nodes",
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([
'token' => '<string>',
'address' => '',
'connection' => 'direct',
'node_version' => '',
'protocol' => 0,
'inventory' => [
'accelerator_series' => '',
'accelerator_name' => '',
'accelerator_count' => 0,
'driver' => '',
'runtime' => '',
'storage_root_visible' => false,
'disk_free_bytes' => 0,
'cpu_count' => 0,
'memory_bytes' => 0
]
]),
CURLOPT_HTTPHEADER => [
"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://{host}/api/fleets/{fleet_id}/nodes"
payload := strings.NewReader("{\n \"token\": \"<string>\",\n \"address\": \"\",\n \"connection\": \"direct\",\n \"node_version\": \"\",\n \"protocol\": 0,\n \"inventory\": {\n \"accelerator_series\": \"\",\n \"accelerator_name\": \"\",\n \"accelerator_count\": 0,\n \"driver\": \"\",\n \"runtime\": \"\",\n \"storage_root_visible\": false,\n \"disk_free_bytes\": 0,\n \"cpu_count\": 0,\n \"memory_bytes\": 0\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://{host}/api/fleets/{fleet_id}/nodes")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"<string>\",\n \"address\": \"\",\n \"connection\": \"direct\",\n \"node_version\": \"\",\n \"protocol\": 0,\n \"inventory\": {\n \"accelerator_series\": \"\",\n \"accelerator_name\": \"\",\n \"accelerator_count\": 0,\n \"driver\": \"\",\n \"runtime\": \"\",\n \"storage_root_visible\": false,\n \"disk_free_bytes\": 0,\n \"cpu_count\": 0,\n \"memory_bytes\": 0\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/fleets/{fleet_id}/nodes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"token\": \"<string>\",\n \"address\": \"\",\n \"connection\": \"direct\",\n \"node_version\": \"\",\n \"protocol\": 0,\n \"inventory\": {\n \"accelerator_series\": \"\",\n \"accelerator_name\": \"\",\n \"accelerator_count\": 0,\n \"driver\": \"\",\n \"runtime\": \"\",\n \"storage_root_visible\": false,\n \"disk_free_bytes\": 0,\n \"cpu_count\": 0,\n \"memory_bytes\": 0\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"fleet_id": "<string>",
"state": "<string>",
"connection": "<string>",
"credential": "<string>",
"address": "",
"inventory": {},
"node_version": "",
"protocol": 0,
"issued_by": "",
"joined_from": "",
"last_seen_at": "<string>",
"last_error": "",
"created_at": "<string>",
"warnings": []
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Register this machine into a Fleet.
No platform login. The Join Token is the whole authorization; see the module docstring. The console therefore cannot record who ran the command, and does not pretend to: it records which administrator minted the token and the address it was redeemed from.
POST
/
api
/
fleets
/
{fleet_id}
/
nodes
Join Fleet
curl --request POST \
--url https://{host}/api/fleets/{fleet_id}/nodes \
--header 'Content-Type: application/json' \
--data '
{
"token": "<string>",
"address": "",
"connection": "direct",
"node_version": "",
"protocol": 0,
"inventory": {
"accelerator_series": "",
"accelerator_name": "",
"accelerator_count": 0,
"driver": "",
"runtime": "",
"storage_root_visible": false,
"disk_free_bytes": 0,
"cpu_count": 0,
"memory_bytes": 0
}
}
'import requests
url = "https://{host}/api/fleets/{fleet_id}/nodes"
payload = {
"token": "<string>",
"address": "",
"connection": "direct",
"node_version": "",
"protocol": 0,
"inventory": {
"accelerator_series": "",
"accelerator_name": "",
"accelerator_count": 0,
"driver": "",
"runtime": "",
"storage_root_visible": False,
"disk_free_bytes": 0,
"cpu_count": 0,
"memory_bytes": 0
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
token: '<string>',
address: '',
connection: 'direct',
node_version: '',
protocol: 0,
inventory: {
accelerator_series: '',
accelerator_name: '',
accelerator_count: 0,
driver: '',
runtime: '',
storage_root_visible: false,
disk_free_bytes: 0,
cpu_count: 0,
memory_bytes: 0
}
})
};
fetch('https://{host}/api/fleets/{fleet_id}/nodes', 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}/nodes",
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([
'token' => '<string>',
'address' => '',
'connection' => 'direct',
'node_version' => '',
'protocol' => 0,
'inventory' => [
'accelerator_series' => '',
'accelerator_name' => '',
'accelerator_count' => 0,
'driver' => '',
'runtime' => '',
'storage_root_visible' => false,
'disk_free_bytes' => 0,
'cpu_count' => 0,
'memory_bytes' => 0
]
]),
CURLOPT_HTTPHEADER => [
"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://{host}/api/fleets/{fleet_id}/nodes"
payload := strings.NewReader("{\n \"token\": \"<string>\",\n \"address\": \"\",\n \"connection\": \"direct\",\n \"node_version\": \"\",\n \"protocol\": 0,\n \"inventory\": {\n \"accelerator_series\": \"\",\n \"accelerator_name\": \"\",\n \"accelerator_count\": 0,\n \"driver\": \"\",\n \"runtime\": \"\",\n \"storage_root_visible\": false,\n \"disk_free_bytes\": 0,\n \"cpu_count\": 0,\n \"memory_bytes\": 0\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://{host}/api/fleets/{fleet_id}/nodes")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"<string>\",\n \"address\": \"\",\n \"connection\": \"direct\",\n \"node_version\": \"\",\n \"protocol\": 0,\n \"inventory\": {\n \"accelerator_series\": \"\",\n \"accelerator_name\": \"\",\n \"accelerator_count\": 0,\n \"driver\": \"\",\n \"runtime\": \"\",\n \"storage_root_visible\": false,\n \"disk_free_bytes\": 0,\n \"cpu_count\": 0,\n \"memory_bytes\": 0\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/fleets/{fleet_id}/nodes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"token\": \"<string>\",\n \"address\": \"\",\n \"connection\": \"direct\",\n \"node_version\": \"\",\n \"protocol\": 0,\n \"inventory\": {\n \"accelerator_series\": \"\",\n \"accelerator_name\": \"\",\n \"accelerator_count\": 0,\n \"driver\": \"\",\n \"runtime\": \"\",\n \"storage_root_visible\": false,\n \"disk_free_bytes\": 0,\n \"cpu_count\": 0,\n \"memory_bytes\": 0\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"fleet_id": "<string>",
"state": "<string>",
"connection": "<string>",
"credential": "<string>",
"address": "",
"inventory": {},
"node_version": "",
"protocol": 0,
"issued_by": "",
"joined_from": "",
"last_seen_at": "<string>",
"last_error": "",
"created_at": "<string>",
"warnings": []
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}路径参数
请求体
application/json
What a machine sends to join. Authorized by the token alone -- the operator running the command may have no platform account (ADR-0013).
响应
Successful Response