machines

Starts a command detached and returns at once. Its stdout, stderr and exit code are kept in the machine, so the caller can disconnect and poll GET /v1/machines/{id}/jobs/{job_id} and read output from an offset. A running job keeps the machine from auto-stopping. Wakes a stopped machine. The image needs sh. Requires the machine:exec scope.

post/v1/machines/{id}/jobs

Request

Path parameters

idstring required

Machine id

Request body

cwdstring nullable
envobject
timeoutSecondsinteger nullable

Stop the job with SIGTERM after this many seconds. Unset: no limit.

userstring nullable

Run as this user (image user name or uid[:gid]).

Response

The job is running

commandstring[] required

The command as it was run (argv).

createdAtstring required
exitCodeinteger nullable

The command's exit code once exited; 143 when it was cancelled or hit its timeout.

finishedAtstring nullable
idstring required
machineIdstring required
statestring required

running, exited (see exitCode), or lost: the machine stopped or restarted while the job ran, so it never finished.

stderrBytesinteger nullable

Bytes of stderr written so far, when the machine was asked.

stdoutBytesinteger nullable

Bytes of stdout written so far, when the machine was asked.

Changes