Tables
Devices
The devices table stores the list of all the devices for a certain realm and all their metadata, including the introspection, the device status and credentials information.
| Column Name | Column Type | Description |
|---|---|---|
device_id | uuid | Device unique 128 bits ID. |
aliases | map<ascii, varchar> | Alias purpose and alias map. |
introspection | map<ascii, int> | Device interface name to interface major version map based on most recent device introspection. |
introspection_minor | map<ascii, int> | Device interface name to interface minor version map based on most recent device introspection. |
old_introspection | map<frozen<tuple<ascii, int>>, int> | All previous device interfaces. This column is used to keep track of all interfaces that have been used and might still have some recorded data. The column maps interface (name, major) to minor. |
protocol_revision | int | Spoken Data Orchestrator MQTT v1 protocol revision. |
first_registration | timestamp | First registration attempt timestamp. |
credentials_secret | ascii | The bcrypt hash of the credential secret, that the device uses to obtain new credentials. |
inhibit_credentials_request | boolean | Ban device credentials renewal, device will be able to connect to the transport up to the credential expiry. |
cert_serial | ascii | Device certificate serial used by the CA. |
cert_aki | ascii | Device certificate Authority Key Identifier. |
first_credentials_request | timestamp | First credentials request timestamp. |
last_connection | timestamp | Most recent device connection event timestamp. |
last_disconnection | timestamp | Most recent device disconnection event timestamp. |
connected | boolean | True if the device is connected, otherwise is false. |
pending_empty_cache | boolean | Device is in an unclean state and an empty cache message is being waited. |
total_received_msgs | bigint | Count of received messages since the device registration. |
total_received_bytes | bigint | Amount of received messages bytes since the device registration. |
exchanged_msgs_by_interface | bigint | Count of exchanged messages since the device registration. |
exchanged_bytes_by_interface | bigint | Amount of exchanged messages bytes since the device registration. |
last_credentials_request_ip | inet | Device IP address used during the last credential request. |
last_seen_ip | inet | Most recent device IP address. |
attributes | map<varchar, varchar> | Device attributes. It can contain arbitrary string key and values associated with the device. |
groups | map<varchar, timeuuid> | Groups which the device belongs to, the key is the group name, and the value is its insertion timeuuid, which is used as part of the key on grouped_devices table. |
Endpoints
The endpoints table stores the list of all endpoints of all interfaces for realm, with all the data needed to define an endpoint, such as retention, reliability, value type and so on.
| Column Name | Column Type | Description |
|---|---|---|
interface_id | uuid | Interface unique 128 bits ID. |
endpoint_id | uuid | Endpoint unique 128 bits ID. |
interface_name | ascii | Human-readable name for interface. |
interface_major_version | int | Interface major version related to the endpoint. |
interface_minor_version | int | Interface minor version related to the endpoint. |
interface_type | int | Interface type identifier related to the endpoint. |
endpoint | ascii | Human-readable endpoint string. |
value_type | int | Value type identifier related to the endpoint. |
reliability | int | Reliability identifier related to the endpoint. |
retention | int | Retention identifier related to the endpoint. |
expiry | int | Expiry identifier related to the endpoint. |
database_retention_ttl | int | Milliseconds before data deletion. |
database_retention_policy | int | Database_retention_policy identifier related to the endpoint. |
allow_unset | boolean | Enable or disable possibility of setting value to null. |
explicit_timestamp | boolean | Set or unset explicit timestamp. |
description | varchar | Description of endpoint. |
doc | varchar | Documentation for endpoint. |
Interfaces
The interfaces table stores the list of all interfaces for realm, with all the data needed to define an endpoint, such as retention, reliability, value type and so on.
| Column Name | Column Type | Description |
|---|---|---|
interface_id | uuid | Interface unique 128 bits ID. |
name | ascii | Human-readable name for interface. |
major_version | int | Interface major version related to the endpoint. |
minor_version | int | Interface minor version related to the endpoint. |
storage_type | int | Storage type identifier related to the endpoint. |
storage | ascii | Interface storage. |
type | int | Identifies the type of this Interface. Currently two types are supported: datastream and properties. |
ownership | int | Identifies the quality of the interface. Interfaces are meant to be unidirectional, and this property defines who's sending or receiving data. |
aggregation | int | Identifies the aggregation of the mappings of the interface. |
automaton_transitions | blob | Automaton internal field. |
automaton_accepting_states | blob | Automaton internal field. |
description | varchar | Description of interface. |
doc | varchar | Documentation of interface. |