palbaseDocs

Palbase Machines · API

GET/machines/{name}/logs

Read what a machine wrote

What the machine's copies and its migration runs wrote to stdout and stderr, oldest first — or newest first with order=desc — as NDJSON: one MachineLogLine a line; with q, those lines alone that hold its text. Lines are kept for 7 days, from every version of the machine — one that did not come up too. A machine's lines are kept up to 1200 a minute; past it the rest of that minute is not. With follow=true the answer is held open (5 minutes at most, and until the machine is deleted; a project holds 5 followed reads open at once, a sixth is 429 too_many_follows) and what the machine writes next follows as it comes; a caller whose connection ends goes on with since= the time of the last line it had — a line may then come twice, and its id says so. A newest-first read pages back the same way: until= the time of the last line it had, which is inclusive in that order.

Called by your server, with the project's secret key.

Path

namestring · requiredThe machine's name: lowercase letters, digits and dashes, starting with a letter and not ending with a dash, 32 at most.

Query

sincestring (date-time) · optionalFrom when (inclusive); an hour ago when left out, a week ago at most.
untilstring (date-time) · optionalUntil when: exclusive, and with order=desc inclusive, so that a newest-first read goes on from the time of the last line it had; now when left out. Not with follow.
linesinteger · optionalHow many lines at most (a followed read: before it follows).
followboolean · optionalHold the answer open and send what the machine writes next.
order"asc" | "desc" · optionalasc: oldest first. desc: newest first — the newest lines of the window, up to lines of them. Not with follow.
qstring · optionalOnly the lines that hold this text, in any case. It is the text itself, no pattern: % and _ are themselves, and so is a backslash. 256 characters at most. A followed read follows those lines alone.
curl
curl -X GET "https://<your-ref>.palbase.studio/machines/<name>/logs" \
  -H "apikey: $PALBASE_SECRET_KEY"

Responses

200The machine's lines, oldest first or, with order=desc, newest first

400Validation failed or a required field is missing

401Missing or invalid API key

403Not the project's secret key

404The project has no machine of this name

429Over the project's request limit, or its machine time for this period is used up

503Temporarily unavailable; retrying is safe after Retry-After

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation ReadMachineLogs of machines's contract.