Skip to main content

Management API methods

Fields named spec, state, payload, params, result, and manifest are JSON carried as protobuf bytes. Record refs always use kind/id.

ResourcesAPI​

MethodRequestResult
Listselector or query, page size/tokenresource snapshot and next token
Countselector or query; optional group by statustotal and status groups
CountOwnedup to 100 owner refslive child count per owner
Getrefcomplete record, including closed records
GetManyup to 100 refsthe complete records in one call; refs that do not exist are listed in missing, not failed on
Treeowner ref, include_deletedrecursive ownership tree; a run's tree always includes its deleted records, any other owner's on request; every node carries the record's flows
Deleterefwaits for child-first finalize
Transferref, new owner, optional keep secondsgives the whole subtree away
Invokeref, command, JSON payload, optional request idJSON command result
Applykind, id, JSON spec, labelsdeclared record ref
Downloadrefbyte stream or not-found when no blob exists

List accepts either the structured selector (kind, phase, owner, exact labels) or a query string, never both. Query fields are kind, id, phase, owner, pipeline, started, finished, and label.<key>. Continue only with the opaque next_page_token returned by the previous page.

System-owned label keys under graphene.io/ cannot be supplied by users. Invoke.request_id deduplicates retries; when omitted, the server generates one.

RunsAPI​

MethodRequestResult
StartRunrun id, pipeline, params, optional image and labelsrun id, workflow ids, decision — started, exists (the id already names this very request, nothing new began), queued (+ displaced_run_id), replaced-previous; another request under a taken id is ALREADY_EXISTS
GetRunrun idthe run's phase
WatchRunrun idcurrent status, then transitions to terminal
RunResultrun idwaits and returns the run's state: result (partial for a run that failed) and error
CancelRunrun idrequests cancellation with cleanup
RunStatusrun idphase and pending activities with attempts, failure and heartbeat

An image makes the run managed: the server launches the worker. Params are validated against the selected pipeline or revision manifest before start. List runs through ResourcesAPI.List with kind run.

Phases are one lowercase vocabulary for runs and records alike: a run is running, completed, failed, canceled, terminated or timed-out; a record creating, ready, updating, deleting, deleted or failed. A selector's phase= speaks the same words; phase=deleted lists records that finished their life (as far back as retention).

A closed run's state is what its close left: {result} when it completed, {error, result} when it did not — the pipeline closes a failed run with the partial result in the failure's details, and the door reads it back. RunResult returns the same two fields.

ObserveAPI.Events takes kinds to filter on the server; a milestone a pipeline emitted through EventsAPI.Emit arrives as kind note with the milestone's name as subject and its payload as input.

RevisionsAPI​

MethodRequestResult
Materializepipeline plus tar.gz bytes or source refstages upload, runtime, build, describe, publish, done
RunRevisionpipeline, revision, run id, params, labelsworkflow ids for a draft run

Materialization survives client disconnect because the revision record owns the build. The final done event contains revision id, image and manifest.

SourceAPI​

MethodRequestResult
UploadSourcepipeline id and tar.gzlocation and digest
DownloadSourcesource reftar.gz byte stream
ListRuntimesemptyconfigured names, versions, images and default
ListFilessource refpaths, sizes and tree digest
ReadFilesource ref and pathfile bytes

Files are read-only. Source mutation is a Git ref movement followed by the record's sync command.

ObserveAPI​

MethodRequestStream/result
Staterefworkflow status and entity record when applicable
Eventsref, cursor, follow, optional activity idclassified complete history with raw event
Logsref; since/until, limit, order, page_token, severities, stream, agent, entity, text; query — LogsQL inside the record (balanced, no pipe; not with follow), or raw without ref (admin)records, dropped counts, a closing page{returned, truncated, next_page_token}; the fields apply to the live tail as to the history
LogFacetsa Logs selection, fields, limitper field, its values with record counts
Metricsref, time range, step_seconds, follow; query — PromQL inside the record (backend extra_filters), or raw without ref (admin)snapshot JSON, live OTLP, dropped counts
Traceref, follow, limit; query — Jaeger params inside the record, or raw without ref (admin)snapshot JSON, live OTLP, dropped counts

Errors are codes: INVALID_ARGUMENT for a query, step or filter the door or the backend refuses (4xx), UNAVAILABLE for a backend that did not answer or answered 5xx, UNIMPLEMENTED for a dimension without a backend or a scoped PromQL query on a backend without extra_filters, PERMISSION_DENIED for a token that may not read the record or asked for the raw surface without being an administrator. An empty selection is OK with a page of zero records.

Raw backend queries are admin-only and ignore record/follow fields. Live metrics and traces are serialized standard OTLP export requests.

AgentsAPI​

MethodRequestResult
Ptyagent id, columns, rowsopened session id, raw output, final exit
PtyInputsession id plus data, resize or closeacknowledgement

PTY is deliberately mortal: the shell closes with stream cancellation, agent disconnect, explicit close, or process exit. It does not reconnect.

NamespacesAPI, RbacAPI, SecretsAPI​

Service.methodRequestResult
NamespacesAPI.ServerInfoemptyversion and component health
RbacAPI.IssueTokenaccount, TTL seconds, commenttoken id, one-time value, expiry
RbacAPI.WhoAmIemptysubject, groups, namespace, roles, allowed pairs, cluster-wide flag
SecretsAPI.SetSecretname and valuenew version counter

Namespace, role, rolebinding, serviceaccount, var and secret metadata remain ordinary records. Token and secret values use dedicated methods because a record command would persist its payload or result in history.