Expand description
The public operations this server serves, declared once.
§One operation per public operation, and no more
The list here is the whole API. It is exactly one operation per variant of
PrintAction the contracts declare,
plus seven operations beside them — the prints listing, status, context,
image materialization, history, and the manifest’s read and write — and
nothing else. The router is built by folding
over this array rather than by writing routes out, so the set served and the
set declared are one thing; and this crate’s own tier derives the required
set from the contracts’ own PrintAction rather than from a list of its
own, so growing this array and the routes together cannot satisfy it.
Every operation sits beneath VERSION_PREFIX, takes JSON where it takes a
body at all, and answers JSON.
§Each operation declares what it takes and what it answers
Operation::request is the request schema of one route — every value a
caller supplies, where it travels and whether it is required — and
Operation::response_schema is the schema of each answer that route can
produce. Neither is written out for the ten mutating operations: their body
is derived from the contracts’ own
PrintAction at run time, so a variant
that gains a field gains it here the moment the type does. The
command-line program builds its own parser from these declarations rather
than from a list of its own, which is what stops the two surfaces drifting.
§The ingress is not one of them
INGRESS_PATH is the endpoint Obico’s webhook notification plugin posts
to. It is the producer’s own ingress rather than an operation a client
calls — it is authenticated by a shared secret rather than by an actor, it
carries Obico’s body rather than this system’s, and it answers before its
handling completes. So it is declared separately and served outside the
versioned prefix, where no client can mistake one surface for the other.
Structs§
- Declared
- One value declared beside an operation, at one place in its request.
- Operation
- One public operation: what it is called, how it is reached, and what it does.
- Parameter
- One value a request to an operation carries.
Enums§
- Action
Kind - One action of the closed vocabulary, named without its payload.
- Answer
- One answer a route can produce.
- Effect
- What one operation does to the machine or the record.
- Located
- Where one value of a request travels.
- Method
- The method one operation is reached by.
- Print
Action - The whole vocabulary an actor may ask for, and there is no other.
- Value
Kind - What kind of value one parameter takes.
Constants§
- BESIDE_
THE_ ACTIONS - The seven operations this server serves beside the action vocabulary.
- CONTEXT_
IMAGE_ PATH_ FIELD - The field a context answer carries the latest image’s own path in.
- IMAGE_
PATH_ FIELD - The field an image answer carries that image’s own path in.
- INGRESS_
PATH - Where
Obico’s webhook notification plugin posts, which is not a public operation. See this module’s own comment. - MEDIA_
TYPE - The media type every operation takes a body in and answers in.
- OPERATIONS
- Every public operation this server serves, and there is no other.
- VERSION_
PREFIX - The one versioned prefix every public operation is served beneath.
Functions§
- operation
- The operation of one name, when this server serves one.