curl --request POST \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/claim/release \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"host": "<string>",
"claimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"disk": {
"fromClaimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restored": true
},
"endedAt": "2023-11-07T05:31:56Z",
"exitCode": -1,
"log": "<string>",
"proofTests": {},
"reason": "<string>",
"resume": {
"fromClaimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fromSessionId": "<string>",
"resumed": true
}
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/claim/release"
payload = {
"host": "<string>",
"claimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"disk": {
"fromClaimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restored": True
},
"endedAt": "2023-11-07T05:31:56Z",
"exitCode": -1,
"log": "<string>",
"proofTests": {},
"reason": "<string>",
"resume": {
"fromClaimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fromSessionId": "<string>",
"resumed": True
}
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
host: '<string>',
claimId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
disk: {fromClaimId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', restored: true},
endedAt: '2023-11-07T05:31:56Z',
exitCode: -1,
log: '<string>',
proofTests: {},
reason: '<string>',
resume: {
fromClaimId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
fromSessionId: '<string>',
resumed: true
}
})
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/claim/release', 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/work-items/{workItemId}/claim/release",
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([
'host' => '<string>',
'claimId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'disk' => [
'fromClaimId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'restored' => true
],
'endedAt' => '2023-11-07T05:31:56Z',
'exitCode' => -1,
'log' => '<string>',
'proofTests' => [
],
'reason' => '<string>',
'resume' => [
'fromClaimId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'fromSessionId' => '<string>',
'resumed' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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/work-items/{workItemId}/claim/release"
payload := strings.NewReader("{\n \"host\": \"<string>\",\n \"claimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"disk\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"restored\": true\n },\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"exitCode\": -1,\n \"log\": \"<string>\",\n \"proofTests\": {},\n \"reason\": \"<string>\",\n \"resume\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fromSessionId\": \"<string>\",\n \"resumed\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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/work-items/{workItemId}/claim/release")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"host\": \"<string>\",\n \"claimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"disk\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"restored\": true\n },\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"exitCode\": -1,\n \"log\": \"<string>\",\n \"proofTests\": {},\n \"reason\": \"<string>\",\n \"resume\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fromSessionId\": \"<string>\",\n \"resumed\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/claim/release")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"host\": \"<string>\",\n \"claimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"disk\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"restored\": true\n },\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"exitCode\": -1,\n \"log\": \"<string>\",\n \"proofTests\": {},\n \"reason\": \"<string>\",\n \"resume\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fromSessionId\": \"<string>\",\n \"resumed\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"exitCode": 123,
"id": "<string>",
"outcome": "ok",
"reason": "<string>",
"releasedAt": "<string>",
"stage": "provision"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Release a host's claim on a work item
Marks the caller’s own lease released, optionally with an outcome, the stage the attempt ended in, its exitCode, a one-line reason (at most 200 characters, no line break), and an environment recording what the attempt ran in: its isolation (container, vm or shared-user), the recipe and image, up to 200 hosts reached and the refusals with their ranges, the names, never the values, of the variables passed in, the names of up to 20 destinations the build called, never an address or a secret, routes (the requests and failures of each of up to 32 routes the runner served the build, by name), and the kinds of repository token the build used (credentials, read and push), and for a microVM build the memory and CPU its guest used (guestUsage, stored and returned by no endpoint). resume says how an agent job (an amend lease) began: {resumed: true, fromSessionId, fromClaimId} when it continued the session of an earlier build or agent job, or {resumed: false, reason} when it started fresh, with reason one of no_saved_session, session_not_loaded and build_type_cannot_resume. It is stored on an amend lease only. disk says where an agent job’s build disk came from: {restored: true, fromClaimId} when it started from the disk that the claim fromClaimId left on the runner’s host, or {restored: false, reason} when it started without one, with reason one of no_kept_disk, other_image, other_disk_size, disk_not_restored, checkout_not_switched, build_type_cannot_restore, fresh_requested (a member asked for a fresh disk) and holder_busy (the machine that holds the disk was busy). It is stored on a build lease and an amend lease. proofTests says, for each criterion whose proof the runner’s recording examined, whether a test records it. The amend queue reads it: no recording starts for proofs that no test records. log is the runner’s own scrubbed log for the attempt, at most 66,560 bytes; it is stored with the release and read from GET /v1/work-items/{workItemId}/claims/{claimId}/log. incomplete is a command that exited 0 while the item’s checks still failed or had no result; like ok, it uses up the build request. It is stored with the release and returned on GET /v1/work-items/{workItemId}. Releasing an already-released lease is a no-op that returns the stored values and stores nothing new. claim_not_held (403) when the calling key is not the holder of the item’s newest lease, live or not. The holder is the key that took the lease; host is a label the request carries and decides nothing. A lease on an item that was withdrawn can still be released. claimId names the lease the caller means. With it, claim_not_newest (409) when that lease is not the item’s newest, and nothing is stored: a runner releasing a lease that lapsed never ends a lease taken after it. When a runner releases its lease with the outcome ok or incomplete, each open draft pull request that PUT /v1/work-items/{workItemId}/pull-request opened for the item is marked ready for review after the answer. A failure to mark one changes nothing in the answer. endedAt is when the runner’s job ended. A runner that could not reach the gateway sends its release later, so the lease’s end time is endedAt, held between the lease’s start and the time the release arrives. Without endedAt, the end time is the time the release arrives.
curl --request POST \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/claim/release \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"host": "<string>",
"claimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"disk": {
"fromClaimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restored": true
},
"endedAt": "2023-11-07T05:31:56Z",
"exitCode": -1,
"log": "<string>",
"proofTests": {},
"reason": "<string>",
"resume": {
"fromClaimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fromSessionId": "<string>",
"resumed": true
}
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/claim/release"
payload = {
"host": "<string>",
"claimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"disk": {
"fromClaimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restored": True
},
"endedAt": "2023-11-07T05:31:56Z",
"exitCode": -1,
"log": "<string>",
"proofTests": {},
"reason": "<string>",
"resume": {
"fromClaimId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fromSessionId": "<string>",
"resumed": True
}
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
host: '<string>',
claimId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
disk: {fromClaimId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', restored: true},
endedAt: '2023-11-07T05:31:56Z',
exitCode: -1,
log: '<string>',
proofTests: {},
reason: '<string>',
resume: {
fromClaimId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
fromSessionId: '<string>',
resumed: true
}
})
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/claim/release', 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/work-items/{workItemId}/claim/release",
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([
'host' => '<string>',
'claimId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'disk' => [
'fromClaimId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'restored' => true
],
'endedAt' => '2023-11-07T05:31:56Z',
'exitCode' => -1,
'log' => '<string>',
'proofTests' => [
],
'reason' => '<string>',
'resume' => [
'fromClaimId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'fromSessionId' => '<string>',
'resumed' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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/work-items/{workItemId}/claim/release"
payload := strings.NewReader("{\n \"host\": \"<string>\",\n \"claimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"disk\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"restored\": true\n },\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"exitCode\": -1,\n \"log\": \"<string>\",\n \"proofTests\": {},\n \"reason\": \"<string>\",\n \"resume\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fromSessionId\": \"<string>\",\n \"resumed\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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/work-items/{workItemId}/claim/release")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"host\": \"<string>\",\n \"claimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"disk\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"restored\": true\n },\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"exitCode\": -1,\n \"log\": \"<string>\",\n \"proofTests\": {},\n \"reason\": \"<string>\",\n \"resume\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fromSessionId\": \"<string>\",\n \"resumed\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/claim/release")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"host\": \"<string>\",\n \"claimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"disk\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"restored\": true\n },\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"exitCode\": -1,\n \"log\": \"<string>\",\n \"proofTests\": {},\n \"reason\": \"<string>\",\n \"resume\": {\n \"fromClaimId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fromSessionId\": \"<string>\",\n \"resumed\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"exitCode": 123,
"id": "<string>",
"outcome": "ok",
"reason": "<string>",
"releasedAt": "<string>",
"stage": "provision"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Headers
Body
The part of a managed runner's own infrastructure that ended the build at provision: its build image, its sandbox provider or its setup of the sandbox. A managed runner's build released with a cause is not billed. A self-hosted runner's build is billed whatever it sends.
build_image, sandbox_provider, sandbox_setup