curl --request POST \
--url https://api.outerlayer.ai/v1/fleet/next \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cliVersion": "<string>",
"free": {
"diskGB": 500000000,
"memoryGiB": 500000,
"vcpus": 500000
},
"images": [
"<string>"
],
"runnerProtocol": 123,
"total": {
"diskGB": 500000000,
"memoryGiB": 500000,
"vcpus": 500000
},
"disks": [],
"hostKey": "<string>"
}
'import requests
url = "https://api.outerlayer.ai/v1/fleet/next"
payload = {
"cliVersion": "<string>",
"free": {
"diskGB": 500000000,
"memoryGiB": 500000,
"vcpus": 500000
},
"images": ["<string>"],
"runnerProtocol": 123,
"total": {
"diskGB": 500000000,
"memoryGiB": 500000,
"vcpus": 500000
},
"disks": [],
"hostKey": "<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({
cliVersion: '<string>',
free: {diskGB: 500000000, memoryGiB: 500000, vcpus: 500000},
images: ['<string>'],
runnerProtocol: 123,
total: {diskGB: 500000000, memoryGiB: 500000, vcpus: 500000},
disks: [],
hostKey: '<string>'
})
};
fetch('https://api.outerlayer.ai/v1/fleet/next', 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.outerlayer.ai/v1/fleet/next",
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([
'cliVersion' => '<string>',
'free' => [
'diskGB' => 500000000,
'memoryGiB' => 500000,
'vcpus' => 500000
],
'images' => [
'<string>'
],
'runnerProtocol' => 123,
'total' => [
'diskGB' => 500000000,
'memoryGiB' => 500000,
'vcpus' => 500000
],
'disks' => [
],
'hostKey' => '<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.outerlayer.ai/v1/fleet/next"
payload := strings.NewReader("{\n \"cliVersion\": \"<string>\",\n \"free\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"images\": [\n \"<string>\"\n ],\n \"runnerProtocol\": 123,\n \"total\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"disks\": [],\n \"hostKey\": \"<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.outerlayer.ai/v1/fleet/next")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cliVersion\": \"<string>\",\n \"free\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"images\": [\n \"<string>\"\n ],\n \"runnerProtocol\": 123,\n \"total\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"disks\": [],\n \"hostKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/fleet/next")
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 \"cliVersion\": \"<string>\",\n \"free\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"images\": [\n \"<string>\"\n ],\n \"runnerProtocol\": 123,\n \"total\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"disks\": [],\n \"hostKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"claim": {
"appId": "<string>",
"branch": "<string>",
"createdAt": "<string>",
"expiresAt": "<string>",
"host": "<string>",
"id": "<string>",
"itemKey": "<string>",
"kind": "implement",
"number": 123,
"organizationId": "<string>",
"repositories": [
{
"primary": true,
"repository": "<string>",
"branch": "<string>"
}
],
"size": "small",
"workItemId": "<string>",
"coAuthor": {
"email": "<string>",
"name": "<string>"
},
"codeReview": true,
"commitAuthor": {
"email": "<string>",
"name": "<string>"
},
"continueSession": true,
"diskHeldElsewhere": true,
"freshDisk": true,
"reviewBase": "<string>",
"reviewCommit": "<string>",
"unreachable": [
{
"reason": "installation_suspended",
"repository": "<string>"
}
]
},
"reservation": {
"size": "small",
"workItemId": "<string>"
},
"runnerVersion": "<string>",
"stops": [
{
"claimId": "<string>",
"note": "<string>",
"requestedByName": "<string>"
}
],
"reason": "<string>",
"reasonWorkItemId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Ask for the next managed build
The route a fleet machine asks for its next managed build on. A fleet machine is a machine OuterLayer operates; it belongs to no factory and authenticates with a fleet machine key (olfm_…) as the bearer. Every request is signed by the machine’s host key, the same profile as a runner key; the first request carries the host key in hostKey and binds the machine to it. A request from an address the machine does not allow is refused with machine_source_refused, and a request from a revoked machine with machine_revoked. The request is also the machine’s heartbeat. The gateway picks at most one build of any organization that has managed builds on, the organization that runs the fewest fleet builds first and the oldest build first, within each organization’s max_managed_builds limit, and only a build that fits the machine’s room. For up to a minute an agent job goes only to the live machine that lists its work item in disks. The answer carries the claim for that build, a reservation when the gateway holds room on this machine for a larger build, and the stops people asked for. Served by the Worker gateway only; a Node gateway answers 404.
curl --request POST \
--url https://api.outerlayer.ai/v1/fleet/next \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cliVersion": "<string>",
"free": {
"diskGB": 500000000,
"memoryGiB": 500000,
"vcpus": 500000
},
"images": [
"<string>"
],
"runnerProtocol": 123,
"total": {
"diskGB": 500000000,
"memoryGiB": 500000,
"vcpus": 500000
},
"disks": [],
"hostKey": "<string>"
}
'import requests
url = "https://api.outerlayer.ai/v1/fleet/next"
payload = {
"cliVersion": "<string>",
"free": {
"diskGB": 500000000,
"memoryGiB": 500000,
"vcpus": 500000
},
"images": ["<string>"],
"runnerProtocol": 123,
"total": {
"diskGB": 500000000,
"memoryGiB": 500000,
"vcpus": 500000
},
"disks": [],
"hostKey": "<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({
cliVersion: '<string>',
free: {diskGB: 500000000, memoryGiB: 500000, vcpus: 500000},
images: ['<string>'],
runnerProtocol: 123,
total: {diskGB: 500000000, memoryGiB: 500000, vcpus: 500000},
disks: [],
hostKey: '<string>'
})
};
fetch('https://api.outerlayer.ai/v1/fleet/next', 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.outerlayer.ai/v1/fleet/next",
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([
'cliVersion' => '<string>',
'free' => [
'diskGB' => 500000000,
'memoryGiB' => 500000,
'vcpus' => 500000
],
'images' => [
'<string>'
],
'runnerProtocol' => 123,
'total' => [
'diskGB' => 500000000,
'memoryGiB' => 500000,
'vcpus' => 500000
],
'disks' => [
],
'hostKey' => '<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.outerlayer.ai/v1/fleet/next"
payload := strings.NewReader("{\n \"cliVersion\": \"<string>\",\n \"free\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"images\": [\n \"<string>\"\n ],\n \"runnerProtocol\": 123,\n \"total\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"disks\": [],\n \"hostKey\": \"<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.outerlayer.ai/v1/fleet/next")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cliVersion\": \"<string>\",\n \"free\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"images\": [\n \"<string>\"\n ],\n \"runnerProtocol\": 123,\n \"total\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"disks\": [],\n \"hostKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/fleet/next")
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 \"cliVersion\": \"<string>\",\n \"free\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"images\": [\n \"<string>\"\n ],\n \"runnerProtocol\": 123,\n \"total\": {\n \"diskGB\": 500000000,\n \"memoryGiB\": 500000,\n \"vcpus\": 500000\n },\n \"disks\": [],\n \"hostKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"claim": {
"appId": "<string>",
"branch": "<string>",
"createdAt": "<string>",
"expiresAt": "<string>",
"host": "<string>",
"id": "<string>",
"itemKey": "<string>",
"kind": "implement",
"number": 123,
"organizationId": "<string>",
"repositories": [
{
"primary": true,
"repository": "<string>",
"branch": "<string>"
}
],
"size": "small",
"workItemId": "<string>",
"coAuthor": {
"email": "<string>",
"name": "<string>"
},
"codeReview": true,
"commitAuthor": {
"email": "<string>",
"name": "<string>"
},
"continueSession": true,
"diskHeldElsewhere": true,
"freshDisk": true,
"reviewBase": "<string>",
"reviewCommit": "<string>",
"unreachable": [
{
"reason": "installation_suspended",
"repository": "<string>"
}
]
},
"reservation": {
"size": "small",
"workItemId": "<string>"
},
"runnerVersion": "<string>",
"stops": [
{
"claimId": "<string>",
"note": "<string>",
"requestedByName": "<string>"
}
],
"reason": "<string>",
"reasonWorkItemId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}