API Reference
Logs
Retrieve, stream, and manage workspace logs. Supports boot logs, command logs, and individual log files.
Get logs
Get workspace logs with optional source filtering.
const logs = await ws.logs.get('ws_a1b2c3d4', {
source: 'boot',
tail_lines: 100,
});GET /workspace/:workspaceId/logs?source=boot&tail_lines=100curl "https://api.oblien.com/workspace/ws_a1b2c3d4/logs?source=boot&tail_lines=100" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
source | string | - | Log source filter (e.g., "boot") |
tail_lines | number | 100 | Number of lines from the end |
Clear
Delete all logs for a workspace.
await ws.logs.clear('ws_a1b2c3d4');DELETE /workspace/:workspaceId/logscurl -X DELETE "https://api.oblien.com/workspace/ws_a1b2c3d4/logs" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"List log files
Get a list of all available log files.
const files = await ws.logs.list('ws_a1b2c3d4');GET /workspace/:workspaceId/logs/listcurl "https://api.oblien.com/workspace/ws_a1b2c3d4/logs/list" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Get log file
Read a specific log file by name.
const content = await ws.logs.file('ws_a1b2c3d4', 'app.log');GET /workspace/:workspaceId/logs/file/:namecurl "https://api.oblien.com/workspace/ws_a1b2c3d4/logs/file/app.log" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Stream boot logs
Stream boot logs in real-time via SSE.
const stream = await ws.logs.streamBoot('ws_a1b2c3d4', {
tail_lines: 50,
});
stream.on('data', (line) => console.log(line));GET /workspace/:workspaceId/logs/stream/boot?tail_lines=50Returns an SSE stream.
curl -N "https://api.oblien.com/workspace/ws_a1b2c3d4/logs/stream/boot?tail_lines=50" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
tail_lines | number | 100 | Initial lines to return before streaming |
Stream cmd logs
Stream command/process logs in real-time via SSE.
const stream = await ws.logs.streamCmd('ws_a1b2c3d4', {
tail_lines: 50,
});
stream.on('data', (line) => console.log(line));GET /workspace/:workspaceId/logs/stream/cmd?tail_lines=50Returns an SSE stream.
curl -N "https://api.oblien.com/workspace/ws_a1b2c3d4/logs/stream/cmd?tail_lines=50" \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET"Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
tail_lines | number | 100 | Initial lines to return before streaming |
Close the connection to stop either log stream.