Sign in
Docs
API referenceInfrastructure

API reference

Watch a run

SSE
GET https://api.inorbit.hr/v1/infra/runs/{run_id}/eventsAccept: text/event-stream; one data: line of JSON per event
WebSocket
wss://api.inorbit.hr/v1/ws{"type":"call","id":"1","method":"iohr.infra.v1.InfraService/WatchRun","body":{…}}
MQTT 5
wss://api.inorbit.hr/v1/mqttsubscribe to infra/runs/{run_id}/events
Have a token? Manage tokens in the console
GET
/v1/infra/runs/{run_id}/events

A run's events as server-sent events, from after_seq on, until the run finishes: state changes, tasks, hosts, resources and output lines, redacted on the worker.

Needs scope infra:read.

Authorization

bearer
headerAuthorizationBearer <JWT>

An access token from the identity provider: a person's, or a customer's from the client credentials grant with an API key (developers.inorbit.hr). The gateway verifies it; the audience is iohr-api.

Path Parameters

run_id*string

The run's id, run_ and 32 hex characters, from Start a run or List a stack's runs.

Query Parameters

after_seq?string

Events after this seq; 0 is from the start.

Formatint64

Response Body

A stream of iohr.infra.v1.WatchRunResponse events, one JSON object per data:; a failure is an error event carrying Problem

text/event-stream
  1. response

iohr.infra.v1.WatchRunResponse

event?

iohr.infra.v1.RunEvent

import { ApiError, Public } from "@inorbithr/sdk";// Reads INORBIT_TOKEN, or INORBIT_KEY_ID and INORBIT_KEY_SECRET.const api = Public.fromEnv();try {  for await (const event of api.infra.watchRun("<run_id>")) {    console.log(event);  }} catch (e) {  if (!(e instanceof ApiError)) throw e;  console.error(`${e.code}: ${e.problem} (request id ${e.raw.requestId})`);  process.exitCode = 1;}

npm install @inorbithr/sdk. Calls the package's public surface; an operation newer than your package needs the next release or a client generated for your account. The SDKs.

Example Response
{  "event": {    "at": "string",    "kind": "string",    "run_id": "string",    "seq": "string",    "state": "string",    "status": "string",    "subject": "string",    "text": "string"  }}