Run Internals

Open Petri Run

Opens the run in the Petri run store for the worker. create inserts the run and takes its writer lease for owner; write takes the lease of an existing run; read takes no lease. The lease is idempotent per owner: a retry by the owner that holds it gets the same lease. Another live owner is refused with petri_run_leased. The lease ends when the worker releases it, when the server observes the worker exit, or by operator release, never by timeout.

post/api/v1/runs/{id}/petri/open

Path parameters

idstring required

Unique run identifier (ULID).

Request body

access'create' | 'write' | 'read' required

How a worker opens a Petri run. create inserts the run and takes its writer lease, write takes the lease of an existing run, read takes no lease.

ownerstring nullable

The owner id the writer lease is taken for. Required for create and write, absent for read.

Example request

{
  "owner": "18f3c2a9e1b4-42017-0-9f3a1c7e2b5d"
}

Response

Run opened

locatorstring required

Where the run lives, for messages.

Example response

{
  "locator": "sqlite database /var/lib/fabro/db/fabro.sqlite3, run `01JNQVR7M0EJ5GKAT2SC4ERS1Z`"
}

Changes

Changed in 1 of the 172 revisions of this API.1