Skip to main content
POST
/
v1
/
devboxes
/
{devbox_id}
/
executions
/
{execution_id}
/
wait_for_status
JavaScript
import Runloop from '@runloop/api-client';

const client = new Runloop({
  bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});

const devboxAsyncExecutionDetailView = await client.devboxes.waitForCommand(
  'devbox_id',
  'execution_id',
  { statuses: ['queued'] },
);

console.log(devboxAsyncExecutionDetailView.devbox_id);
{
  "devbox_id": "<string>",
  "execution_id": "<string>",
  "status": "queued",
  "shell_name": "<string>",
  "stdout": "<string>",
  "stderr": "<string>",
  "exit_status": 123,
  "stdout_truncated": true,
  "stderr_truncated": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

devbox_id
string
required

The Devbox ID.

execution_id
string
required

The Async Execution ID.

Query Parameters

last_n
string

Last n lines of standard error / standard out to return (default: 100)

Body

application/json
statuses
enum<string>[]
required

The command execution statuses to wait for. At least one status must be provided. The command will be returned as soon as it reaches any of the provided statuses.

Available options:
queued,
running,
completed
timeout_seconds
integer<int32> | null

(Optional) Timeout in seconds to wait for the status, up to 25 seconds. Defaults to 25 seconds.

Response

OK

devbox_id
string
required

Devbox id where command was executed.

execution_id
string
required

Ephemeral id of the execution in progress.

status
enum<string>
required

Current status of the execution.

Available options:
queued,
running,
completed
shell_name
string | null

Shell name.

stdout
string | null

Standard out generated by command. This field will remain unset until the execution has completed.

stderr
string | null

Standard error generated by command. This field will remain unset until the execution has completed.

exit_status
integer<int32> | null

Exit code of command execution. This field will remain unset until the execution has completed.

stdout_truncated
boolean | null

Indicates whether the stdout was truncated due to size limits.

stderr_truncated
boolean | null

Indicates whether the stderr was truncated due to size limits.