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
Treeowner refrecursive ownership tree
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 labelsworkflow ids
GetRunrun idcurrent execution status
WatchRunrun idcurrent status, then transitions to terminal
RunResultrun idwaits and returns typed result JSON
CancelRunrun idrequests cancellation with cleanup
RunStatusrun idstatus 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.

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, follow, since; or admin raw querylog records and dropped counts
Metricsref, time range, follow; or admin PromQLsnapshot JSON, live OTLP, dropped counts
Traceref, follow; or admin Jaeger querysnapshot JSON, live OTLP, dropped counts

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.