Get started

Events (SSE)

Real-time event stream using Server-Sent Events. Subscribe to receive live updates about image downloads, task progress, and cluster state changes.


GET /events

Opens a persistent SSE connection. The server sends a heartbeat every 30 seconds to keep the connection alive. Events are JSON-encoded in the data field.

Event format

data: {"type": "image.download.progress", "payload": {...}}

Event types

TypeDescription
image.download.progressImage download progress with bytes, total, percent, and done flag
task.state.changedA task’s state changed (started, completed, failed)
node.state.changedA node’s status or daemon state changed

Image download progress event

{
  "type": "image.download.progress",
  "payload": {
    "imageId": "a1b2c3d4-...",
    "bytes": 524288000,
    "total": 1073741824,
    "percent": 48.8,
    "done": false
  }
}

Task state changed event

{
  "type": "task.state.changed",
  "payload": {
    "runId": "a1b2c3d4-...",
    "taskName": "ceph.create-osd",
    "state": "completed"
  }
}

Node state changed event

{
  "type": "node.state.changed",
  "payload": {
    "nodeId": "550e8400-...",
    "status": "active"
  }
}