Read a bounded slice of a job's output log

Returns the job's output — stdout and stderr interleaved exactly as a terminal would show them. With no range parameters you get the TAIL of the log (default 200 lines), which is what you want for 'how is it going?'. To follow a growing log without re-reading it, feed the previous reply's nextOffsetBytes back as offset_bytes. Every reply is capped at 262144 bytes (256 KiB) decoded, so a huge log is paged rather than dumped; chunk is base64 because process output is arbitrary bytes, not necessarily valid UTF-8. eof: true means you have read to the current end of the file, NOT that the job finished. Unlike /api/v1/exec the job is never killed for producing too much output; truncated: true means the 256 MiB log file itself hit its cap and the agent stopped recording while the job kept running.

get/api/v1/jobs/{id}/logs

Request

  • Base URL: https://aicommander.dev
  • URL: https://aicommander.dev/api/v1/jobs/{id}/logs
  • Auth: one of:
    • none
    • HTTP bearer

Path parameters

idstring required
Example:9f2c1b7ad4e05386

The jobId returned by POST /api/v1/jobs (16 hex characters).

Query parameters

codestring required
Example:AIC-7K3P-WX9M-RTBN

How the user named the machine, passed exactly as given.

tail_linesinteger

Return the last N lines of the log (default 200). Must be an integer of at least 1 — validated, not silently corrected: an out-of-range value is rejected with 400 naming the field. Ignored when offset_bytes is given.

offset_bytesinteger

Read forward from this byte offset instead of tailing — pass a previous reply's nextOffsetBytes to follow a growing log. Must be an integer of 0 or more; a negative or fractional value is rejected with 400.

max_bytesinteger

Requested slice size in bytes. Must be an integer from 1 to 262144 (256 KiB — also the default and the hard per-reply ceiling); a larger value is rejected with 400 rather than silently clamped, so page a long log with offset_bytes instead.

Response

One slice of the job's output log.

oktrue required

Changes

No recorded changes to this operation across all 1 revision of this API.