command.result
The gateway’s own event: a device answered a command. The gateway emits one for each answer to a command it still has open, as the device’s package reads it from the device’s message; a repeated answer, or one for a command the gateway does not know, gives none. A command the device asks to have sent again (“not yet”) is answered once per try, and each answer is its own event. An answer that comes after the command was reported unanswered (command.unanswered) still gives one. The envelope’s endpoint, device and package are the device’s.
Schema id: urn:houradvantage:events:3:command.result
Fields
| Field | Type | Required | Description |
|---|---|---|---|
command_id | integer | yes | The command’s id, as the action’s steps and the commands API give it. |
action | string | yes | The command’s name, as the package names it (add_user, reboot, …). |
ok | boolean | yes | The command succeeded: as the package judged it, or else whether code is one of the command’s success codes (0 unless the package says otherwise). Always false when retry_in is given. |
code | integer | yes | The device’s result code (0 when the device asked to have the command sent again). |
result | string | yes | What the device answered, as text; "" when it answered nothing or something that is not UTF-8 text (then result_base64 has it). |
result_base64 | string | What the device answered, base64, when it is not UTF-8 text (a file). Absent otherwise. | |
retry_in | integer | Seconds, 1 to 86400. The device answered “not yet”: the same command is sent again after this long, until its action expires. A command whose parameters held sensitive values cannot be sent again and fails instead. Absent for any other answer. at least 1 |
Examples
{ "command_id": 42, "action": "add_user", "ok": true, "code": 0, "result": ""}{ "command_id": 43, "action": "get_file", "ok": true, "code": 0, "result": "", "result_base64": "UEsDBBQAAAAIAA=="}JSON Schema
command.result.json
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "urn:houradvantage:events:3:command.result", "title": "command.result: data", "description": "The gateway's own event: a device answered a command. The gateway emits one for each answer to a command it still has open, as the device's package reads it from the device's message; a repeated answer, or one for a command the gateway does not know, gives none. A command the device asks to have sent again (\"not yet\") is answered once per try, and each answer is its own event. An answer that comes after the command was reported unanswered (command.unanswered) still gives one. The envelope's endpoint, device and package are the device's.", "type": "object", "properties": { "command_id": { "type": "integer", "description": "The command's id, as the action's steps and the commands API give it." }, "action": { "type": "string", "description": "The command's name, as the package names it (add_user, reboot, ...)." }, "ok": { "type": "boolean", "description": "The command succeeded: as the package judged it, or else whether code is one of the command's success codes (0 unless the package says otherwise). Always false when retry_in is given." }, "code": { "type": "integer", "description": "The device's result code (0 when the device asked to have the command sent again)." }, "result": { "type": "string", "description": "What the device answered, as text; \"\" when it answered nothing or something that is not UTF-8 text (then result_base64 has it)." }, "result_base64": { "type": "string", "description": "What the device answered, base64, when it is not UTF-8 text (a file). Absent otherwise." }, "retry_in": { "type": "integer", "minimum": 1, "description": "Seconds, 1 to 86400. The device answered \"not yet\": the same command is sent again after this long, until its action expires. A command whose parameters held sensitive values cannot be sent again and fails instead. Absent for any other answer." } }, "required": [ "command_id", "action", "ok", "code", "result" ], "examples": [ { "command_id": 42, "action": "add_user", "ok": true, "code": 0, "result": "" }, { "command_id": 43, "action": "get_file", "ok": true, "code": 0, "result": "", "result_base64": "UEsDBBQAAAAIAA==" } ]}