Skip to main content

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 sequence is greater than cursor, oldest first. Pass nextCursor back as cursor to read the next window. To follow a running job, repeat the call until state is no longer running and hasMore is false.
  • Window size: limit lines at most, 1 to 200, default 50.
  • Errors: 400 VALIDATION_FAILED for an unknown stream, a negative cursor, or a limit outside 1 to 200. 404 SESSION_NOT_FOUND when the session does not exist, and 404 NOT_FOUND (job not found) when it has no job with this ID.

Request​

Responses​

A window of the job's output, with the job's current state and the cursor to continue from.

Response Headers
    X-Session-ID

    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.

    X-Request-ID

    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.