Run targets
The programs each repository declares, run on one of your own computers
On this page(6 sections)
A repository can declare programs that run on the owner's own machines rather than in the sandbox. One read lists what each repository declares and which of your computers could run one now; the other builds a target here, carries the build over and starts it there, in a terminal you can watch. The computer still decides whether it accepts programs this sandbox sends.
GET/runs/targetsWhat each repository can run on your computers
Every repository that declares run targets at `.intentic/run.json`, and which of your computers could run one now.
What you send
Nothing. Call it as it is.
What comes back
| Field | Type |
|---|---|
repos | object[] |
repo | string |
path | string |
targets | object[] |
name | string |
description | string |
command | string |
device | string |
build | string |
artifact | string | object |
program | string |
args | string[] |
env | object |
isolated | boolean |
reach | integer[] |
stopGraceSeconds | integer |
error | string |
devices | object[] |
id | string |
online | boolean |
programs | boolean |
allowed | boolean |
curl "$SANDBOX/runs/targets" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.runs.targets();POST/runs/startRun a target on one of your computers
Builds it in the sandbox, carries the build to the computer and starts it there, in a terminal you can watch. A run of the same target already going there is stopped first. The computer still decides: its "Run programs this sandbox sends" switch has to be on.
What you send
| Field | Type | Where |
|---|---|---|
reporequired | string | body |
targetrequired | string | body |
devicerequired | string | body |
What comes back
| Field | Type |
|---|---|
session | string |
curl -X POST "$SANDBOX/runs/start" \
-H "x-intentic-control: $INTENTIC_TOKEN" \
-H "content-type: application/json" \
-d '{"repo":"root","target":"…","device":"…"}'import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.runs.start({
"repo": "root",
"target": "…",
"device": "…"
});POST/runs/attachFollow a run on one of your computers in a terminal
Opens a terminal that follows a program already running on the computer: its last lines, then what it prints. Ctrl+C there stops it; Ctrl+D or closing the terminal leaves it running. A terminal of the target's still open there is answered instead.
What you send
| Field | Type | Where |
|---|---|---|
reporequired | string | body |
targetrequired | string | body |
devicerequired | string | body |
idrequired | string | body |
What comes back
| Field | Type |
|---|---|
session | string |
curl -X POST "$SANDBOX/runs/attach" \
-H "x-intentic-control: $INTENTIC_TOKEN" \
-H "content-type: application/json" \
-d '{"repo":"root","target":"…","device":"…","id":"a1b2c3d4"}'import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.runs.attach({
"repo": "root",
"target": "…",
"device": "…",
"id": "a1b2c3d4"
});GET/runs/activeWhat runs on one of your computers
The programs this sandbox started on the computer, running and ended, as the computer reports them.
What you send
| Field | Type | Where |
|---|---|---|
devicerequired | string | query |
What comes back
| Field | Type |
|---|---|
runs | object[] |
device | string |
id | string |
name | string |
state | "running" | "ended" | "unknown" |
said | string |
exitCode | integer |
startedAt | string |
endedAt | string |
repo | string |
ports | integer[] |
startedBy | string |
builtFrom | object |
commit | string |
changed | integer |
at | string |
movedDuringBuild | boolean |
landsSince | integer |
terminals | object[] |
repo | string |
target | string |
session | string |
error | string |
curl "$SANDBOX/runs/active?device=%E2%80%A6" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.runs.active({
"device": "…"
});POST/runs/stopStop a target's run on one of your computers
Ends the terminal it runs in and the program on the computer, with everything it started, and closes the ports the sandbox opened for it.
What you send
| Field | Type | Where |
|---|---|---|
reporequired | string | body |
targetrequired | string | body |
devicerequired | string | body |
id | string | body |
What comes back
| Field | Type |
|---|---|
stopped | object[] |
id | string |
text | string |
curl -X POST "$SANDBOX/runs/stop" \
-H "x-intentic-control: $INTENTIC_TOKEN" \
-H "content-type: application/json" \
-d '{"repo":"root","target":"…","device":"…","id":"a1b2c3d4"}'import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.runs.stop({
"repo": "root",
"target": "…",
"device": "…",
"id": "a1b2c3d4"
});GET/runs/outputWhat a run on one of your computers printed
The end of its log on the computer, or what it printed after an earlier read.
What you send
| Field | Type | Where |
|---|---|---|
devicerequired | string | query |
idrequired | string | query |
since | integer | query |
lines | integer | query |
What comes back
| Field | Type |
|---|---|
run | object |
device | string |
id | string |
name | string |
state | "running" | "ended" | "unknown" |
said | string |
exitCode | integer |
startedAt | string |
endedAt | string |
repo | string |
ports | integer[] |
startedBy | string |
builtFrom | object |
commit | string |
changed | integer |
at | string |
movedDuringBuild | boolean |
landsSince | integer |
total | integer |
lines | string[] |
curl "$SANDBOX/runs/output?device=%E2%80%A6&id=a1b2c3d4" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.runs.output({
"device": "…",
"id": "a1b2c3d4"
});