Skip to content

device.blocked

The gateway’s own event: a device that was allowed or waiting to be allowed was blocked (PATCH /api/tenants/{tenant}/devices/{endpoint}/{device} with status blocked, ctl device block). The gateway emits it once per block, however many requests block the device at the same moment. From then on nothing the device sends is taken in and nothing is sent to it: no reply, command, people list, PIN or template; what is queued for it waits. Connect cannot stop the device reaching the network or the MQTT broker: the operator’s own systems revoke what the device connects with (its broker credential, its client certificate, its address in a firewall) on this event. The envelope’s tenant, endpoint and device name the device (device is the device’s id), and package is its endpoint’s package. Endpoints cannot drop it (drop_events).

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

Fields

FieldTypeRequiredDescription
device_idintegeryesThe gateway’s own number for the device in its register.
was"allowed" \"pending"yes
transport"http" \"mqtt"yes
topicstring or nullyesmqtt: the topic the device publishes on, its endpoint’s topic template filled in with the values of its latest message (the device’s id at least). The broker’s ACL entry, or the credential allowed to publish there, is what to revoke. null over HTTP, or when the template has values the device has not sent yet.
reply_topicstring or nullyesmqtt: the topic the device is answered and sent commands on, filled in as topic is; null when the endpoint has no reply topic, over HTTP, or when the template has values the device has not sent yet.
remote_ipstringyesWhere the device’s latest message came from: its IP address over HTTP, “mqtt” over MQTT (the broker does not say), "" if it never called in.

Example

{
"device_id": 17,
"was": "allowed",
"transport": "mqtt",
"topic": "clocks/CK1234/up",
"reply_topic": "clocks/CK1234/down",
"remote_ip": "mqtt"
}

JSON Schema

device.blocked.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:houradvantage:events:3:device.blocked",
"title": "device.blocked: data",
"description": "The gateway's own event: a device that was allowed or waiting to be allowed was blocked (PATCH /api/tenants/{tenant}/devices/{endpoint}/{device} with status blocked, ctl device block). The gateway emits it once per block, however many requests block the device at the same moment. From then on nothing the device sends is taken in and nothing is sent to it: no reply, command, people list, PIN or template; what is queued for it waits. Connect cannot stop the device reaching the network or the MQTT broker: the operator's own systems revoke what the device connects with (its broker credential, its client certificate, its address in a firewall) on this event. The envelope's tenant, endpoint and device name the device (device is the device's id), and package is its endpoint's package. Endpoints cannot drop it (drop_events).",
"type": "object",
"properties": {
"device_id": {
"type": "integer",
"description": "The gateway's own number for the device in its register."
},
"was": {
"description": "Its status before it was blocked.",
"enum": [
"allowed",
"pending"
]
},
"transport": {
"description": "How the device reaches the gateway: its endpoint's listener type.",
"enum": [
"http",
"mqtt"
]
},
"topic": {
"type": [
"string",
"null"
],
"description": "mqtt: the topic the device publishes on, its endpoint's topic template filled in with the values of its latest message (the device's id at least). The broker's ACL entry, or the credential allowed to publish there, is what to revoke. null over HTTP, or when the template has values the device has not sent yet."
},
"reply_topic": {
"type": [
"string",
"null"
],
"description": "mqtt: the topic the device is answered and sent commands on, filled in as topic is; null when the endpoint has no reply topic, over HTTP, or when the template has values the device has not sent yet."
},
"remote_ip": {
"type": "string",
"description": "Where the device's latest message came from: its IP address over HTTP, \"mqtt\" over MQTT (the broker does not say), \"\" if it never called in."
}
},
"required": [
"device_id",
"was",
"transport",
"topic",
"reply_topic",
"remote_ip"
],
"examples": [
{
"device_id": 17,
"was": "allowed",
"transport": "mqtt",
"topic": "clocks/CK1234/up",
"reply_topic": "clocks/CK1234/down",
"remote_ip": "mqtt"
}
]
}