v1

latestOpenAPI 3.1.02026-07-17254060.5 KB
exec

Execute a command

Start a command with the given options and return a value representing the process.

This API returns a task-id (see the response schema and the example below), then you need to call /v1/tasks/{task-id}/websocket/control and /v1/tasks/{task-id}/websocket/stdio (also /v1/tasks/{task-id}/websocket/stderr if split-stderr is true) with the returned task-id.

post/v1/exec

Request body

commandstring[] required

The command to execute (including arguments).

service-contextstring

The service context to use for execution.

environmentobject

Environment variables to set for the command.

working-dirstring

The working directory for the command.

timeoutstring

The timeout for the command execution (e.g., "60s", "1m").

user-idinteger

The user ID to run the command as.

userstring

The username to run the command as.

group-idinteger

The group ID to run the command as.

groupstring

The group name to run the command as.

terminalboolean

Whether to allocate a pseudo-terminal.

interactiveboolean

Whether the command is interactive.

split-stderrboolean

Whether to split stderr from stdout.

widthinteger

The width of the terminal (if applicable).

heightinteger

The height of the terminal (if applicable).

Response

Command execution initiated.

typestring

Response type, "sync".

status-codeinteger

HTTP response status code.

statusstring

The description of the HTTP status code.

See the IANA list.

changestring

The Change ID of the asynchronous change.