Skip to content

device.held

The gateway’s own event: a gate step of an action did not pass (the device’s answer failed it, or it went unanswered), so the device is held. Nothing more is handed to the device, on any lane, until it is released by hand (POST /api/tenants/{tenant}/devices/{endpoint}/{device}/release, ctl device release; see device.released). What the device sends is taken in as usual. The gateway emits it once per hold, never without the action’s action.result, which has the same reason and its gate_step. Endpoints cannot drop it (drop_events). The envelope’s endpoint and device are the device’s, and package is the package that built the action.

Schema id: urn:houradvantage:events:3:device.held

Fields

FieldTypeRequiredDescription
reasonstringyesWhy the device is held: the gate, its action and what the device answered (“gate step 2 (query_user) of action 7 (upsert_user) did not pass: the device answered -1 (no such user)”, or ”…: it went unanswered”).
action_idintegeryesThe id of the action whose gate did not pass.
actionstringyesWhat the action was asked for (a standard action, a package action or a command).
stepintegeryesThe gate’s place in the action, counted from 1 (as reason counts it). at least 1
command_idintegeryesThe id of the gate’s command.
commandstringyesThe gate’s command name, as the package names it.

Example

{
"reason": "gate step 2 (query_user) of action 7 (upsert_user) did not pass: the device answered -1 (no such user)",
"action_id": 7,
"action": "upsert_user",
"step": 2,
"command_id": 42,
"command": "query_user"
}

JSON Schema

device.held.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:houradvantage:events:3:device.held",
"title": "device.held: data",
"description": "The gateway's own event: a gate step of an action did not pass (the device's answer failed it, or it went unanswered), so the device is held. Nothing more is handed to the device, on any lane, until it is released by hand (POST /api/tenants/{tenant}/devices/{endpoint}/{device}/release, ctl device release; see device.released). What the device sends is taken in as usual. The gateway emits it once per hold, never without the action's action.result, which has the same reason and its gate_step. Endpoints cannot drop it (drop_events). The envelope's endpoint and device are the device's, and package is the package that built the action.",
"type": "object",
"properties": {
"reason": {
"type": "string",
"description": "Why the device is held: the gate, its action and what the device answered (\"gate step 2 (query_user) of action 7 (upsert_user) did not pass: the device answered -1 (no such user)\", or \"...: it went unanswered\")."
},
"action_id": {
"type": "integer",
"description": "The id of the action whose gate did not pass."
},
"action": {
"type": "string",
"description": "What the action was asked for (a standard action, a package action or a command)."
},
"step": {
"type": "integer",
"minimum": 1,
"description": "The gate's place in the action, counted from 1 (as reason counts it)."
},
"command_id": {
"type": "integer",
"description": "The id of the gate's command."
},
"command": {
"type": "string",
"description": "The gate's command name, as the package names it."
}
},
"required": [
"reason",
"action_id",
"action",
"step",
"command_id",
"command"
],
"examples": [
{
"reason": "gate step 2 (query_user) of action 7 (upsert_user) did not pass: the device answered -1 (no such user)",
"action_id": 7,
"action": "upsert_user",
"step": 2,
"command_id": 42,
"command": "query_user"
}
]
}