API Reference

Resources

View and update workspace compute resources - CPU cores, memory, and writable disk. Changes can be applied immediately (hot) or deferred to the next start.

Get resources

Get the current resource allocation for a workspace.

const resources = await ws.resources.get('ws_a1b2c3d4');

console.log(resources.cpus);           // 2
console.log(resources.memory_mb);      // 2048
console.log(resources.writable_size_mb); // 1024
GET /workspace/:workspaceId/resources
curl "https://api.oblien.com/workspace/ws_a1b2c3d4/resources" \
  -H "X-Client-ID: $OBLIEN_CLIENT_ID" \
  -H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"

Response

{
  "success": true,
  "resources": {
    "cpus": 2,
    "memory_mb": 2048,
    "writable_size_mb": 1024,
    "cpu_config": { "quota": "standard" },
    "status": "running"
  }
}

Update resources

Change CPU, memory, or disk allocation. Use apply: true to apply changes immediately (restarts the VM), or apply: false to save changes for the next start.

// Apply immediately (restarts VM)
const result = await ws.resources.update('ws_a1b2c3d4', {
  cpus: 4,
  memory_mb: 4096,
  apply: true,
});

console.log(result.updated);    // { cpus: 4, memory_mb: 4096 }
console.log(result.relaunched); // true

// Save for next start
await ws.resources.update('ws_a1b2c3d4', {
  writable_size_mb: 2048,
  apply: false,
});
PUT /workspace/:workspaceId/resources
{
  "cpus": 4,
  "memory_mb": 4096,
  "apply": true
}

Also supports PATCH for partial updates.

curl -X PUT "https://api.oblien.com/workspace/ws_a1b2c3d4/resources" \
  -H "X-Client-ID: $OBLIEN_CLIENT_ID" \
  -H "X-Client-Secret: $OBLIEN_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{ "cpus": 4, "memory_mb": 4096, "apply": true }'

Parameters

ParameterTypeRequiredDescription
cpusnumberNoCPU cores (1–32, subject to plan)
memory_mbnumberNoMemory in MB (128–65536, subject to plan)
writable_size_mbnumberNoDisk in MB (64–204800, subject to plan)
applybooleanNotrue = relaunch VM immediately. false = save for next start

Response

{
  "success": true,
  "updated": {
    "cpus": 4,
    "memory_mb": 4096,
    "writable_size_mb": 1024
  },
  "relaunched": true
}

Update behavior

ChangeApply: trueApply: false
CPUHot-applied, VM restartsSaved, applied next start
MemoryHot-applied, VM restartsSaved, applied next start
DiskVM stopped, resized, relaunchedSaved, applied next start

Errors

CodeStatusCause
invalid_resources400Values out of allowed range
no_resources400No resource fields provided
RESOURCE_NOT_ALLOWED403Exceeds per-workspace plan limits
POOL_LIMIT_REACHED402Would exceed owned resource pool
RUNNING_POOL_REACHED402Would exceed running resource pool (only with apply: true)
VM_UNAVAILABLE503VM backend unreachable

See the Pricing page for per-plan resource limits and Resource Pools for how pool quotas work.