CapsuleProcessRunCommandRequest
Runs a shell command in a capsule run that has not ended; one sent while it is still starting runs once it is ready. The response is the queued command: read it back by its id (or wait for it with the SDKs’ execAndWait) to see its result.
Kind: an object, used in requests.
Fields
Section titled “Fields”| Field | Type | Required | Description |
|---|---|---|---|
command | string | yes | The command: shell text run by the user’s login shell, from / — usually a program name, but it may be a whole command line (pipes, redirects and variables are then the shell’s). Constraints: required (empty or whitespace-only strings are rejected). |
arguments | string[] | The command’s arguments. Each is passed as one literal word, quoted for the shell as needed, so spaces, quotes, $, globs and operators in an argument reach the program exactly as given. To pipe or redirect, run sh with arguments ["-c", "<line>"], or put the line in command. | |
runAsUser | string | null | The user to run it as: one of the capsule’s users or one added to the run. Null: the default user. | |
maximumDuration | timespan | null | The longest the command may run before it is stopped. Null: five minutes. | |
async | boolean | Run the command in the background: the capsule moves on to the next command without waiting for this one, and records its result when it ends. |
Example
Section titled “Example”{ "command": "...", "arguments": [ "..." ], "runAsUser": "...", "maximumDuration": "00:05:00", "async": false}Where it’s used
Section titled “Where it’s used”capsuleRuns.exec(POST /capsule-processes/by-id/{id}/commands)