GET /v1/agents/runtime/{runtime_id}
from gravixlayer import GravixLayer
client = GravixLayer() # defaults to cloud="aws", region="us-east-1"
sandbox = client.runtime.create() # defaults to template="base-small"
info = client.runtime.get(sandbox.runtime_id)
print(info.runtime_id)
print(info.status)
print(info.template)
print(info.cloud, info.region)
print(info.cpu_count, "vCPU")
print(info.memory_mb, "MB RAM")
print(info.started_at)
print(info.timeout_at)
sandbox.kill()
import { GravixLayer } from 'gravixlayer';
const client = new GravixLayer(); // defaults to cloud="aws", region="us-east-1"
const sandbox = await client.runtime.create(); // defaults to template="base-small"
const info = await client.runtime.get(sandbox.runtimeId);
console.log(info.runtimeId);
console.log(info.status);
console.log(info.template);
console.log(info.cloud, info.region);
console.log(info.cpuCount, "vCPU");
console.log(info.memoryMb, "MB RAM");
console.log(info.startedAt);
console.log(info.timeoutAt);
await sandbox.kill();
# Requires: GRAVIXLAYER_API_KEY, jq
RT=$(gravixlayer runtime create --wait --output json | jq -r '.runtime_id')
gravixlayer runtime get "$RT" --output json
gravixlayer runtime kill "$RT" -y
# Requires: GRAVIXLAYER_API_KEY, jq
API="https://api.gravixlayer.ai/v1"
AUTH=(-H "Authorization: Bearer $GRAVIXLAYER_API_KEY" -H "Content-Type: application/json")
RT=$(curl -sS -X POST "$API/agents/runtime" "${AUTH[@]}" \
-d '{"template":"base-small","cloud":"aws","region":"us-east-1"}' | jq -r '.runtime_id')
curl -sS "$API/agents/runtime/$RT" \
-H "Authorization: Bearer $GRAVIXLAYER_API_KEY"
echo
curl -sS -X DELETE "$API/agents/runtime/$RT" \
-H "Authorization: Bearer $GRAVIXLAYER_API_KEY"
echo
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
runtime_id | string | Yes | Runtime identifier |
Response
| Field | Type | Description |
|---|---|---|
runtime_id | string | Unique runtime ID |
status | string | Current status |
template | string | Template name |
cloud | string | Cloud |
region | string | Region |
cpu_count | integer | vCPU count |
memory_mb | integer | Memory in MB |
disk_size_mb | integer | Disk in MB |
started_at | string | Start timestamp |
timeout_at | string | Timeout timestamp |
Status Values
| Status | Description |
|---|---|
creating | Runtime is being provisioned |
running | Runtime is active and ready |
stopped | Runtime was stopped |
terminated | Runtime was terminated |
failed | Runtime failed to start |
timed_out | Runtime exceeded its timeout |