job.execution.cancelled
A job’s device was cancelled. The gateway sends it when the job is cancelled before the device started, or when the device’s action ended cancelled (the job was cancelled while it ran, or the action was cancelled by hand). Envelope: endpoint and device are the device’s, package is “houradvantage-connect”. Sent once per device and attempt.
Schema id: urn:houradvantage:events:3:job.execution.cancelled
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 the device runs: a standard action, or a package action or command. |
state | "queued" \ | "waiting_window" \ | "running" \ |
wave | integer | yes | The device’s wave, counted from 0. at least 0 |
attempt | integer | yes | Which attempt this is: 1, then one more each time retry-failed takes the device again. at least 1 |
action_id | integer | The device’s action for this attempt. Absent when the device was cancelled before its action was started. | |
detail | string | Why: “the job was cancelled” for a device that had not started, or the action’s reason (“the action was cancelled before step 2 (set_option) went out”). |
Example
{ "job_id": 7, "name": "volume", "action": "set_settings", "state": "cancelled", "wave": 1, "attempt": 1, "detail": "the job was cancelled"}JSON Schema
job.execution.cancelled.json
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "urn:houradvantage:events:3:job.execution.cancelled", "title": "job.execution.cancelled: data", "description": "A job's device was cancelled. The gateway sends it when the job is cancelled before the device started, or when the device's action ended cancelled (the job was cancelled while it ran, or the action was cancelled by hand). Envelope: `endpoint` and `device` are the device's, `package` is \"houradvantage-connect\". Sent once per device and attempt.", "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 the device runs: a standard action, or a package action or command." }, "state": { "enum": [ "queued", "waiting_window", "running", "succeeded", "failed", "timed_out", "cancelled" ], "description": "Where the device stands in the job. In this event: always cancelled." }, "wave": { "type": "integer", "minimum": 0, "description": "The device's wave, counted from 0." }, "attempt": { "type": "integer", "minimum": 1, "description": "Which attempt this is: 1, then one more each time retry-failed takes the device again." }, "action_id": { "type": "integer", "description": "The device's action for this attempt. Absent when the device was cancelled before its action was started." }, "detail": { "type": "string", "description": "Why: \"the job was cancelled\" for a device that had not started, or the action's reason (\"the action was cancelled before step 2 (set_option) went out\")." } }, "required": [ "job_id", "action", "state", "wave", "attempt" ], "examples": [ { "job_id": 7, "name": "volume", "action": "set_settings", "state": "cancelled", "wave": 1, "attempt": 1, "detail": "the job was cancelled" } ]}