job.completed
A job is over. The gateway sends it when every device of a running or paused job has finished (succeeded, failed, timed out or been cancelled). POST /api/tenants/{tenant}/jobs/{id}/retry-failed takes its failed and timed-out devices again, and sends job.resumed. Envelope: endpoint is one of the endpoints the job has devices on (one event to each), device is "", package is “houradvantage-connect”; each change to the job gives a new id.
Schema id: urn:houradvantage:events:3:job.completed
Fields
| Field | Type | Required | Description |
|---|---|---|---|
job_id | integer | yes | The job’s id (GET /api/tenants/{tenant}/jobs/{id}). |
name | string | The job’s name. Absent when the job was created without one. | |
action | string | yes | The action each device runs: a standard action, or a package action or command. |
state | "running" \ | "paused" \ | "cancelled" \ |
wave | integer | yes | The current wave, counted from 0: devices of this wave and of the waves before it may start. at least 0 |
waves | integer | yes | How many waves the job has. at least 0 |
reason | string | Why the job is as it is, in words. Paused: “paused by | |
counts | object | yes | How many of the job’s devices, across every wave, are in each state. The counts add up to the number of devices the job runs on. |
counts.queued | integer | yes | Devices waiting to start: their wave has not started, or max_concurrent leaves no room. at least 0 |
counts.waiting_window | integer | yes | Devices whose turn it is, waiting for the job’s window to open in their zone. at least 0 |
counts.running | integer | yes | Devices whose action is started (or being started) and not finished. at least 0 |
counts.succeeded | integer | yes | Devices whose action finished with every step done. at least 0 |
counts.failed | integer | yes | Devices whose action failed (a step failed or went unanswered), or could not be started. at least 0 |
counts.timed_out | integer | yes | Devices whose action did not finish within the job’s timeout. at least 0 |
counts.cancelled | integer | yes | Devices cancelled: the job was cancelled before they started, or their action ended cancelled. at least 0 |
Example
{ "job_id": 7, "name": "volume", "action": "set_settings", "state": "completed", "wave": 2, "waves": 3, "counts": { "queued": 0, "waiting_window": 0, "running": 0, "succeeded": 12, "failed": 1, "timed_out": 0, "cancelled": 0 }}JSON Schema
job.completed.json
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "urn:houradvantage:events:3:job.completed", "title": "job.completed: data", "description": "A job is over. The gateway sends it when every device of a running or paused job has finished (succeeded, failed, timed out or been cancelled). `POST /api/tenants/{tenant}/jobs/{id}/retry-failed` takes its failed and timed-out devices again, and sends job.resumed. Envelope: `endpoint` is one of the endpoints the job has devices on (one event to each), `device` is \"\", `package` is \"houradvantage-connect\"; each change to the job gives a new id.", "type": "object", "properties": { "job_id": { "type": "integer", "description": "The job's id (`GET /api/tenants/{tenant}/jobs/{id}`)." }, "name": { "type": "string", "description": "The job's name. Absent when the job was created without one." }, "action": { "type": "string", "description": "The action each device runs: a standard action, or a package action or command." }, "state": { "enum": [ "running", "paused", "cancelled", "completed" ], "description": "Where the job stands now: running (devices start as the rollout allows), paused (no device starts; those running go on), cancelled (no device starts again), completed (every device has finished). In this event: always completed." }, "wave": { "type": "integer", "minimum": 0, "description": "The current wave, counted from 0: devices of this wave and of the waves before it may start." }, "waves": { "type": "integer", "minimum": 0, "description": "How many waves the job has." }, "reason": { "type": "string", "description": "Why the job is as it is, in words. Paused: \"paused by <user>\", or the abort threshold (\"abort threshold: 2 of 5 finished devices failed or timed out (abort at 20%)\"). Cancelled: \"cancelled by <user>\". Running: what it waits for (\"wave 2 succeeded: waiting to be told to advance\", \"wave 2 has devices that did not succeed: retry-failed, advance or cancel\", \"waiting for window (opens 2026-10-04 22:00 America/Chicago)\"). <user> is the admin login, or \"local\" without one. Absent when there is nothing to say; always absent for a completed job." }, "counts": { "type": "object", "description": "How many of the job's devices, across every wave, are in each state. The counts add up to the number of devices the job runs on.", "properties": { "queued": { "type": "integer", "minimum": 0, "description": "Devices waiting to start: their wave has not started, or max_concurrent leaves no room." }, "waiting_window": { "type": "integer", "minimum": 0, "description": "Devices whose turn it is, waiting for the job's window to open in their zone." }, "running": { "type": "integer", "minimum": 0, "description": "Devices whose action is started (or being started) and not finished." }, "succeeded": { "type": "integer", "minimum": 0, "description": "Devices whose action finished with every step done." }, "failed": { "type": "integer", "minimum": 0, "description": "Devices whose action failed (a step failed or went unanswered), or could not be started." }, "timed_out": { "type": "integer", "minimum": 0, "description": "Devices whose action did not finish within the job's timeout." }, "cancelled": { "type": "integer", "minimum": 0, "description": "Devices cancelled: the job was cancelled before they started, or their action ended cancelled." } }, "required": [ "queued", "waiting_window", "running", "succeeded", "failed", "timed_out", "cancelled" ] } }, "required": [ "job_id", "action", "state", "wave", "waves", "counts" ], "examples": [ { "job_id": 7, "name": "volume", "action": "set_settings", "state": "completed", "wave": 2, "waves": 3, "counts": { "queued": 0, "waiting_window": 0, "running": 0, "succeeded": 12, "failed": 1, "timed_out": 0, "cancelled": 0 } } ]}