Skip to content
View Markdown

Execute shell or JavaScript

POST/v1/disks/{disk}/exec
POST
/v1/disks/{disk}/exec
curl --request POST \
--url 'https://api.wabe.sh/v1/disks/demo/exec?kind=bash' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/plain' \
--data 'echo Hello'

Select body, script or path as source. Source limit is 64 KiB. HTTP 200 starts the response; require a final exit record and inspect its code. Runtime failures are stderr/exit records. Default elapsed deadline is 30 seconds. JS runs as an async function body on Linux.

disk
required
string
/^[A-Za-z0-9_-]{1,128}$/

Example

demo

Project disk name, or the disk ID in the actor runtime disk URL.

kind
string
default: bash
Allowed values: bash js
script

UTF-8 source as query text; the body becomes stdin.

string
path

Stored virtual JS source path; requires kind=js. Body becomes stdin.

string
branch
string
commit
string format: uuid
label
string
string

Example

echo Hello

Newline-delimited JSON records; consume or close the body to release the request lease.

Media typeapplication/x-ndjson
string

Example

{"type":"stdout","data":"SGVsbG8K"}
{"type":"exit","code":0}

Invalid input, query, name or source.

Media typetext/plain
string

Missing, invalid or revoked project API key, or an invalid runtime access token.

Media typeapplication/json
object
error
required
string
message
required
string

Actor runtime token does not authorize this disk or instance generation.

Media typeapplication/json
object
error
required
string
message
required
string

Requested file, parent or script was not found.

Media typetext/plain
string

Storage, I/O or corruption failure.

Media typetext/plain
string

Disk unavailable.

Media typeapplication/json
object
error
required
string
message
required
string