Read a bounded window of one job's output
GET/session/jobs/:jobId/output
Reads a window of one job's stdout and stderr lines from the database without waiting for the job to finish. Peen stores every line before any client can see it, so a running job's output grows as you read it, and the same lines stay readable after the job ends or Peen restarts.
Each line carries a sequence number. stdout and stderr share one counter per job, starting at 1, so the sequence keeps the order Peen saw the lines in across both streams.
- Cursor: the response holds lines whose
sequenceis greater thancursor, oldest first. PassnextCursorback ascursorto read the next window. To follow a running job, repeat the call untilstateis no longerrunningandhasMoreisfalse. - Window size:
limitlines at most, 1 to 200, default 50. - Errors:
400 VALIDATION_FAILEDfor an unknownstream, a negativecursor, or alimitoutside 1 to 200.404 SESSION_NOT_FOUNDwhen the session does not exist, and404 NOT_FOUND(job not found) when it has no job with this ID.
Request
Responses
- 200
- 400
- 401
- 404
- 406
- 500
A window of the job's output, with the job's current state and the cursor to continue from.
Response Headers
The session this response belongs to. For session-scoped requests it echoes the X-Session-ID request header; for POST /sessions/open and POST /sessions/system it is the session that was opened or created.
The request's correlation ID. When the request carried an X-Request-ID header holding a UUID, Peen echoes it; otherwise Peen generates a new UUID. The controller log records the same value for this request.
The request is invalid. code is VALIDATION_FAILED for a bad parameter, body field, page bound, base64 value or file size, or a body that is not one JSON value or exceeds the body limit, and INVALID_SESSION_ID for a malformed X-Session-ID header.
PEEN_API_TOKEN is set and the request's bearer token is missing or wrong. code is UNAUTHORIZED. A deployment with no token never returns this.
The session, or the record the request names inside it, does not exist. code is SESSION_NOT_FOUND when no session has the X-Session-ID ID, on every operation. It is NOT_FOUND when the session exists but the record the request names inside it does not, and the message names what is missing, such as job not found. It is WORKSPACE_NOT_FOUND when an opened workspace directory no longer exists.
The request's Accept header allows neither application/json nor */*, and every response is JSON. code is BAD_REQUEST and message is unsupported response representation. Omit Accept or send application/json.
An unexpected server failure. code is INTERNAL_SERVER_ERROR and message is internal server error. The controller log has the details under the response's X-Request-ID.