Download OpenAPI specification:
Kick out the gateway client
clientid required | string Client ID |
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Gateway Name |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the gateway client information
clientid required | string Client ID |
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Gateway Name |
{- "subscriptions_max": "infinity",
- "send_cnt": 1,
- "mailbox_len": 0,
- "port": 50675,
- "inflight_cnt": 0,
- "clean_start": true,
- "mqueue_max": "infinity",
- "recv_cnt": 1,
- "expiry_interval": 0,
- "mqueue_len": 0,
- "proto_ver": "1.0",
- "send_msg": 0,
- "send_pkt": 1,
- "is_bridge": false,
- "mqueue_dropped": 0,
- "awaiting_rel_cnt": 0,
- "disconnected_at": null,
- "awaiting_rel_max": "infinity",
- "heap_size": 4185,
- "keepalive": 0,
- "connected_at": "2021-12-07T10:44:02.721+08:00",
- "proto_name": "STOMP",
- "recv_oct": 56,
- "clientid": "MzAyMzEzNTUwNzk1NDA1MzYyMzIwNzUxNjQwMTY1NzQ0NjE",
- "send_oct": 61,
- "connected": true,
- "recv_msg": 0,
- "recv_pkt": 1,
- "inflight_max": "infinity",
- "subscriptions_cnt": 0,
- "username": "guest",
- "node": "emqx@127.0.0.1",
- "reductions": 72022,
- "created_at": "2021-12-07T10:44:02.721+08:00",
- "ip_address": "127.0.0.1"
}
Get the gateway client subscriptions
clientid required | string Client ID |
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Gateway Name |
[- {
- "nl": 0,
- "qos": 1,
- "rap": 0,
- "rh": 0,
- "topic": "test/topic"
}
]
Create a subscription membership
clientid required | string Client ID |
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Gateway Name |
nl | integer No Local option, enum: 0, 1 |
qos | integer QoS level, enum: 0, 1, 2 |
rap | integer Retain as Published option, enum: 0, 1 |
rh | integer Retain Handling option, enum: 0, 1, 2 |
object (emqx_gateway_api_clients.extra_sub_props) | |
topic | string Topic Filter/Name |
{- "nl": 0,
- "qos": 1,
- "rap": 0,
- "rh": 0,
- "topic": "test/topic"
}
{- "nl": 0,
- "qos": 1,
- "rap": 0,
- "rh": 0,
- "topic": "test/topic"
}
Get the gateway client list
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Gateway Name |
node | string Match the client's node name |
clientid | string Match the client's ID |
username | string Match the client's Username |
ip_address | string Match the client's ip address |
conn_state | string Match the client's connection state |
proto_ver | string Match the client's protocol version |
clean_start | boolean Match the client's clean start flag |
like_clientid | string Use sub-string to match client's ID |
like_username | string Use sub-string to match client's username |
integer or string Match the session created datetime greater than a certain value | |
integer or string Match the session created datetime less than a certain value | |
integer or string Match the client socket connected datetime greater than a certain value | |
integer or string Match the client socket connected datatime less than a certain value | |
endpoint_name | string Match the lwm2m client's endpoint name |
like_endpoint_name | string Use sub-string to match lwm2m client's endpoint name |
gte_lifetime | string Match the lwm2m client registered lifetime greater than a certain value |
lte_lifetime | string Match the lwm2m client registered lifetime less than a certain value |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "subscriptions_max": 0,
- "send_cnt": 0,
- "mailbox_len": 0,
- "port": 0,
- "inflight_cnt": 0,
- "clean_start": true,
- "mqueue_max": 0,
- "recv_cnt": 0,
- "expiry_interval": 0,
- "mqueue_len": 0,
- "proto_ver": "string",
- "send_msg": 0,
- "send_pkt": 0,
- "is_bridge": true,
- "mqueue_dropped": 0,
- "awaiting_rel_cnt": 0,
- "disconnected_at": 1640995200000,
- "awaiting_rel_max": 0,
- "heap_size": 0,
- "keepalive": 0,
- "connected_at": 1640995200000,
- "proto_name": "string",
- "recv_oct": 0,
- "clientid": "string",
- "send_oct": 0,
- "connected": true,
- "recv_msg": 0,
- "mountpoint": "string",
- "recv_pkt": 0,
- "inflight_max": 0,
- "subscriptions_cnt": 0,
- "username": "string",
- "node": "string",
- "reductions": 0,
- "created_at": 1640995200000,
- "ip_address": "string"
}
], - "meta": {
- "count": 0,
- "hasnext": true,
- "limit": 50,
- "page": 1
}
}
Delete a subscriptions membership
topic required | string Topic Filter/Name |
clientid required | string Client ID |
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Gateway Name |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get a cluster link metrics
name required | string Example: my_link |
{- "metrics": {
- "routes": 10240
}, - "node_metrics": [
- {
- "metrics": {
- "routes": 10240
}, - "node": "emqx1@emqx.net"
}
]
}
Get cluster links configuration
[- {
- "enable": true,
- "name": "emqxcl_b",
- "node_status": [
- {
- "node": "emqx1@emqx.net",
- "status": "connected"
}
], - "pool_size": 10,
- "server": "emqxcl_b.host:1883",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "topics": [
- "t/topic-example",
- "t/topic-filter-example/1/#"
]
}, - {
- "enable": true,
- "name": "emqxcl_c",
- "node_status": [
- {
- "node": "emqx1@emqx.net",
- "status": "connected"
}
], - "pool_size": 10,
- "server": "emqxcl_c.host:1883",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "topics": [
- "t/topic-example",
- "t/topic-filter-example/1/#"
]
}
]
Create a cluster link
clientid | string Optional Base MQTT client ID for connecting to the remote EMQX cluster. If omitted, local |
enable | boolean Default: true Enable or disable a cluster link. The link is enabled by default, disabling it allows stopping the link without removing its configuration. The link must be enabled on both sides to be operational. Disabling the link should also be done on both clusters in order to free up all associated resources. |
max_inflight | integer >= 0 Default: 32 Max inflight (sent, but un-acked) messages of the MQTT protocol |
name required | string Linked (remote) cluster name. Must be exactly equal to the value of |
password | string <password> Optional MQTT username for connecting to the remote EMQX cluster. |
pool_size | integer >= 1 Default: 8 Size of the pool of MQTT clients that will publish messages to the linked EMQX broker. |
object (cluster.creation_opts) | |
retry_interval | string Default: "15s" MQTT Message retry interval. Delay for the link to retry sending the QoS1/QoS2 messages in case of ACK not received. Time interval is a string that contains a number followed by time unit: |
server required | string MQTT host and port of the remote EMQX broker. |
object (emqx.ssl_client_opts) | |
topics required | Array of strings MQTT topics to be forwarded by the linked remote EMQX broker to the local broker. Messages are only forwarded if the local EMQX broker has matching subscriber(s). |
username | string Optional MQTT username for connecting to the remote EMQX cluster. |
{- "enable": true,
- "name": "emqxcl_b",
- "pool_size": 10,
- "server": "emqxcl_b.host:1883",
- "ssl": {
- "enable": false
}, - "topics": [
- "t/topic-example",
- "t/topic-filter-example/1/#"
]
}
{- "enable": true,
- "name": "emqxcl_b",
- "node_status": [
- {
- "node": "emqx1@emqx.net",
- "status": "connected"
}
], - "pool_size": 10,
- "server": "emqxcl_b.host:1883",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "topics": [
- "t/topic-example",
- "t/topic-filter-example/1/#"
]
}
Send a join invitation to a node to join the cluster but do not wait for the join result. Join status can be retrieved with GET api/<version>/invitation
node required | string Example: emqx2@127.0.0.1 |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Invite node to cluster
node required | string Example: emqx2@127.0.0.1 |
timeout | integer >= 0 Timeout in milliseconds |
{- "timeout": "15000"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get a cluster link configuration
name required | string Example: my_link |
{- "enable": true,
- "name": "emqxcl_b",
- "node_status": [
- {
- "node": "emqx1@emqx.net",
- "status": "connected"
}
], - "pool_size": 10,
- "server": "emqxcl_b.host:1883",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "topics": [
- "t/topic-example",
- "t/topic-filter-example/1/#"
]
}
Update a cluster link configuration
name required | string Example: my_link |
clientid | string Optional Base MQTT client ID for connecting to the remote EMQX cluster. If omitted, local |
enable | boolean Default: true Enable or disable a cluster link. The link is enabled by default, disabling it allows stopping the link without removing its configuration. The link must be enabled on both sides to be operational. Disabling the link should also be done on both clusters in order to free up all associated resources. |
max_inflight | integer >= 0 Default: 32 Max inflight (sent, but un-acked) messages of the MQTT protocol |
password | string <password> Optional MQTT username for connecting to the remote EMQX cluster. |
pool_size | integer >= 1 Default: 8 Size of the pool of MQTT clients that will publish messages to the linked EMQX broker. |
object (cluster.creation_opts) | |
retry_interval | string Default: "15s" MQTT Message retry interval. Delay for the link to retry sending the QoS1/QoS2 messages in case of ACK not received. Time interval is a string that contains a number followed by time unit: |
server required | string MQTT host and port of the remote EMQX broker. |
object (emqx.ssl_client_opts) | |
topics required | Array of strings MQTT topics to be forwarded by the linked remote EMQX broker to the local broker. Messages are only forwarded if the local EMQX broker has matching subscriber(s). |
username | string Optional MQTT username for connecting to the remote EMQX cluster. |
{- "clientid": "string",
- "enable": true,
- "max_inflight": 32,
- "password": "R4ND0M/S∃CЯ∃T",
- "pool_size": 8,
- "resource_opts": {
- "auto_restart_interval": "15s",
- "enable_queue": false,
- "health_check_interval": "32s",
- "inflight_window": 100,
- "max_buffer_bytes": "32MB",
- "request_ttl": "45s",
- "start_timeout": "32s",
- "worker_pool_size": 16
}, - "retry_interval": "15s",
- "server": "string",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}, - "topics": [
- "string"
], - "username": "string"
}
{- "enable": true,
- "name": "emqxcl_b",
- "node_status": [
- {
- "node": "emqx1@emqx.net",
- "status": "connected"
}
], - "pool_size": 10,
- "server": "emqxcl_b.host:1883",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "topics": [
- "t/topic-example",
- "t/topic-filter-example/1/#"
]
}
Get RLOG cluster topology: connections between core and replicant nodes.
[- {
- "core_node": "emqx-core@127.0.0.1",
- "replicant_nodes": [
- {
- "node": "emqx-replicant@127.0.0.2",
- "streams": "10"
}
]
}
]
Get the execution status of all asynchronous invite status per node
{- "failed": [
- {
- "finished_at": "2024-01-30T15:24:39.355+08:00",
- "node": "emqx2@127.0.0.1",
- "reason": "Bad RPC to target node",
- "started_at": "2024-01-30T15:24:39.355+08:00"
}
], - "in_progress": [
- {
- "node": "emqx2@127.0.0.1",
- "started_at": "2024-01-30T15:24:39.355+08:00"
}
], - "succeed": [
- {
- "finished_at": "2024-01-30T15:24:39.355+08:00",
- "node": "emqx2@127.0.0.1",
- "started_at": "2024-01-30T15:24:39.355+08:00"
}
]
}
Delete MFA state for a dashboard user.
After the state is deleted, the user will have MFA explicitly disabled, to re-enabled MFA, call the POST
method.
username required | string Example: admin Dashboard Username |
{- "code": "USER_NOT_FOUND",
- "message": "string"
}
Setup MFA for a dashboard user.
username required | string Example: admin Dashboard Username |
mechanism required | string Value: "totp" Multifactor authentication mechanism. |
{- "mechanism": "totp"
}
{- "code": "USER_NOT_FOUND",
- "message": "string"
}
Get Dashboard Auth Token.
mfa_token | string <= 9 characters Multifactor authentication token. |
password | string <= 100 characters Dashboard Password |
username | string <= 100 characters Dashboard Username |
{- "mfa_token": "023123",
- "password": "public",
- "username": "admin"
}
{- "license": {
- "edition": "opensource"
}, - "password_expire_in_seconds": 3600,
- "role": "administrator",
- "token": "string",
- "version": "5.0.0"
}
Change dashboard user password
username required | string Example: admin Dashboard Username |
new_pwd | string New password |
old_pwd | string Old password |
{- "new_pwd": "string",
- "old_pwd": "string"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Delete dashboard user
username required | string Example: admin Dashboard Username |
backend | string Enum: "local" "ldap" "oidc" "saml" Example: backend=local |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Update dashboard user description
username required | string Example: admin Dashboard Username |
backend | string Enum: "local" "ldap" "oidc" "saml" Example: backend=local |
description | string Dashboard User Description |
role | string Default: "administrator" User role |
{- "description": "administrator",
- "role": "administrator"
}
{- "backend": "local",
- "description": "administrator",
- "mfa": "totp",
- "role": "administrator",
- "username": "admin"
}
Dashboard user logout.
This endpoint is only for the Dashboard, not the API Key
.
The token from the /login
endpoint must be a bearer authorization in the headers.
backend | string Enum: "local" "ldap" "oidc" "saml" Example: backend=local |
username | string <= 100 characters Dashboard Username |
{- "username": "admin"
}
{- "code": "BAD_USERNAME_OR_PWD",
- "message": "string"
}
Create dashboard user
description | string Dashboard User Description |
password | string <= 100 characters Dashboard Password |
role | string Default: "administrator" User role |
username | string <= 100 characters Dashboard Username |
{- "description": "administrator",
- "password": "public",
- "role": "administrator",
- "username": "admin"
}
{- "backend": "local",
- "description": "administrator",
- "role": "administrator",
- "username": "admin"
}
Get the MQTT-related configuration
{- "durable_sessions": {
- "batch_size": 100,
- "enable": false,
- "heartbeat_interval": "12m",
- "idle_poll_interval": "12m",
- "message_retention_period": "12m",
- "session_gc_batch_size": 100,
- "session_gc_interval": "12m"
}, - "flapping_detect": {
- "ban_time": "12m",
- "enable": false,
- "max_count": 15,
- "window_time": "12m"
}, - "force_gc": {
- "bytes": "32MB",
- "count": 16000,
- "enable": true
}, - "force_shutdown": {
- "enable": true,
- "max_heap_size": "1024KB",
- "max_mailbox_size": 1000
}, - "mqtt": {
- "ignore_loop_deliver": false,
- "max_topic_alias": 65535,
- "peer_cert_as_username": "disabled",
- "max_topic_levels": 128,
- "peer_cert_as_clientid": "disabled",
- "max_subscriptions": "infinity",
- "retain_available": true,
- "max_awaiting_rel": 100,
- "max_clientid_len": 65535,
- "idle_timeout": "15s",
- "max_mqueue_len": 1000,
- "max_qos_allowed": 0,
- "wildcard_subscription": true,
- "mqueue_store_qos0": true,
- "max_inflight": 32,
- "session_expiry_interval": "12m",
- "keepalive_check_interval": "12m",
- "strict_mode": false,
- "mqueue_default_priority": "highest",
- "message_expiry_interval": "infinity",
- "mqueue_priorities": "disabled",
- "retry_interval": "infinity",
- "client_attrs_init": [ ],
- "server_keepalive": "disabled",
- "shared_subscription_initial_sticky_pick": "random",
- "clientid_override": "disabled",
- "upgrade_qos": false,
- "shared_subscription_strategy": "random",
- "limiter": {
- "bytes_burst": "string",
- "bytes_rate": "string",
- "max_conn_burst": "string",
- "max_conn_rate": "string",
- "messages_burst": "string",
- "messages_rate": "string"
}, - "max_packet_size": "32MB",
- "keepalive_multiplier": 1.5,
- "await_rel_timeout": "12m",
- "use_username_as_clientid": false,
- "exclusive_subscription": false,
- "response_information": "",
- "shared_subscription": true
}
}
Update MQTT-related configuration
object (emqx.durable_sessions) | |
object (emqx.flapping_detect) | |
object (emqx.force_gc) | |
object (emqx.force_shutdown) | |
object (emqx.mqtt) |
{- "durable_sessions": {
- "batch_size": 100,
- "enable": false,
- "heartbeat_interval": "12m",
- "idle_poll_interval": "12m",
- "message_retention_period": "12m",
- "session_gc_batch_size": 100,
- "session_gc_interval": "12m"
}, - "flapping_detect": {
- "ban_time": "12m",
- "enable": false,
- "max_count": 15,
- "window_time": "12m"
}, - "force_gc": {
- "bytes": "32MB",
- "count": 16000,
- "enable": true
}, - "force_shutdown": {
- "enable": true,
- "max_heap_size": "1024KB",
- "max_mailbox_size": 1000
}, - "mqtt": {
- "ignore_loop_deliver": false,
- "max_topic_alias": 65535,
- "peer_cert_as_username": "disabled",
- "max_topic_levels": 128,
- "peer_cert_as_clientid": "disabled",
- "max_subscriptions": "infinity",
- "retain_available": true,
- "max_awaiting_rel": 100,
- "max_clientid_len": 65535,
- "idle_timeout": "15s",
- "max_mqueue_len": 1000,
- "max_qos_allowed": 0,
- "wildcard_subscription": true,
- "mqueue_store_qos0": true,
- "max_inflight": 32,
- "session_expiry_interval": "12m",
- "keepalive_check_interval": "12m",
- "strict_mode": false,
- "mqueue_default_priority": "highest",
- "message_expiry_interval": "infinity",
- "mqueue_priorities": "disabled",
- "retry_interval": "infinity",
- "client_attrs_init": [ ],
- "server_keepalive": "disabled",
- "shared_subscription_initial_sticky_pick": "random",
- "clientid_override": "disabled",
- "upgrade_qos": false,
- "shared_subscription_strategy": "random",
- "limiter": {
- "bytes_burst": "string",
- "bytes_rate": "string",
- "max_conn_burst": "string",
- "max_conn_rate": "string",
- "messages_burst": "string",
- "messages_rate": "string"
}, - "max_packet_size": "32MB",
- "keepalive_multiplier": 1.5,
- "await_rel_timeout": "12m",
- "use_username_as_clientid": false,
- "exclusive_subscription": false,
- "response_information": "",
- "shared_subscription": true
}
}
{- "durable_sessions": {
- "batch_size": 100,
- "enable": false,
- "heartbeat_interval": "12m",
- "idle_poll_interval": "12m",
- "message_retention_period": "12m",
- "session_gc_batch_size": 100,
- "session_gc_interval": "12m"
}, - "flapping_detect": {
- "ban_time": "12m",
- "enable": false,
- "max_count": 15,
- "window_time": "12m"
}, - "force_gc": {
- "bytes": "32MB",
- "count": 16000,
- "enable": true
}, - "force_shutdown": {
- "enable": true,
- "max_heap_size": "1024KB",
- "max_mailbox_size": 1000
}, - "mqtt": {
- "ignore_loop_deliver": false,
- "max_topic_alias": 65535,
- "peer_cert_as_username": "disabled",
- "max_topic_levels": 128,
- "peer_cert_as_clientid": "disabled",
- "max_subscriptions": "infinity",
- "retain_available": true,
- "max_awaiting_rel": 100,
- "max_clientid_len": 65535,
- "idle_timeout": "15s",
- "max_mqueue_len": 1000,
- "max_qos_allowed": 0,
- "wildcard_subscription": true,
- "mqueue_store_qos0": true,
- "max_inflight": 32,
- "session_expiry_interval": "12m",
- "keepalive_check_interval": "12m",
- "strict_mode": false,
- "mqueue_default_priority": "highest",
- "message_expiry_interval": "infinity",
- "mqueue_priorities": "disabled",
- "retry_interval": "infinity",
- "client_attrs_init": [ ],
- "server_keepalive": "disabled",
- "shared_subscription_initial_sticky_pick": "random",
- "clientid_override": "disabled",
- "upgrade_qos": false,
- "shared_subscription_strategy": "random",
- "limiter": {
- "bytes_burst": "string",
- "bytes_rate": "string",
- "max_conn_burst": "string",
- "max_conn_rate": "string",
- "messages_burst": "string",
- "messages_rate": "string"
}, - "max_packet_size": "32MB",
- "keepalive_multiplier": 1.5,
- "await_rel_timeout": "12m",
- "use_username_as_clientid": false,
- "exclusive_subscription": false,
- "response_information": "",
- "shared_subscription": true
}
}
Get the sub-configurations under sys_topics
{- "sys_event_messages": {
- "client_connected": true,
- "client_disconnected": true,
- "client_subscribed": false,
- "client_unsubscribed": false
}, - "sys_heartbeat_interval": "30s",
- "sys_msg_interval": "1m"
}
Update the sub-configurations under sys_topics
object (emqx.event_names) | |
string or string Default: "30s" Time interval for publishing following heartbeat messages: | |
string or string Default: "1m" Time interval for publishing following system messages: |
{- "sys_event_messages": {
- "client_connected": true,
- "client_disconnected": true,
- "client_subscribed": false,
- "client_unsubscribed": false
}, - "sys_heartbeat_interval": "30s",
- "sys_msg_interval": "1m"
}
{- "sys_event_messages": {
- "client_connected": true,
- "client_disconnected": true,
- "client_subscribed": false,
- "client_unsubscribed": false
}, - "sys_heartbeat_interval": "30s",
- "sys_msg_interval": "1m"
}
Get all the configurations of the specified keys, including hot and non-hot updatable items.
key | string Enum: "actions" "alarm" "api_key" "authentication" "authentication_settings" "authorization" "auto_subscribe" "banned" "bridges" "cluster" "config_backup_interval" "conn_congestion" "connectors" "crl_cache" "dashboard" "delayed" "durable_queues" "durable_sessions" "durable_storage" "exhook" "file_transfer" "flapping_detect" "force_gc" "force_shutdown" "gateway" "license" "listeners" "log" "message_transformation" "mqtt" "multi_tenancy" "node" "opentelemetry" "overload_protection" "prometheus" "psk_authentication" "retainer" "rewrite" "rpc" "rule_engine" "schema_registry" "schema_validation" "slow_subs" "sources" "sys_topics" "sysmon" "telemetry" "topic_metrics" Example: key=sysmon |
node | string Node's name. Will deprecated in 5.2.0. |
{- "deprecated": true
}
Update the configurations of the specified keys.
mode | string Default: "merge" Enum: "replace" "merge" |
ignore_readonly | boolean Default: false |
{- "code": "UPDATE_FAILED",
- "message": "string"
}
Get the sub-configurations under log
{- "audit": {
- "enable": false,
- "ignore_high_frequency_request": true,
- "max_filter_size": 5000,
- "path": "${EMQX_LOG_DIR}/audit.log",
- "payload_encode": "hex",
- "rotation_count": 10,
- "rotation_size": "50MB",
- "time_offset": "system",
- "timestamp_format": "auto"
}, - "console": {
- "enable": true,
- "formatter": "text",
- "level": "debug",
- "payload_encode": "hex",
- "time_offset": "system",
- "timestamp_format": "auto"
}, - "file": {
- "level": "warning"
}, - "throttling": {
- "time_window": "1h"
}
}
Update the sub-configurations under log
object (emqx.log_audit_handler) | |
object (emqx.console_handler) | |
object or emqx.log_file_handler (object) Default: {"level":"warning"} File-based log handlers. | |
object (emqx.log_throttling) |
{- "audit": {
- "enable": false,
- "ignore_high_frequency_request": true,
- "max_filter_size": 5000,
- "path": "${EMQX_LOG_DIR}/audit.log",
- "payload_encode": "hex",
- "rotation_count": 10,
- "rotation_size": "50MB",
- "time_offset": "system",
- "timestamp_format": "auto"
}, - "console": {
- "enable": true,
- "formatter": "text",
- "level": "debug",
- "payload_encode": "hex",
- "time_offset": "system",
- "timestamp_format": "auto"
}, - "file": {
- "level": "warning"
}, - "throttling": {
- "time_window": "1h"
}
}
{- "audit": {
- "enable": false,
- "ignore_high_frequency_request": true,
- "max_filter_size": 5000,
- "path": "${EMQX_LOG_DIR}/audit.log",
- "payload_encode": "hex",
- "rotation_count": 10,
- "rotation_size": "50MB",
- "time_offset": "system",
- "timestamp_format": "auto"
}, - "console": {
- "enable": true,
- "formatter": "text",
- "level": "debug",
- "payload_encode": "hex",
- "time_offset": "system",
- "timestamp_format": "auto"
}, - "file": {
- "level": "warning"
}, - "throttling": {
- "time_window": "1h"
}
}
Get the sub-configurations under sysmon
{- "broker_pool_mailbox_size_alarm_threshold": 500,
- "mnesia_tm_mailbox_size_alarm_threshold": 500,
- "os": {
- "cpu_check_interval": "12m",
- "cpu_high_watermark": "12%",
- "cpu_low_watermark": "12%",
- "mem_check_interval": "60s",
- "procmem_high_watermark": "12%",
- "sysmem_high_watermark": "12%"
}, - "vm": {
- "busy_dist_port": true,
- "busy_port": true,
- "large_heap": "32MB",
- "long_gc": "disabled",
- "long_schedule": "240ms",
- "process_check_interval": "12m",
- "process_high_watermark": "12%",
- "process_low_watermark": "12%"
}
}
Update the sub-configurations under sysmon
broker_pool_mailbox_size_alarm_threshold | integer >= 1 Default: 500 The threshold above which an alarm is raised for the maximum mailbox size among the broker pool workers. Broker pool workers handle adding and removing subscriptions, and replication of routing information. |
mnesia_tm_mailbox_size_alarm_threshold | integer >= 1 Default: 500 The threshold above which an alarm is raised for the mailbox size of the mnesia transaction manager. This process handles all transactions in EMQX's internal database mnesia. |
object (emqx.sysmon_os) | |
object (emqx.sysmon_vm) |
{- "broker_pool_mailbox_size_alarm_threshold": 500,
- "mnesia_tm_mailbox_size_alarm_threshold": 500,
- "os": {
- "cpu_check_interval": "12m",
- "cpu_high_watermark": "12%",
- "cpu_low_watermark": "12%",
- "mem_check_interval": "60s",
- "procmem_high_watermark": "12%",
- "sysmem_high_watermark": "12%"
}, - "vm": {
- "busy_dist_port": true,
- "busy_port": true,
- "large_heap": "32MB",
- "long_gc": "disabled",
- "long_schedule": "240ms",
- "process_check_interval": "12m",
- "process_high_watermark": "12%",
- "process_low_watermark": "12%"
}
}
{- "broker_pool_mailbox_size_alarm_threshold": 500,
- "mnesia_tm_mailbox_size_alarm_threshold": 500,
- "os": {
- "cpu_check_interval": "12m",
- "cpu_high_watermark": "12%",
- "cpu_low_watermark": "12%",
- "mem_check_interval": "60s",
- "procmem_high_watermark": "12%",
- "sysmem_high_watermark": "12%"
}, - "vm": {
- "busy_dist_port": true,
- "busy_port": true,
- "large_heap": "32MB",
- "long_gc": "disabled",
- "long_schedule": "240ms",
- "process_check_interval": "12m",
- "process_high_watermark": "12%",
- "process_low_watermark": "12%"
}
}
Reset the config entry specified by the query string parameter conf_path
.
- For a config entry that has default value, this resets it to the default value;
- For a config entry that has no default value, an error 400 will be returned
rootname required | string Enum: "file_transfer" "broker" "log" "sysmon" "sys_topics" "alarm" "dashboard" Example: sysmon |
conf_path | string Example: conf_path=os.sysmem_high_watermark The config path separated by '.' character |
{- "code": "NO_DEFAULT_VALUE",
- "message": "string"
}
Update the sub-configurations under broker
enable_session_registry | boolean Default: true The Global Session Registry is a cluster-wide mechanism designed to maintain the uniqueness of client IDs within the cluster. |
session_history_retain | string Default: "0s" The duration to retain the session registration history. Setting this to a value greater than |
{- "enable_session_registry": true,
- "session_history_retain": "1h"
}
{- "enable_session_registry": true,
- "session_history_retain": "1h"
}
Update the sub-configurations under alarm
actions | Array of strings Default: ["log","publish"] Items Enum: "log" "publish" The actions triggered when the alarm is activated. |
size_limit | integer [ 1 .. 3000 ] Default: 1000 The maximum number of historical alarms that can be stored. |
validity_period | string Default: "24h" The validity period of historical alarms. Calculated from the time of activation of the historical alarm instead of the time of cancelation. |
{- "actions": [
- "log",
- "publish"
], - "size_limit": 1000,
- "validity_period": "24h"
}
{- "actions": [
- "log",
- "publish"
], - "size_limit": 1000,
- "validity_period": "24h"
}
Get the sub-configurations under file_transfer
{- "assemble_timeout": "32s",
- "enable": false,
- "init_timeout": "32s",
- "storage": {
- "local": {
- "enable": true,
- "exporter": {
- "local": {
- "enable": true,
- "root": "string"
}, - "s3": {
- "access_key_id": "string",
- "access_method": "path",
- "acl": "private",
- "bucket": "string",
- "enable": true,
- "host": "string",
- "max_part_size": "32MB",
- "min_part_size": "32MB",
- "port": 1,
- "secret_access_key": "R4ND0M/S∃CЯ∃T",
- "transport_options": {
- "connect_timeout": "32s",
- "enable_pipelining": 0,
- "headers": { },
- "ipv6_probe": false,
- "max_retries": 0,
- "pool_size": 8,
- "request_timeout": "32s",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}
}, - "url_expire_time": "1h"
}
}, - "segments": {
- "gc": {
- "interval": "32s",
- "maximum_segments_ttl": "1h",
- "minimum_segments_ttl": "1h"
}, - "root": "string"
}
}
}, - "store_segment_timeout": "32s"
}
Update the sub-configurations under file_transfer
assemble_timeout | string Default: "5m" Timeout for assembling and exporting file segments into a final file. |
enable | boolean Default: false Enable the File Transfer feature. |
init_timeout | string Default: "10s" Timeout for EMQX to initialize the file transfer. |
object (file_transfer.storage_backend) | |
store_segment_timeout | string Default: "5m" Timeout for storing a file segment. |
{- "assemble_timeout": "32s",
- "enable": false,
- "init_timeout": "32s",
- "storage": {
- "local": {
- "enable": true,
- "exporter": {
- "local": {
- "enable": true,
- "root": "string"
}, - "s3": {
- "access_key_id": "string",
- "access_method": "path",
- "acl": "private",
- "bucket": "string",
- "enable": true,
- "host": "string",
- "max_part_size": "32MB",
- "min_part_size": "32MB",
- "port": 1,
- "secret_access_key": "R4ND0M/S∃CЯ∃T",
- "transport_options": {
- "connect_timeout": "32s",
- "enable_pipelining": 0,
- "headers": { },
- "ipv6_probe": false,
- "max_retries": 0,
- "pool_size": 8,
- "request_timeout": "32s",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}
}, - "url_expire_time": "1h"
}
}, - "segments": {
- "gc": {
- "interval": "32s",
- "maximum_segments_ttl": "1h",
- "minimum_segments_ttl": "1h"
}, - "root": "string"
}
}
}, - "store_segment_timeout": "32s"
}
{- "assemble_timeout": "32s",
- "enable": false,
- "init_timeout": "32s",
- "storage": {
- "local": {
- "enable": true,
- "exporter": {
- "local": {
- "enable": true,
- "root": "string"
}, - "s3": {
- "access_key_id": "string",
- "access_method": "path",
- "acl": "private",
- "bucket": "string",
- "enable": true,
- "host": "string",
- "max_part_size": "32MB",
- "min_part_size": "32MB",
- "port": 1,
- "secret_access_key": "R4ND0M/S∃CЯ∃T",
- "transport_options": {
- "connect_timeout": "32s",
- "enable_pipelining": 0,
- "headers": { },
- "ipv6_probe": false,
- "max_retries": 0,
- "pool_size": 8,
- "request_timeout": "32s",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}
}, - "url_expire_time": "1h"
}
}, - "segments": {
- "gc": {
- "interval": "32s",
- "maximum_segments_ttl": "1h",
- "minimum_segments_ttl": "1h"
}, - "root": "string"
}
}
}, - "store_segment_timeout": "32s"
}
Get the sub-configurations under dashboard
{- "cors": false,
- "default_mfa": "none",
- "default_password": "R4ND0M/S∃CЯ∃T",
- "hwmark_expire_time": "12m",
- "listeners": {
- "http": {
- "backlog": 1024,
- "bind": "0.0.0.0:18083",
- "inet6": false,
- "ipv6_v6only": false,
- "max_connections": 512,
- "num_acceptors": 4,
- "proxy_header": false,
- "send_timeout": "12m"
}, - "https": {
- "backlog": 1024,
- "bind": "0.0.0.0:18084",
- "inet6": false,
- "ipv6_v6only": false,
- "max_connections": 512,
- "num_acceptors": 4,
- "proxy_header": false,
- "send_timeout": "12m",
- "ssl_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "cacerts": false,
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "ciphers": [ ],
- "client_renegotiation": true,
- "depth": 10,
- "dhfile": "string",
- "fail_if_no_peer_cert": false,
- "handshake_timeout": "12m",
- "hibernate_after": "12m",
- "honor_cipher_order": true,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}
}
}, - "password_expired_time": "1h",
- "sso": {
- "ldap": {
- "backend": "ldap",
- "base_dn": "string",
- "enable": false,
- "filter": "(& (objectClass=person) (uid=${username}))",
- "password": "R4ND0M/S∃CЯ∃T",
- "pool_size": 8,
- "query_timeout": "32s",
- "request_timeout": "32s",
- "server": "string",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}, - "username": "string"
}, - "oidc": {
- "backend": "oidc",
- "client_jwks": "none",
- "clientid": "string",
- "enable": false,
- "fallback_methods": [
- "RS256"
], - "name_var": "${sub}",
- "preferred_auth_methods": [
- "client_secret_post",
- "client_secret_basic",
- "none"
], - "provider": "okta",
- "require_pkce": false,
- "scopes": [
- "openid"
], - "secret": "R4ND0M/S∃CЯ∃T",
- "session_expiry": "1h"
}, - "saml": {
- "backend": "saml",
- "enable": false,
- "sp_private_key": "pa$$word",
- "sp_public_key": "Pub Key",
- "sp_sign_request": false
}
}, - "swagger_support": true,
- "token_expired_time": "12m"
}
Update the sub-configurations under dashboard
cors | boolean Default: false Support Cross-Origin Resource Sharing (CORS). |
dashboard.mfa_settings (object) or string Default: "none" Default Multifactor authentication settings for Dashboard. | |
hwmark_expire_time | string Default: "7d" Specifies the expiration interval for high watermark metrics, such as the session history high watermark ( |
object (dashboard.listeners) | |
password_expired_time | string Default: 0 The expiration time for the password of users. The default value |
object (dashboard.sso) | |
swagger_support | boolean Default: true Enable or disable support for swagger API documentation. |
token_expired_time | string Default: "60m" JWT token expiration time. Default is 60 minutes |
{- "cors": false,
- "default_mfa": "none",
- "hwmark_expire_time": "12m",
- "listeners": {
- "http": {
- "backlog": 1024,
- "bind": "0.0.0.0:18083",
- "inet6": false,
- "ipv6_v6only": false,
- "max_connections": 512,
- "num_acceptors": 4,
- "proxy_header": false,
- "send_timeout": "12m"
}, - "https": {
- "backlog": 1024,
- "bind": "0.0.0.0:18084",
- "inet6": false,
- "ipv6_v6only": false,
- "max_connections": 512,
- "num_acceptors": 4,
- "proxy_header": false,
- "send_timeout": "12m",
- "ssl_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "cacerts": false,
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "ciphers": [ ],
- "client_renegotiation": true,
- "depth": 10,
- "dhfile": "string",
- "fail_if_no_peer_cert": false,
- "handshake_timeout": "12m",
- "hibernate_after": "12m",
- "honor_cipher_order": true,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}
}
}, - "password_expired_time": "1h",
- "sso": {
- "ldap": {
- "backend": "ldap",
- "base_dn": "string",
- "enable": false,
- "filter": "(& (objectClass=person) (uid=${username}))",
- "password": "R4ND0M/S∃CЯ∃T",
- "pool_size": 8,
- "query_timeout": "32s",
- "request_timeout": "32s",
- "server": "string",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}, - "username": "string"
}, - "oidc": {
- "backend": "oidc",
- "client_jwks": "none",
- "clientid": "string",
- "enable": false,
- "fallback_methods": [
- "RS256"
], - "name_var": "${sub}",
- "preferred_auth_methods": [
- "client_secret_post",
- "client_secret_basic",
- "none"
], - "provider": "okta",
- "require_pkce": false,
- "scopes": [
- "openid"
], - "secret": "R4ND0M/S∃CЯ∃T",
- "session_expiry": "1h"
}, - "saml": {
- "backend": "saml",
- "enable": false,
- "sp_private_key": "pa$$word",
- "sp_public_key": "Pub Key",
- "sp_sign_request": false
}
}, - "swagger_support": true,
- "token_expired_time": "12m"
}
{- "cors": false,
- "default_mfa": "none",
- "default_password": "R4ND0M/S∃CЯ∃T",
- "hwmark_expire_time": "12m",
- "listeners": {
- "http": {
- "backlog": 1024,
- "bind": "0.0.0.0:18083",
- "inet6": false,
- "ipv6_v6only": false,
- "max_connections": 512,
- "num_acceptors": 4,
- "proxy_header": false,
- "send_timeout": "12m"
}, - "https": {
- "backlog": 1024,
- "bind": "0.0.0.0:18084",
- "inet6": false,
- "ipv6_v6only": false,
- "max_connections": 512,
- "num_acceptors": 4,
- "proxy_header": false,
- "send_timeout": "12m",
- "ssl_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "cacerts": false,
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "ciphers": [ ],
- "client_renegotiation": true,
- "depth": 10,
- "dhfile": "string",
- "fail_if_no_peer_cert": false,
- "handshake_timeout": "12m",
- "hibernate_after": "12m",
- "honor_cipher_order": true,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}
}
}, - "password_expired_time": "1h",
- "sso": {
- "ldap": {
- "backend": "ldap",
- "base_dn": "string",
- "enable": false,
- "filter": "(& (objectClass=person) (uid=${username}))",
- "password": "R4ND0M/S∃CЯ∃T",
- "pool_size": 8,
- "query_timeout": "32s",
- "request_timeout": "32s",
- "server": "string",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}, - "username": "string"
}, - "oidc": {
- "backend": "oidc",
- "client_jwks": "none",
- "clientid": "string",
- "enable": false,
- "fallback_methods": [
- "RS256"
], - "name_var": "${sub}",
- "preferred_auth_methods": [
- "client_secret_post",
- "client_secret_basic",
- "none"
], - "provider": "okta",
- "require_pkce": false,
- "scopes": [
- "openid"
], - "secret": "R4ND0M/S∃CЯ∃T",
- "session_expiry": "1h"
}, - "saml": {
- "backend": "saml",
- "enable": false,
- "sp_private_key": "pa$$word",
- "sp_public_key": "Pub Key",
- "sp_sign_request": false
}
}, - "swagger_support": true,
- "token_expired_time": "12m"
}
List all currently banned client IDs, usernames and IP addresses.
Filters are supported. Since filters are mutually exclusive, only one filter is allowed in a query.
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
clientid | string Query the banning rules with an exact client ID. |
username | string Query the banning rules with an exact username. |
peerhost | string Example: peerhost=127.0.0.1 Query the banning rules with an exact IP address. |
like_clientid | string Fuzzy query banning rules with a regular expression for client ID. |
like_username | string Fuzzy query banning rules with a regular expression for username. |
like_peerhost | string Example: like_peerhost=127.0.0.1 Fuzzy query banning rules with a regular expression for IP address. |
like_peerhost_net | string Example: like_peerhost_net=192.1.0.0/16 Fuzzy query banning rules with a regular expression for CIDR. |
{- "data": [
- {
- "as": "username",
- "at": "2021-10-25T21:48:47+08:00",
- "by": "mgmt_api",
- "reason": "Too many requests",
- "until": "2030-11-11T10:24:00+08:00",
- "who": "Banned name"
}
], - "meta": {
- "count": 0,
- "hasnext": true,
- "limit": 50,
- "page": 1
}
}
Add a client ID, username or IP address to the blacklist.
as required | string Enum: "clientid" "username" "peerhost" "clientid_re" "username_re" "peerhost_net" Ban method, which can be exact client ID, client ID regular expression, exact username, username regular expression, |
integer or string The start time of the ban, the format is rfc3339, the default is the time when the operation was initiated. | |
by | string Initiator of the ban. |
reason | string Ban reason, record the reason why the current object was banned. |
(integer or string) or string Default: "infinity" The end time of the ban, the format is rfc3339, the default is the time when the operation was initiated + 1 year. | |
who required | string Ban object, specific client ID, username or IP address. |
{- "as": "username",
- "at": "2021-10-25T21:48:47+08:00",
- "by": "mgmt_api",
- "reason": "Too many requests",
- "until": "2030-11-11T10:24:00+08:00",
- "who": "Banned name"
}
{- "data": [
- {
- "as": "username",
- "at": "2021-10-25T21:48:47+08:00",
- "by": "mgmt_api",
- "reason": "Too many requests",
- "until": "2030-11-11T10:24:00+08:00",
- "who": "Banned name"
}
]
}
Remove a client ID, username or IP address from the blacklist.
as required | string Enum: "clientid" "username" "peerhost" "clientid_re" "username_re" "peerhost_net" Example: username Ban method, which can be exact client ID, client ID regular expression, exact username, username regular expression, |
who required | string Example: Badass Ban object, specific client ID, username or IP address. |
{- "code": "NOT_FOUND",
- "message": "string"
}
Upgrade a specified node to the target version with the installed package.
node required | string Default: "all" Example: emqx@127.0.0.1 The node to be upgraded |
{- "code": "UNEXPECTED_ERROR",
- "message": "string"
}
Get the hot upgrade status of all nodes
[- {
- "current_vsn": "5.8.0",
- "live_connections": 100,
- "node": "emqx@127.0.0.1",
- "role": "core",
- "status": "in-progress",
- "upgrade_history": [
- {
- "finished_at": "2024-07-16T11:00:01.875627+08:00",
- "from_vsn": "5.8.0",
- "result": "success",
- "started_at": "2024-07-15T13:48:02.648559+08:00",
- "status": "finished",
- "target_vsn": "5.8.1",
- "upgrade_opts": {
- "deploy_inplace": false
}
}
]
}
]
Get the hot upgrade status of a specified node
node required | string Default: "all" Example: emqx@127.0.0.1 The node to be upgraded |
{- "current_vsn": "5.8.0",
- "live_connections": 100,
- "node": "emqx@127.0.0.1",
- "role": "core",
- "status": "in-progress",
- "upgrade_history": [
- {
- "finished_at": "2024-07-16T11:00:01.875627+08:00",
- "from_vsn": "5.8.0",
- "result": "success",
- "started_at": "2024-07-15T13:48:02.648559+08:00",
- "status": "finished",
- "target_vsn": "5.8.1",
- "upgrade_opts": {
- "deploy_inplace": false
}
}
]
}
Upload a hot upgrade package (emqx_relup-vsn.tar.gz).
Note that only one package is alllowed to be installed at a time.
plugin | string <binary> |
{- "code": "UNEXPECTED_ERROR",
- "message": "string"
}
Get information of the installed hot upgrade package.
{- "applicable_vsns": [
- "5.8.0",
- "5.8.1"
], - "build_date": "2021-12-25",
- "built_on_otp_release": "24",
- "change_logs": [
- "1. Fix a bug foo in the plugin.2. Add a new bar feature."
], - "md5_sum": "d41d8cd98f00b204e9800998ecf8427e",
- "name": "emqx_relup-5.8.2.tar.gz",
- "target_vsn": "5.8.2"
}
Unsubscribe bulk
clientid required | string |
topic | string Topic name |
[- {
- "topic": "testtopic/#"
}
]
{- "code": "CLIENTID_NOT_FOUND",
- "message": "string"
}
Subscribe
clientid required | string |
nl | integer Default: 0 No local |
qos | integer [ 0 .. 2 ] Default: 0 QoS |
rap | integer Default: 0 Retain as published |
rh | integer Default: 0 Retain handling |
topic required | string Topic name |
{- "nl": 0,
- "qos": 0,
- "rap": 0,
- "rh": 0,
- "topic": "testtopic/#"
}
{- "clientid": "emqx_clientid_xx128cdhfc",
- "durable": false,
- "nl": 0,
- "node": "emqx@127.0.0.1",
- "qos": 0,
- "rap": 0,
- "rh": 0,
- "topic": "testtopic/1"
}
Get clients info by client ID
clientid required | string |
{- "listener": "tcp:default",
- "subscriptions_max": "infinity",
- "send_cnt": 4,
- "mailbox_len": 0,
- "port": 52571,
- "inflight_cnt": 0,
- "send_msg.dropped": 0,
- "clean_start": true,
- "mqueue_max": 1000,
- "recv_cnt": 4,
- "expiry_interval": 0,
- "mqueue_len": 0,
- "proto_ver": 5,
- "send_msg": 0,
- "send_pkt": 4,
- "send_msg.dropped.expired": 0,
- "is_bridge": false,
- "send_msg.qos2": 0,
- "mqueue_dropped": 0,
- "awaiting_rel_cnt": 0,
- "awaiting_rel_max": 100,
- "enable_authn": true,
- "send_msg.qos1": 0,
- "heap_size": 610,
- "is_persistent": false,
- "keepalive": 60,
- "recv_msg.dropped.await_pubrel_timeout": 0,
- "connected_at": "2024-01-01T12:34:56.789+08:00",
- "send_msg.dropped.too_large": 0,
- "recv_msg.qos1": 0,
- "send_msg.qos0": 0,
- "proto_name": "MQTT",
- "recv_msg.qos2": 0,
- "recv_oct": 49,
- "clientid": "01",
- "recv_msg.dropped": 0,
- "send_oct": 31,
- "durable": false,
- "connected": true,
- "recv_msg.qos0": 0,
- "peerport": 52571,
- "recv_msg": 0,
- "mountpoint": "null",
- "recv_pkt": 4,
- "inflight_max": 32,
- "subscriptions_cnt": 1,
- "username": null,
- "node": "emqx@127.0.0.1",
- "reductions": 6836,
- "created_at": "2024-01-01T12:34:56.789+08:00",
- "send_msg.dropped.queue_full": 0,
- "ip_address": "127.0.0.1"
}
List clients
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
node | string Example: node=emqx@127.0.0.1 Node name |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
username | Array of strings User name of client when connecting |
ip_address | string Example: ip_address=127.0.0.1 Client's IP address |
conn_state | string Enum: "connected" "idle" "disconnected" The current connection status of the client, the possible values are connected,idle,disconnected |
clean_start | boolean Indicate whether the client is using a brand new session |
proto_ver | string Protocol version |
like_clientid | string Fuzzy search |
like_username | string Fuzzy search |
integer or string Search client session creation time by greater than or equal method, rfc3339 or timestamp(millisecond) | |
integer or string Search client session creation time by less than or equal method, rfc3339 or timestamp(millisecond) | |
integer or string Search client connection creation time by greater than or equal method, rfc3339 or timestamp(epoch millisecond) | |
integer or string Search client connection creation time by less than or equal method, rfc3339 or timestamp(epoch millisecond) | |
clientid | Array of strings Client ID |
Array of strings or string Default: "all" Comma separated list of client fields to return in the response |
{- "data": [
- {
- "listener": "tcp:default",
- "subscriptions_max": "infinity",
- "send_cnt": 4,
- "mailbox_len": 0,
- "port": 52571,
- "inflight_cnt": 0,
- "send_msg.dropped": 0,
- "clean_start": true,
- "mqueue_max": 1000,
- "recv_cnt": 4,
- "expiry_interval": 0,
- "mqueue_len": 0,
- "proto_ver": 5,
- "send_msg": 0,
- "send_pkt": 4,
- "send_msg.dropped.expired": 0,
- "is_bridge": false,
- "send_msg.qos2": 0,
- "mqueue_dropped": 0,
- "awaiting_rel_cnt": 0,
- "awaiting_rel_max": 100,
- "enable_authn": true,
- "send_msg.qos1": 0,
- "heap_size": 610,
- "is_persistent": false,
- "keepalive": 60,
- "recv_msg.dropped.await_pubrel_timeout": 0,
- "connected_at": "2024-01-01T12:34:56.789+08:00",
- "send_msg.dropped.too_large": 0,
- "recv_msg.qos1": 0,
- "send_msg.qos0": 0,
- "proto_name": "MQTT",
- "recv_msg.qos2": 0,
- "recv_oct": 49,
- "clientid": "01",
- "recv_msg.dropped": 0,
- "send_oct": 31,
- "durable": false,
- "connected": true,
- "recv_msg.qos0": 0,
- "peerport": 52571,
- "recv_msg": 0,
- "mountpoint": "null",
- "recv_pkt": 4,
- "inflight_max": 32,
- "subscriptions_cnt": 1,
- "username": null,
- "node": "emqx@127.0.0.1",
- "reductions": 6836,
- "created_at": "2024-01-01T12:34:56.789+08:00",
- "send_msg.dropped.queue_full": 0,
- "ip_address": "127.0.0.1"
}
], - "meta": {
- "count": 1,
- "hasnext": false,
- "limit": 50,
- "page": 1
}
}
Get the total number of sessions in the cluster.
By default, it includes only those sessions that have not expired.
If the broker.session_history_retain
config is set to a duration greater than 0s,
this count will also include sessions that expired within the specified retain time.
By specifying the since
parameter, it can return the number of sessions that have expired within the specified time.
since | integer >= 0 Default: 0 Example: since=1705391625 Include sessions expired after this time (UNIX Epoch in seconds precision) |
"string"
Get client subscriptions
clientid required | string |
[- {
- "clientid": "emqx_clientid_xx128cdhfc",
- "durable": false,
- "nl": 0,
- "node": "emqx@127.0.0.1",
- "qos": 0,
- "rap": 0,
- "rh": 0,
- "topic": "testtopic/1"
}
]
Unsubscribe
clientid required | string |
topic | string Topic name |
{- "topic": "testtopic/#"
}
{- "code": "CLIENTID_NOT_FOUND",
- "message": "string"
}
Get client mqueue messages
clientid required | string |
payload | string Default: "base64" Enum: "none" "base64" "plain" Client's inflight/mqueue messages payload encoding. |
max_payload_bytes | string Default: "1MB" Example: max_payload_bytes=32MB Client's inflight/mqueue messages payload limit. The total payload size of all messages in the response will not exceed this value. Messages beyond the limit will be silently omitted in the response. The only exception to this rule is when the first message payload is already larger than the limit, in this case, the first message will be returned in the response. |
string or string or string Example: position=none An opaque token that can then be in subsequent requests to get the next chunk of results: | |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "from_clientid": "mqttx_59ac0a87",
- "from_username": "test-user",
- "mqueue_priority": 0,
- "msgid": "000611F460D57FA9F44500000D360002",
- "payload": "eyJmb28iOiAiYmFyIn0=",
- "publish_at": 1709055346487,
- "qos": 0,
- "topic": "t/test"
}
], - "meta": {
- "count": 100,
- "last": "1710785444656449826_10"
}
}
Subscribe bulk
clientid required | string |
nl | integer Default: 0 No local |
qos | integer [ 0 .. 2 ] Default: 0 QoS |
rap | integer Default: 0 Retain as published |
rh | integer Default: 0 Retain handling |
topic required | string Topic name |
[- {
- "nl": 0,
- "qos": 0,
- "rap": 0,
- "rh": 0,
- "topic": "testtopic/#"
}
]
[- {
- "clientid": "emqx_clientid_xx128cdhfc",
- "durable": false,
- "nl": 0,
- "node": "emqx@127.0.0.1",
- "qos": 0,
- "rap": 0,
- "rh": 0,
- "topic": "testtopic/1"
}
]
Get client in-flight messages
clientid required | string |
payload | string Default: "base64" Enum: "none" "base64" "plain" Client's inflight/mqueue messages payload encoding. |
max_payload_bytes | string Default: "1MB" Example: max_payload_bytes=32MB Client's inflight/mqueue messages payload limit. The total payload size of all messages in the response will not exceed this value. Messages beyond the limit will be silently omitted in the response. The only exception to this rule is when the first message payload is already larger than the limit, in this case, the first message will be returned in the response. |
string or string or string Example: position=none An opaque token that can then be in subsequent requests to get the next chunk of results: | |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "from_clientid": "mqttx_59ac0a87",
- "from_username": "test-user",
- "msgid": "000611F460D57FA9F44500000D360002",
- "payload": "eyJmb28iOiAiYmFyIn0=",
- "publish_at": 1709055346487,
- "qos": 0,
- "topic": "t/test"
}
], - "meta": {
- "count": 100,
- "last": "1710785444656449826"
}
}
Get the gateway configurations
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
{- "connection_required": false,
- "enable": true,
- "enable_stats": true,
- "heartbeat": "30s",
- "idle_timeout": "30s",
- "listeners": [
- {
- "bind": "5683",
- "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "default",
- "type": "udp"
}
], - "mountpoint": "coap/",
- "name": "coap",
- "notify_type": "qos",
- "publish_qos": "coap",
- "subscribe_qos": "coap"
}
Update the gateway basic configurations and running status.
Note: The Authentication and Listener configurations should be updated by other special APIs.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
object (gateway.clientinfo_override) | |
enable | boolean Default: true Whether to enable this gateway |
enable_stats | boolean Default: true Whether to enable client process statistic |
object (gateway.stomp_frame) | |
idle_timeout | string Default: "30s" The idle time of the client connection process. It has two purposes: |
mountpoint | string Default: "" When publishing or subscribing, prefix all topics with a mountpoint string. |
{- "connection_required": false,
- "enable": true,
- "enable_stats": true,
- "heartbeat": "30s",
- "idle_timeout": "30s",
- "mountpoint": "coap2/",
- "notify_type": "qos",
- "publish_qos": "coap",
- "subscribe_qos": "coap"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Update the gateway basic configurations and running status.
Note: The Authentication and Listener configurations should be updated by other special APIs.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
enable required | boolean Example: true Whether to enable this gateway |
{- "code": "NOT_FOUND",
- "message": "string"
}
This API returns an overview info for the specified or all gateways.
including current running status, number of connections, listener status, etc.
status | string Enum: "running" "stopped" "unloaded" Example: status=running Filter gateways by status. |
[- {
- "name": "coap",
- "status": "unloaded"
}, - {
- "name": "exproto",
- "status": "unloaded"
}, - {
- "created_at": "2021-12-08T14:41:26.171+08:00",
- "current_connections": 0,
- "listeners": [
- {
- "id": "lwm2m:udp:default",
- "name": "default",
- "running": true,
- "type": "udp"
}
], - "max_connections": 1024000,
- "name": "lwm2m",
- "node_status": [
- {
- "current_connections": 0,
- "max_connections": 1024000,
- "node": "node@127.0.0.1",
- "status": "running"
}
], - "started_at": "2021-12-08T14:41:26.202+08:00",
- "status": "running"
}, - {
- "created_at": "2021-12-08T14:41:45.071+08:00",
- "current_connections": 0,
- "listeners": [
- {
- "id": "mqttsn:udp:default",
- "name": "default",
- "running": false,
- "type": "udp"
}
], - "max_connections": 1024000,
- "name": "mqttsn",
- "node_status": [
- {
- "current_connections": 0,
- "max_connections": 1024000,
- "node": "node@127.0.0.1",
- "status": "running"
}
], - "status": "stopped",
- "stopped_at": "2021-12-08T14:56:35.576+08:00"
}, - {
- "created_at": "2021-12-08T14:42:15.272+08:00",
- "current_connections": 0,
- "listeners": [
- {
- "id": "stomp:tcp:default",
- "name": "default",
- "running": true,
- "type": "tcp"
}
], - "max_connections": 1024000,
- "name": "stomp",
- "node_status": [
- {
- "current_connections": 0,
- "max_connections": 1024000,
- "node": "node@127.0.0.1",
- "status": "running"
}
], - "started_at": "2021-12-08T14:42:15.274+08:00",
- "status": "running"
}
]
Start connector on all nodes in the cluster.
id required | string Example: http:my_http_connector The connector id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Start connector on a specific node.
node required | |
id required | string Example: http:my_http_connector The connector id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Test creating a new connector.
bridge_kafka.auth_gssapi_kerberos (object) or bridge_kafka.auth_username_password (object) or string Default: "none" Authentication configs. | |
bootstrap_hosts required | string A comma separated list of Kafka |
connect_timeout | string Default: "5s" Maximum wait time for TCP connection establishment (including authentication time if enabled). |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this connector. |
metadata_request_timeout | string Default: "5s" Maximum wait time when fetching topic metadata. |
min_metadata_refresh_interval | string Default: "3s" Minimum time interval the client has to wait before refreshing Kafka broker and topic metadata. Setting too small value may add extra load on Kafka. |
name required | string The name of the connector. |
object (bridge_kafka.connector_resource_opts) | |
object (bridge_kafka.socket_opts) | |
object (bridge_kafka.ssl_client_opts) | |
tags | Array of strings Tags to annotate this config entry. |
type required | string Value: "kafka_consumer" The type of the connector. |
{- "authentication": {
- "password": "******",
- "username": "root"
}, - "connect_timeout": "15s",
- "description": "My example elasticsearch connector",
- "enable": true,
- "enable_pipelining": 100,
- "name": "elasticsearch_connector",
- "pool_size": 8,
- "pool_type": "random",
- "server": "127.0.0.1:9200",
- "ssl": {
- "enable": false
}, - "type": "elasticsearch"
}
{- "code": "TEST_FAILED",
- "message": "string"
}
Enable or Disable connector on all nodes in the cluster.
id required | string Example: http:my_http_connector The connector id. Must be of format {type}:{name}. |
enable required | boolean Example: true Whether to enable this connector. |
{- "code": "NOT_FOUND",
- "message": "string"
}
Get a connector by id.
id required | string Example: http:my_http_connector The connector id. Must be of format {type}:{name}. |
{- "actions": [
- "my_action"
], - "authentication": {
- "password": "******",
- "username": "root"
}, - "connect_timeout": "15s",
- "description": "My example elasticsearch connector",
- "enable": true,
- "enable_pipelining": 100,
- "name": "elasticsearch_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 8,
- "pool_type": "random",
- "server": "127.0.0.1:9200",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "type": "elasticsearch"
}
Update a connector by id.
id required | string Example: http:my_http_connector The connector id. Must be of format {type}:{name}. |
bridge_kafka.auth_gssapi_kerberos (object) or bridge_kafka.auth_username_password (object) or string Default: "none" Authentication configs. | |
bootstrap_hosts required | string A comma separated list of Kafka |
connect_timeout | string Default: "5s" Maximum wait time for TCP connection establishment (including authentication time if enabled). |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this connector. |
metadata_request_timeout | string Default: "5s" Maximum wait time when fetching topic metadata. |
min_metadata_refresh_interval | string Default: "3s" Minimum time interval the client has to wait before refreshing Kafka broker and topic metadata. Setting too small value may add extra load on Kafka. |
object (bridge_kafka.connector_resource_opts) | |
object (bridge_kafka.socket_opts) | |
object (bridge_kafka.ssl_client_opts) | |
tags | Array of strings Tags to annotate this config entry. |
{- "authentication": {
- "password": "******",
- "username": "root"
}, - "connect_timeout": "15s",
- "description": "My example elasticsearch connector",
- "enable": true,
- "enable_pipelining": 100,
- "name": "elasticsearch_connector",
- "pool_size": 8,
- "pool_type": "random",
- "server": "127.0.0.1:9200",
- "ssl": {
- "enable": false
}, - "type": "elasticsearch"
}
{- "actions": [
- "my_action"
], - "authentication": {
- "password": "******",
- "username": "root"
}, - "connect_timeout": "15s",
- "description": "My example elasticsearch connector",
- "enable": true,
- "enable_pipelining": 100,
- "name": "elasticsearch_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 8,
- "pool_type": "random",
- "server": "127.0.0.1:9200",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "type": "elasticsearch"
}
[- {
- "actions": [
- "my_action"
], - "authentication": {
- "password": "******",
- "username": "root"
}, - "connect_timeout": "15s",
- "description": "My example elasticsearch connector",
- "enable": true,
- "enable_pipelining": 100,
- "name": "elasticsearch_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 8,
- "pool_type": "random",
- "server": "127.0.0.1:9200",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "type": "elasticsearch"
}, - {
- "actions": [
- "my_action"
], - "description": "My example oracle connector",
- "name": "oracle_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "oracle",
- "pool_size": 8,
- "resource_opts": {
- "health_check_interval": "15s",
- "start_timeout": "5s"
}, - "server": "127.0.0.1:1521",
- "service_name": "XE",
- "sid": "XE",
- "status": "connected",
- "type": "oracle",
- "username": "system"
}, - {
- "actions": [
- "my_action"
], - "database": "test",
- "description": "My example sqlserver connector",
- "driver": "ms-sql",
- "name": "sqlserver_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "health_check_interval": "20s"
}, - "server": "127.0.0.1:1433",
- "status": "connected",
- "type": "sqlserver",
- "username": "sa"
}, - {
- "actions": [
- "my_action"
], - "description": "My example hstreamdb connector",
- "grpc_timeout": "30s",
- "name": "hstreamdb_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "health_check_interval": "15s",
- "start_timeout": "5s"
}, - "ssl": {
- "enable": false,
- "verify": "verify_peer"
}, - "status": "connected",
- "type": "hstreamdb",
}, - {
- "actions": [
- "my_action"
], - "description": "My example tdengine connector",
- "enable": true,
- "name": "tdengine_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "pool_size": 8,
- "server": "127.0.0.1:6041",
- "status": "connected",
- "type": "tdengine",
- "username": "root"
}, - {
- "actions": [
- "my_action"
], - "description": "My example rocketmq connector",
- "enable": true,
- "name": "rocketmq_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 8,
- "resource_opts": {
- "health_check_interval": "15s",
- "start_after_created": true,
- "start_timeout": "5s"
}, - "servers": "127.0.0.1:9876",
- "status": "connected",
- "type": "rocketmq"
}, - {
- "actions": [
- "my_action"
], - "authentication": {
- "password": "******",
- "username": "root"
}, - "connect_timeout": "15s",
- "description": "My example iotdb connector",
- "enable": true,
- "enable_pipelining": 100,
- "iotdb_version": "v1.3.x",
- "name": "iotdb_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 8,
- "pool_type": "random",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "type": "iotdb"
}, - {
- "actions": [
- "my_action"
], - "description": "My example influxdb connector",
- "enable": true,
- "name": "influxdb_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "bucket": "example_bucket",
- "influxdb_type": "influxdb_api_v2",
- "org": "examlpe_org",
- "token": "example_token"
}, - "pool_size": 8,
- "server": "127.0.0.1:8086",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "type": "influxdb"
}, - {
- "description": "My redis sentinel connector",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "database": 1,
- "password": "******",
- "pool_size": 8,
- "redis_type": "sentinel",
- "sentinel": "myredismaster",
- "servers": "127.0.0.1:6379,127.0.0.2:6379",
- "username": "test"
}, - "ssl": {
- "enable": false
}, - "status": "connected"
}, - {
- "actions": [
- "my_action"
], - "aws_access_key_id": "root",
- "aws_secret_access_key": "******",
- "description": "My example dynamo connector",
- "enable": true,
- "name": "dynamo_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 8,
- "region": "us-west-2",
- "resource_opts": {
- "health_check_interval": "15s",
- "start_timeout": "5s"
}, - "status": "connected",
- "type": "dynamo",
}, - {
- "actions": [
- "my_action"
], - "database": "emqx_data",
- "enable": true,
- "name": "my_timescale_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "public",
- "pool_size": 8,
- "server": "127.0.0.1:5432",
- "ssl": {
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "5s",
- "log_level": "notice",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "verify": "verify_peer",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}, - "status": "connected",
- "type": "timescale",
- "username": "postgres"
}, - {
- "description": "My connector",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "resource_opts": {
- "health_check_interval": "45s",
- "start_after_created": true,
- "start_timeout": "5s"
}, - "server": "couchbase:8093",
- "ssl": {
- "enable": true
}, - "status": "connected",
- "username": "admin"
}, - {
- "description": "My connector",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 3,
- "proto_ver": "v5",
- "resource_opts": {
- "health_check_interval": "45s",
- "start_after_created": true,
- "start_timeout": "5s"
}, - "server": "127.0.0.1:1883",
- "status": "connected"
}, - {
- "actions": [
- "my_action"
], - "description": "My example mongodb_rs connector",
- "name": "mongodb_rs_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "database": "mqtt",
- "enable": true,
- "password": "******",
- "pool_size": 8,
- "srv_record": false,
- "username": "myuser"
}, - "status": "connected",
- "type": "mongodb_rs"
}, - {
- "description": "My redis single connector",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "database": 1,
- "password": "******",
- "pool_size": 8,
- "redis_type": "single",
- "server": "127.0.0.1:6379",
- "username": "test"
}, - "ssl": {
- "enable": false
}, - "status": "connected"
}, - {
- "actions": [
- "my_action"
], - "dbname": "example_db",
- "description": "My example greptimedb connector",
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "demo",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "resource_opts": {
- "batch_size": 100,
- "batch_time": "20ms"
}, - "server": "127.0.0.1:4001",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "type": "greptimedb",
- "username": "example_username"
}, - {
- "access_key_id": "ACCESS",
- "description": "My S3 connector",
- "enable": true,
- "host": "s3.eu-east-1.amazonaws.com",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "port": 443,
- "secret_access_key": "SECRET",
- "status": "connected",
- "transport_options": {
- "connect_timeout": "1s",
- "enable_pipelining": 1,
- "max_retries": 1,
- "pool_size": 4,
- "request_timeout": "60s",
- "ssl": {
- "enable": true,
- "verify": "verify_peer"
}
}
}, - {
- "actions": [
- "my_action"
], - "database": "mqtt",
- "description": "My example clickhouse connector",
- "name": "clickhouse_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "pool_size": 8,
- "status": "connected",
- "type": "clickhouse",
- "username": "default"
}, - {
- "actions": [
- "my_action"
], - "connect_timeout": "15s",
- "description": "my connector",
- "enable": true,
- "max_retries": 2,
- "name": "my_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pipelining": 100,
- "pool_size": 8,
- "resource_opts": {
- "health_check_interval": "30s",
- "start_after_created": true,
- "start_timeout": "5s"
}, - "service_account_json": {
- "client_email": "test@myproject.iam.gserviceaccount.com",
- "client_id": "123812831923812319190",
- "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test%40myproject.iam.gserviceaccount.com",
- "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQI...",
- "private_key_id": "kid",
- "project_id": "myproject",
- "type": "service_account"
}, - "status": "connected",
- "type": "gcp_pubsub_producer"
}, - {
- "account_key": "******",
- "account_name": "my_account_name",
- "description": "My connector",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "health_check_interval": "45s",
- "start_after_created": true,
- "start_timeout": "5s"
}, - "status": "connected"
}, - {
- "actions": [
- "my_action"
], - "description": "My example rabbitmq connector",
- "enable": true,
- "heartbeat": "30s",
- "name": "rabbitmq_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "pool_size": 8,
- "port": 5672,
- "server": "127.0.0.1",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "timeout": "5s",
- "type": "rabbitmq",
- "username": "guest",
- "virtual_host": "/"
}, - {
- "actions": [
- "my_action"
], - "description": "My example cassandra connector",
- "keyspace": "mqtt",
- "name": "cassandra_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "pool_size": 8,
- "servers": "127.0.0.1:9042",
- "status": "connected",
- "type": "cassandra",
- "username": "root"
}, - {
- "ack_mode": "no_ack",
- "ack_timeout": "10s",
- "actions": [
- "my_action"
], - "enable": true,
- "name": "syskeeper_forwarder",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 16,
- "server": "127.0.0.1:9092",
- "status": "connected",
- "type": "syskeeper_forwarder"
}, - {
- "actions": [
- "my_action"
], - "description": "My example mongodb_sharded connector",
- "name": "mongodb_sharded_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "database": "mqtt",
- "enable": true,
- "password": "******",
- "pool_size": 8,
- "srv_record": false,
- "username": "myuser"
}, - "status": "connected",
- "type": "mongodb_sharded"
}, - {
- "acceptors": 16,
- "actions": [
- "my_action"
], - "enable": true,
- "handshake_timeout": "16s",
- "listen": "127.0.0.1:9092",
- "name": "syskeeper_proxy",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "status": "connected",
- "type": "syskeeper_proxy"
}, - {
- "connect_timeout": "15s",
- "enable": true,
- "enable_pipelining": 100,
- "headers": {
- "content-type": "application/json"
}, - "name": "my_http_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 1,
- "pool_type": "hash",
- "status": "connected",
- "type": "http",
}, - {
- "account": "myorg-myaccount",
- "description": "My connector",
- "dsn": "snowflake",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "health_check_interval": "45s",
- "start_after_created": true,
- "start_timeout": "5s"
}, - "server": "myorg-myaccount.snowflakecomputing.com",
- "status": "connected",
- "username": "admin"
}, - {
- "actions": [
- "my_action"
], - "connect_timeout": "10s",
- "enable": true,
- "max_retries": 2,
- "name": "my_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pipelining": 100,
- "pool_size": 8,
- "resource_opts": {
- "request_ttl": "60s"
}, - "service_account_json": {
- "client_email": "test@myproject.iam.gserviceaccount.com",
- "client_id": "123812831923812319190",
- "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test%40myproject.iam.gserviceaccount.com",
- "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQI...",
- "private_key_id": "kid",
- "project_id": "myproject",
- "type": "service_account"
}, - "status": "connected",
- "type": "gcp_pubsub_producer"
}, - {
- "actions": [
- "my_action"
], - "description": "My example influxdb connector",
- "enable": true,
- "name": "influxdb_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "database": "example_database",
- "influxdb_type": "influxdb_api_v1",
- "password": "******",
- "username": "example_username"
}, - "pool_size": 8,
- "server": "127.0.0.1:8086",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "type": "influxdb"
}, - {
- "actions": [
- "my_action"
], - "description": "My example datalayers connector",
- "enable": true,
- "name": "datalayers_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "database": "example_database",
- "password": "******",
- "username": "example_username"
}, - "pool_size": 8,
- "server": "127.0.0.1:8361",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "type": "datalayers"
}, - {
- "actions": [
- "my_action"
], - "authentication": "none",
- "connect_timeout": "5s",
- "description": "My example pulsar connector",
- "enable": true,
- "name": "pulsar_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "servers": "pulsar://127.0.0.1:6650",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "type": "pulsar"
}, - {
- "actions": [
- "my_action"
], - "description": "My example mongodb_single connector",
- "name": "mongodb_single_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "database": "mqtt",
- "enable": true,
- "password": "******",
- "pool_size": 8,
- "srv_record": false,
- "username": "myuser"
}, - "status": "connected",
- "type": "mongodb_single"
}, - {
- "actions": [
- "my_action"
], - "aws_access_key_id": "your_access_key",
- "aws_secret_access_key": "aws_secret_key",
- "description": "My example kinesis connector",
- "max_retries": 2,
- "name": "kinesis_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 8,
- "status": "connected",
- "type": "kinesis"
}, - {
- "actions": [
- "my_action"
], - "database": "emqx_data",
- "enable": true,
- "name": "my_pgsql_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "public",
- "pool_size": 8,
- "server": "127.0.0.1:5432",
- "ssl": {
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "5s",
- "log_level": "notice",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "verify": "verify_peer",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}, - "status": "connected",
- "type": "pgsql",
- "username": "postgres"
}, - {
- "actions": [
- "my_action"
], - "authentication": {
- "mechanism": "plain",
- "password": "******",
- "username": "username"
}, - "bootstrap_hosts": "localhost:9092",
- "connect_timeout": "5s",
- "enable": true,
- "metadata_request_timeout": "4s",
- "min_metadata_refresh_interval": "3s",
- "name": "my_kafka_producer_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "socket_opts": {
- "nodelay": true,
- "recbuf": "1024KB",
- "sndbuf": "1024KB",
- "tcp_keepalive": "none"
}, - "status": "connected",
- "type": "kafka_producer"
}, - {
- "actions": [
- "my_action"
], - "database": "test",
- "description": "My example mysql connector",
- "name": "mysql_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "health_check_interval": "20s"
}, - "server": "127.0.0.1:3306",
- "status": "connected",
- "type": "mysql",
- "username": "root"
}, - {
- "description": "My redis cluster connector",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "password": "******",
- "pool_size": 8,
- "redis_type": "cluster",
- "servers": "127.0.0.1:6379,127.0.0.2:6379",
- "username": "test"
}, - "ssl": {
- "enable": false
}, - "status": "connected"
}, - {
- "actions": [
- "my_action"
], - "authentication": {
- "password": "******"
}, - "bootstrap_hosts": "xyz.sa-east1.gcp.confluent.cloud:9092",
- "connect_timeout": "5s",
- "enable": true,
- "metadata_request_timeout": "4s",
- "min_metadata_refresh_interval": "3s",
- "name": "my_confluent_producer_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "socket_opts": {
- "nodelay": true,
- "recbuf": "1024KB",
- "sndbuf": "1024KB",
- "tcp_keepalive": "none"
}, - "ssl": {
- "enable": true,
- "server_name_indication": "auto",
- "verify": "verify_none",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}, - "status": "connected",
- "type": "confluent_producer"
}, - {
- "actions": [
- "my_action"
], - "database": "emqx_data",
- "enable": true,
- "name": "my_matrix_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "public",
- "pool_size": 8,
- "server": "127.0.0.1:5432",
- "ssl": {
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "5s",
- "log_level": "notice",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "verify": "verify_peer",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}, - "status": "connected",
- "type": "matrix",
- "username": "postgres"
}, - {
- "actions": [
- "my_action"
], - "authentication": {
- "password": "******"
}, - "bootstrap_hosts": "namespace.servicebus.windows.net:9093",
- "connect_timeout": "5s",
- "enable": true,
- "metadata_request_timeout": "4s",
- "min_metadata_refresh_interval": "3s",
- "name": "my_azure_event_hub_producer_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "socket_opts": {
- "nodelay": true,
- "recbuf": "1024KB",
- "sndbuf": "1024KB",
- "tcp_keepalive": "none"
}, - "ssl": {
- "enable": true,
- "server_name_indication": "auto",
- "verify": "verify_none",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}, - "status": "connected",
- "type": "azure_event_hub_producer"
}, - {
- "access_key_id": "******",
- "access_key_secret": "******",
- "actions": [
- "my_action"
], - "description": "My example tablestore connector",
- "enable": true,
- "instance_name": "myinstance",
- "name": "tablestore_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "status": "connected",
- "storage_model_type": "timeseries",
- "type": "tablestore"
}, - {
- "actions": [
- "my_action"
], - "description": "My example opents connector",
- "enable": true,
- "name": "opents_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 8,
- "status": "connected",
- "type": "opents"
}, - {
- "description": "My connector",
- "enable": true,
- "filepath": "/tmp/my_log",
- "max_file_number": 7,
- "max_file_size": "10MB",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "health_check_interval": "45s",
- "start_after_created": true,
- "start_timeout": "5s"
}, - "status": "connected"
}, - {
- "bootstrap_hosts": "kafka.emqx.net:9092",
- "name": "my_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "resource_opts": {
- "health_check_interval": "30s",
- "start_after_created": true,
- "start_timeout": "5s"
}, - "status": "connected",
- "type": "kafka_consumer"
}
]
Create a new connector by type and name.
bridge_kafka.auth_gssapi_kerberos (object) or bridge_kafka.auth_username_password (object) or string Default: "none" Authentication configs. | |
bootstrap_hosts required | string A comma separated list of Kafka |
connect_timeout | string Default: "5s" Maximum wait time for TCP connection establishment (including authentication time if enabled). |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this connector. |
metadata_request_timeout | string Default: "5s" Maximum wait time when fetching topic metadata. |
min_metadata_refresh_interval | string Default: "3s" Minimum time interval the client has to wait before refreshing Kafka broker and topic metadata. Setting too small value may add extra load on Kafka. |
name required | string The name of the connector. |
object (bridge_kafka.connector_resource_opts) | |
object (bridge_kafka.socket_opts) | |
object (bridge_kafka.ssl_client_opts) | |
tags | Array of strings Tags to annotate this config entry. |
type required | string Value: "kafka_consumer" The type of the connector. |
{- "authentication": {
- "password": "******",
- "username": "root"
}, - "connect_timeout": "15s",
- "description": "My example elasticsearch connector",
- "enable": true,
- "enable_pipelining": 100,
- "name": "elasticsearch_connector",
- "pool_size": 8,
- "pool_type": "random",
- "server": "127.0.0.1:9200",
- "ssl": {
- "enable": false
}, - "type": "elasticsearch"
}
{- "actions": [
- "my_action"
], - "authentication": {
- "password": "******",
- "username": "root"
}, - "connect_timeout": "15s",
- "description": "My example elasticsearch connector",
- "enable": true,
- "enable_pipelining": 100,
- "name": "elasticsearch_connector",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "pool_size": 8,
- "pool_type": "random",
- "server": "127.0.0.1:9200",
- "ssl": {
- "enable": false
}, - "status": "connected",
- "type": "elasticsearch"
}
Get the detail information of Exhook server
name required | string Example: default The Exhook server name |
{- "auto_reconnect": "60s",
- "enable": true,
- "failed_action": "deny",
- "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "metrics": {
- "failed": 0,
- "max_rate": 0,
- "rate": 0,
- "succeed": 0
}, - "name": "default",
- "node_metrics": [
- {
- "metrics": {
- "failed": 0,
- "max_rate": 0,
- "rate": 0,
- "succeed": 0
}, - "node": "string"
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "pool_size": 8,
- "request_timeout": "12m",
- "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
},
}
Update the server
name required | string Example: default The Exhook server name |
string or string Default: "60s" Whether to automatically reconnect (initialize) the gRPC server. | |
enable | boolean Default: true Enable this Exhook server |
failed_action | string Default: "deny" Enum: "deny" "ignore" The value that is returned when the request to the gRPC server fails for any reason |
name required | string Name of the exhook server |
pool_size | integer >= 1 Default: 8 The process pool size for gRPC client |
request_timeout | string Default: "5s" The timeout of request gRPC server |
object (exhook.socket_options) | |
object (exhook.ssl_conf) | |
url required | string URL of the gRPC server |
{- "auto_reconnect": "60s",
- "enable": true,
- "failed_action": "deny",
- "name": "default",
- "pool_size": 8,
- "request_timeout": "5s",
- "ssl": {
- "cacertfile": "/etc/emqx/certs/cacert.pem",
- "certfile": "/etc/emqx/certs/cert.pem",
- "enable": false,
- "keyfile": "/etc/emqx/certs/key.pem"
},
}
{- "auto_reconnect": "60s",
- "enable": true,
- "failed_action": "deny",
- "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "metrics": {
- "failed": 0,
- "max_rate": 0,
- "rate": 0,
- "succeed": 0
}, - "name": "default",
- "node_metrics": [
- {
- "metrics": {
- "failed": 0,
- "max_rate": 0,
- "rate": 0,
- "succeed": 0
}, - "node": "string"
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "pool_size": 8,
- "request_timeout": "12m",
- "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
},
}
Move the server.
NOTE: The position should be "front | rear | before:{name} | after:{name}
name required | string Example: default The Exhook server name |
position required | string The target position to be moved |
{- "position": "front"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the hooks information of server
name required | string Example: default The Exhook server name |
[- {
- "metrics": {
- "failed": 0,
- "max_rate": 0,
- "rate": 0,
- "succeed": 0
}, - "name": "string",
- "node_metrics": [
- {
- "metrics": {
- "failed": 0,
- "max_rate": 0,
- "rate": 0,
- "succeed": 0
}, - "node": "string"
}
], - "params": {
- "$name": "string"
}
}
]
[- {
- "auto_reconnect": "60s",
- "enable": true,
- "failed_action": "deny",
- "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "metrics": {
- "failed": 0,
- "max_rate": 0,
- "rate": 0,
- "succeed": 0
}, - "name": "default",
- "node_metrics": [
- {
- "metrics": {
- "failed": 0,
- "max_rate": 0,
- "rate": 0,
- "succeed": 0
}, - "node": "string"
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "pool_size": 8,
- "request_timeout": "12m",
- "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
},
}
]
Add a server
string or string Default: "60s" Whether to automatically reconnect (initialize) the gRPC server. | |
enable | boolean Default: true Enable this Exhook server |
failed_action | string Default: "deny" Enum: "deny" "ignore" The value that is returned when the request to the gRPC server fails for any reason |
name required | string Name of the exhook server |
pool_size | integer >= 1 Default: 8 The process pool size for gRPC client |
request_timeout | string Default: "5s" The timeout of request gRPC server |
object (exhook.socket_options) | |
object (exhook.ssl_conf) | |
url required | string URL of the gRPC server |
{- "auto_reconnect": "60s",
- "enable": true,
- "failed_action": "deny",
- "name": "default",
- "pool_size": 8,
- "request_timeout": "5s",
- "ssl": {
- "cacertfile": "/etc/emqx/certs/cacert.pem",
- "certfile": "/etc/emqx/certs/cert.pem",
- "enable": false,
- "keyfile": "/etc/emqx/certs/key.pem"
},
}
{- "auto_reconnect": "60s",
- "enable": true,
- "failed_action": "deny",
- "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "metrics": {
- "failed": 0,
- "max_rate": 0,
- "rate": 0,
- "succeed": 0
}, - "name": "default",
- "node_metrics": [
- {
- "metrics": {
- "failed": 0,
- "max_rate": 0,
- "rate": 0,
- "succeed": 0
}, - "node": "string"
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "pool_size": 8,
- "request_timeout": "12m",
- "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
},
}
List all rules
enable | boolean Filter enable/disable rules |
from | string Filter rules by from(topic), exact match |
like_id | string Filter rules by id, Substring matching |
like_from | string Filter rules by from(topic), Substring matching |
like_description | string Filter rules by description, Substring matching |
match_from | string Filter rules by from(topic), Mqtt topic matching |
action | Array of strings Filters rules that contain any of the given action id(s). When used in conjunction with source id filtering, the rules must contain sources and actions that match some of the criteria. |
source | Array of strings Filters rules that contain any of the given source id(s). When used in conjunction with action id filtering, the rules must contain sources and actions that match some of the criteria. |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "action_details": [
- {
- "name": "string",
- "status": "string",
- "type": "string"
}
], - "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "created_at": "2021-12-01T15:00:43.153+08:00",
- "description": "Some description",
- "enable": true,
- "from": "t/#",
- "id": "293fb66f",
- "last_modified_at": "2021-12-24T15:00:44.153+08:00",
- "metadata": { },
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1"
}
], - "meta": {
- "count": 0,
- "hasnext": true,
- "limit": 50,
- "page": 1
}
}
Create a new rule using given Id
Array of rule_engine.user_provided_function (object) or rule_engine.builtin_action_console (object) or rule_engine.builtin_action_republish (object) or strings Default: [] A list of actions of the rule. | |
description | string Default: "" The description of the rule |
enable | boolean Default: true Enable or disable the rule |
metadata | object Rule metadata, do not change manually |
name | string Default: "" The name of the rule |
sql required | string SQL query to transform the messages. |
{- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "description": "Some description",
- "enable": true,
- "metadata": { },
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1"
}
{- "action_details": [
- {
- "name": "string",
- "status": "string",
- "type": "string"
}
], - "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "created_at": "2021-12-01T15:00:43.153+08:00",
- "description": "Some description",
- "enable": true,
- "from": "t/#",
- "id": "293fb66f",
- "last_modified_at": "2021-12-24T15:00:44.153+08:00",
- "metadata": { },
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1"
}
Get a rule by given Id
id required | string Example: my_rule_id |
{- "action_details": [
- {
- "name": "string",
- "status": "string",
- "type": "string"
}
], - "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "created_at": "2021-12-01T15:00:43.153+08:00",
- "description": "Some description",
- "enable": true,
- "from": "t/#",
- "id": "293fb66f",
- "last_modified_at": "2021-12-24T15:00:44.153+08:00",
- "metadata": { },
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1"
}
Update a rule by given Id to all nodes in the cluster
id required | string Example: my_rule_id |
Array of rule_engine.user_provided_function (object) or rule_engine.builtin_action_console (object) or rule_engine.builtin_action_republish (object) or strings Default: [] A list of actions of the rule. | |
description | string Default: "" The description of the rule |
enable | boolean Default: true Enable or disable the rule |
metadata | object Rule metadata, do not change manually |
name | string Default: "" The name of the rule |
sql required | string SQL query to transform the messages. |
{- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "description": "Some description",
- "enable": true,
- "metadata": { },
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1"
}
{- "action_details": [
- {
- "name": "string",
- "status": "string",
- "type": "string"
}
], - "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "created_at": "2021-12-01T15:00:43.153+08:00",
- "description": "Some description",
- "enable": true,
- "from": "t/#",
- "id": "293fb66f",
- "last_modified_at": "2021-12-24T15:00:44.153+08:00",
- "metadata": { },
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1"
}
Update rule engine configuration.
ignore_sys_message | boolean Default: true When set to 'true' (default), rule-engine will ignore messages published to $SYS topics. |
jq_function_default_timeout | string Default: "10s" Default timeout for the |
{- "ignore_sys_message": true,
- "jq_function_default_timeout": "32s"
}
{- "ignore_sys_message": true,
- "jq_function_default_timeout": "32s"
}
Apply a rule with the given message and environment
id required | string Example: my_rule_id |
rule_engine.ctx_unsub (object) or rule_engine.ctx_sub (object) or rule_engine.ctx_schema_validation_failed (object) or rule_engine.ctx_message_transformation_failed (object) or rule_engine.ctx_pub (object) or rule_engine.ctx_dropped (object) or rule_engine.ctx_delivered (object) or rule_engine.ctx_acked (object) or rule_engine.ctx_delivery_dropped (object) or rule_engine.ctx_disconnected (object) or rule_engine.ctx_connected (object) or rule_engine.ctx_connack (object) or rule_engine.ctx_check_authz_complete (object) or rule_engine.ctx_check_authn_complete (object) or rule_engine.ctx_alarm_deactivated (object) or rule_engine.ctx_alarm_activated (object) or rule_engine.ctx_bridge_mqtt (object) Default: {} The context of the event for testing | |
stop_action_after_template_rendering | boolean Default: true Set this to true if the action should be stopped after its template has been rendered (default is true). |
{- "context": { },
- "stop_action_after_template_rendering": true
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Test a rule
rule_engine.ctx_unsub (object) or rule_engine.ctx_sub (object) or rule_engine.ctx_schema_validation_failed (object) or rule_engine.ctx_message_transformation_failed (object) or rule_engine.ctx_pub (object) or rule_engine.ctx_dropped (object) or rule_engine.ctx_delivered (object) or rule_engine.ctx_acked (object) or rule_engine.ctx_delivery_dropped (object) or rule_engine.ctx_disconnected (object) or rule_engine.ctx_connected (object) or rule_engine.ctx_connack (object) or rule_engine.ctx_check_authz_complete (object) or rule_engine.ctx_check_authn_complete (object) or rule_engine.ctx_alarm_deactivated (object) or rule_engine.ctx_alarm_activated (object) or rule_engine.ctx_bridge_mqtt (object) Default: {} The context of the event for testing | |
sql required | string The SQL of the rule for testing |
{- "context": { },
- "sql": "string"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get a rule's metrics by given Id
id required | string Example: my_rule_id |
{- "id": "293fb66f",
- "metrics": {
- "actions.discarded": 0,
- "actions.failed": 0,
- "actions.failed.out_of_service": 0,
- "actions.failed.unknown": 0,
- "actions.success": 0,
- "actions.total": 0,
- "failed": 0,
- "failed.exception": 0,
- "failed.unknown": 0,
- "matched": 0,
- "matched.rate": 0,
- "matched.rate.last5m": 0,
- "matched.rate.max": 0,
- "passed": 0
}, - "node_metrics": [
- {
- "actions.discarded": 0,
- "actions.failed": 0,
- "actions.failed.out_of_service": 0,
- "actions.failed.unknown": 0,
- "actions.success": 0,
- "actions.total": 0,
- "failed": 0,
- "failed.exception": 0,
- "failed.unknown": 0,
- "matched": 0,
- "matched.rate": 0,
- "matched.rate.last5m": 0,
- "matched.rate.max": 0,
- "node": "emqx@127.0.0.1",
- "passed": 0
}
]
}
Look up a resource
clientid required | string Example: urn:oma:lwm2m:oma:2 |
path required | string Example: path=/3/0/7 |
action required | string Example: action=discover |
{- "action": "discover",
- "clientid": "urn:oma:lwm2m:oma:2",
- "codeMsg": "reply_not_received",
- "content": [
- {
- "dataType": "Integer",
- "name": "lwm2m-test",
- "operations": "E",
- "path": "urn:oma:lwm2m:oma:2"
}
], - "path": "/3/0/7"
}
Send a write command to a resource
clientid required | string Example: urn:oma:lwm2m:oma:2 |
path required | string Example: path=/3/0/7 |
type required | string Enum: "Integer" "Float" "Time" "String" "Boolean" "Opaque" "Objlnk" Example: type=Integer |
value required | string Example: value=123 |
{- "code": "CLIENT_NOT_FOUND",
- "message": "string"
}
Send a read command to a resource
clientid required | string Example: urn:oma:lwm2m:oma:2 |
path required | string Example: path=/3/0/7 |
{- "code": "CLIENT_NOT_FOUND",
- "message": "string"
}
Observe or Cancel observe a resource
clientid required | string Example: urn:oma:lwm2m:oma:2 |
path required | string Example: path=/3/0/7 |
enable required | boolean Example: enable=true |
{- "code": "CLIENT_NOT_FOUND",
- "message": "string"
}
Export a data backup file
root_keys | Array of strings Sets of root configuration keys to export. Exports all if omitted. |
table_sets | Array of strings Sets of tables to export. Exports all if omitted. Valid values: |
{- "root_keys": [
- "connectors",
- "actions",
- "sources",
- "rule_engine",
- "schema_registry"
], - "table_sets": [
- "banned",
- "builtin_authn",
- "builtin_authz"
]
}
{- "created_at": "2023-11-23T19:13:19+02:00",
- "created_at_sec": 1700759599,
- "filename": "emqx-export-2023-11-23-19-13-19.043.tar.gz",
- "node": "emqx@127.0.0.1",
- "size": 22740
}
List backup files
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "created_at": "2023-09-02T11:11:33+02:00",
- "created_at_sec": 1693645893,
- "filename": "emqx-export-2023-09-02-11-11-33.012.tar.gz",
- "node": "emqx@127.0.0.1",
- "size": 22740
}, - {
- "created_at": "2023-11-23T19:13:19+02:00",
- "created_at_sec": 1700759599,
- "filename": "emqx-export-2023-11-23-19-13-19.043.tar.gz",
- "node": "emqx@127.0.0.1",
- "size": 22740
}
], - "meta": {
- "count": 300,
- "limit": 20,
- "page": 0
}
}
Import a data backup file
filename required | string Data backup file name |
node | string Node name |
{- "filename": "emqx-export-2023-11-23-19-13-19.043.tar.gz",
- "node": "emqx@127.0.0.1"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Test creating a new bridge by given ID
The ID must be of format '{type}:{name}'
bridge_kafka.auth_gssapi_kerberos (object) or bridge_kafka.auth_username_password (object) or string Default: "none" Authentication configs. | |
bootstrap_hosts required | string A comma separated list of Kafka |
connect_timeout | string Default: "5s" Maximum wait time for TCP connection establishment (including authentication time if enabled). |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this connector. |
health_check_topic | string Topic name used exclusively for more accurate connector health checks. |
object (bridge_kafka.consumer_kafka_opts) | |
key_encoding_mode | string Default: "none" Enum: "none" "base64" Defines how the key from the Kafka message is encoded before being forwarded via MQTT. |
metadata_request_timeout | string Default: "5s" Maximum wait time when fetching topic metadata. |
min_metadata_refresh_interval | string Default: "3s" Minimum time interval the client has to wait before refreshing Kafka broker and topic metadata. Setting too small value may add extra load on Kafka. |
name required | string Action name, used as a human-readable identifier. |
object (bridge_kafka.connector_resource_opts) | |
object (bridge_kafka.socket_opts) | |
object (bridge_kafka.ssl_client_opts) | |
tags | Array of strings Tags to annotate this config entry. |
required | Array of objects (bridge_kafka.consumer_topic_mapping) Defines the mapping between Kafka topics and MQTT topics. Must contain at least one item. |
type required | string Enum: "kafka" "kafka_producer" "kafka_consumer" The Action Type |
value_encoding_mode | string Default: "none" Enum: "none" "base64" Defines how the value from the Kafka message is encoded before being forwarded via MQTT. |
{- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:1521",
- "service_name": "ORCL",
- "sid": "ORCL",
- "sql": "insert into t_mqtt_msgs(msgid, topic, qos, payload) values (${id}, ${topic}, ${qos}, ${payload})",
- "type": "oracle",
- "username": "root"
}
{- "code": "TEST_FAILED",
- "message": "string"
}
Delete a bridge by Id
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
{- "code": "BAD_REQUEST",
- "message": "string",
- "rules": [
- "string"
]
}
Get a bridge by Id
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
{- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:1521",
- "service_name": "ORCL",
- "sid": "ORCL",
- "sql": "insert into t_mqtt_msgs(msgid, topic, qos, payload) values (${id}, ${topic}, ${qos}, ${payload})",
- "type": "oracle",
- "username": "root"
}
Update a bridge by Id
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
bridge_kafka.auth_gssapi_kerberos (object) or bridge_kafka.auth_username_password (object) or string Default: "none" Authentication configs. | |
bootstrap_hosts required | string A comma separated list of Kafka |
connect_timeout | string Default: "5s" Maximum wait time for TCP connection establishment (including authentication time if enabled). |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this connector. |
health_check_topic | string Topic name used exclusively for more accurate connector health checks. |
object (bridge_kafka.consumer_kafka_opts) | |
key_encoding_mode | string Default: "none" Enum: "none" "base64" Defines how the key from the Kafka message is encoded before being forwarded via MQTT. |
metadata_request_timeout | string Default: "5s" Maximum wait time when fetching topic metadata. |
min_metadata_refresh_interval | string Default: "3s" Minimum time interval the client has to wait before refreshing Kafka broker and topic metadata. Setting too small value may add extra load on Kafka. |
object (bridge_kafka.connector_resource_opts) | |
object (bridge_kafka.socket_opts) | |
object (bridge_kafka.ssl_client_opts) | |
tags | Array of strings Tags to annotate this config entry. |
required | Array of objects (bridge_kafka.consumer_topic_mapping) Defines the mapping between Kafka topics and MQTT topics. Must contain at least one item. |
value_encoding_mode | string Default: "none" Enum: "none" "base64" Defines how the value from the Kafka message is encoded before being forwarded via MQTT. |
{- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:1521",
- "service_name": "ORCL",
- "sid": "ORCL",
- "sql": "insert into t_mqtt_msgs(msgid, topic, qos, payload) values (${id}, ${topic}, ${qos}, ${payload})",
- "type": "oracle",
- "username": "root"
}
{- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:1521",
- "service_name": "ORCL",
- "sid": "ORCL",
- "sql": "insert into t_mqtt_msgs(msgid, topic, qos, payload) values (${id}, ${topic}, ${qos}, ${payload})",
- "type": "oracle",
- "username": "root"
}
Stop/Restart bridges on a specific node.
node required | |
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
operation required | string Enum: "start" "stop" "restart" Example: start Operations can be one of: stop, restart |
{- "code": "BAD_REQUEST",
- "message": "string"
}
[- {
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:1521",
- "service_name": "ORCL",
- "sid": "ORCL",
- "sql": "insert into t_mqtt_msgs(msgid, topic, qos, payload) values (${id}, ${topic}, ${qos}, ${payload})",
- "type": "oracle",
- "username": "root"
}, - {
- "database": "test",
- "driver": "ms-sql",
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "bar",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 1
}, - "server": "127.0.0.1:1433",
- "sql": "insert into t_mqtt_msg(msgid, topic, qos, payload) values ( ${id}, ${topic}, ${qos}, ${payload} )",
- "type": "sqlserver",
- "username": "sa"
}, - {
- "command_template": [
- "LPUSH",
- "MSGS",
- "${payload}"
], - "database": 1,
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "redis_bridge",
- "password": "******",
- "pool_size": 8,
- "redis_type": "single",
- "resource_opts": {
- "batch_size": 1,
- "batch_time": "20ms"
}, - "server": "127.0.0.1:6379",
- "ssl": {
- "enable": false
}, - "type": "redis_single"
}, - {
- "direction": "egress",
- "name": "demo",
- "pool_size": 8,
- "record_template": "{ \"temperature\": ${payload.temperature}, \"humidity\": ${payload.humidity} }",
- "resource_opts": {
- "batch_size": 100,
- "batch_time": "20ms",
- "query_mode": "sync"
}, - "ssl": {
- "enable": false
}, - "stream": "stream",
- "type": "hstreamdb",
}, - {
- "database": "mqtt",
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "sync",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:6041",
- "sql": "insert into t_mqtt_msg(ts, msgid, mqtt_topic, qos, payload, arrived) values (${ts}, '${id}', '${topic}', ${qos}, '${payload}', ${timestamp})",
- "type": "tdengine",
- "username": "root"
}, - {
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "sync",
- "worker_pool_size": 1
}, - "server": "127.0.0.1:9876",
- "template": "",
- "topic": "TopicTest",
- "type": "rocketmq"
}, - {
- "authentication": {
- "password": "*****",
- "username": "root"
}, - "connect_timeout": "15s",
- "device_id": "my_device",
- "enable": true,
- "enable_pipelining": 100,
- "iotdb_version": "v1.1.x",
- "is_aligned": false,
- "name": "My IoTDB Bridge",
- "pool_size": 8,
- "pool_type": "random",
- "resource_opts": {
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "ssl": {
- "enable": false
}, - "type": "iotdb"
}, - {
- "bucket": "example_bucket",
- "enable": true,
- "influxdb_type": "influxdb_api_v2",
- "local_topic": "local/topic/#",
- "name": "demo",
- "org": "examlpe_org",
- "precision": "ms",
- "resource_opts": {
- "batch_size": 100,
- "batch_time": "20ms"
}, - "server": "127.0.0.1:8086",
- "ssl": {
- "enable": false
}, - "token": "example_token",
- "type": "influxdb_api_v2",
- "write_syntax": "${topic},clientid=${clientid} payload=${payload},${clientid}_int_value=${payload.int_key}i,uint_value=${payload.uint_key}u,bool=${payload.bool}"
}, - {
- "aws_access_key_id": "root",
- "aws_secret_access_key": "******",
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "sync",
- "worker_pool_size": 8
}, - "table": "mqtt",
- "template": "",
- "type": "dynamo",
}, - {
- "database": "mqtt",
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:5432",
- "sql": "insert into t_mqtt_msg(msgid, topic, qos, payload, arrived) values (${id}, ${topic}, ${qos}, ${payload}, TO_TIMESTAMP((${timestamp} :: bigint)/1000))",
- "status": "connected",
- "type": "timescale",
- "username": "root"
}, - {
- "collection": "mycol",
- "database": "mqtt",
- "enable": true,
- "mongo_type": "rs",
- "name": "mongodb_rs_demo",
- "password": "******",
- "pool_size": 8,
- "r_mode": "safe",
- "replica_set_name": "rs",
- "servers": "localhost:27017, localhost:27018",
- "srv_record": false,
- "type": "mongodb_rs",
- "username": "myuser",
- "w_mode": "safe"
}, - {
- "dbname": "example_db",
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "demo",
- "password": "******",
- "precision": "ms",
- "resource_opts": {
- "batch_size": 100,
- "batch_time": "20ms"
}, - "server": "127.0.0.1:4001",
- "ssl": {
- "enable": false
}, - "type": "greptimedb",
- "username": "example_username",
- "write_syntax": "${topic},clientid=${clientid} payload=${payload},${clientid}_int_value=${payload.int_key}i,uint_value=${payload.uint_key}u,bool=${payload.bool}"
}, - {
- "batch_value_separator": ", ",
- "database": "mqtt",
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "sql": "INSERT INTO messages(data, arrived) VALUES ('${payload}', ${timestamp})",
- "type": "clickhouse",
- "username": "default"
}, - {
- "command_template": [
- "LPUSH",
- "MSGS",
- "${payload}"
], - "database": 1,
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "redis_bridge",
- "password": "******",
- "pool_size": 8,
- "redis_type": "sentinel",
- "resource_opts": {
- "batch_size": 1,
- "batch_time": "20ms"
}, - "sentinel": "mymaster",
- "servers": [
- "127.0.0.1:26379"
], - "ssl": {
- "enable": false
}, - "type": "redis_sentinel"
}, - {
- "connect_timeout": "15s",
- "consumer": {
- "pull_max_messages": 100,
- "topic_mapping": [
- {
- "mqtt_topic": "mqtt/topic/1",
- "payload_template": "${.}",
- "pubsub_topic": "pubsub-topic-1",
- "qos": 1
}, - {
- "mqtt_topic": "mqtt/topic/2",
- "payload_template": "v = ${.value}, a = ${.attributes}, o = ${.ordering_key}",
- "pubsub_topic": "pubsub-topic-2",
- "qos": 2
}
]
}, - "resource_opts": {
- "request_ttl": "20s"
}, - "service_account_json": {
- "client_email": "test@myproject.iam.gserviceaccount.com",
- "client_id": "123812831923812319190",
- "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test%40myproject.iam.gserviceaccount.com",
- "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQI...",
- "private_key_id": "kid",
- "project_id": "myproject",
- "type": "service_account"
}
}, - {
- "auto_reconnect": "2s",
- "durable": false,
- "enable": true,
- "exchange": "messages",
- "exchange_type": "topic",
- "heartbeat": "30s",
- "name": "foo",
- "password": "******",
- "payload_template": "",
- "pool_size": 8,
- "port": 5672,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "routing_key": "my_routing_key",
- "server": "localhost",
- "timeout": 5,
- "type": "rabbitmq",
- "username": "guest",
- "virtual_host": "/"
}, - {
- "body": "${payload}",
- "connect_timeout": "15s",
- "enable": true,
- "enable_pipelining": 100,
- "local_topic": "emqx_http/#",
- "max_retries": 3,
- "method": "post",
- "name": "http_example",
- "pool_size": 4,
- "pool_type": "random",
- "request_timeout": "15s",
- "resource_opts": {
- "health_check_interval": 15000,
- "inflight_window": 100,
- "max_buffer_bytes": 104857600,
- "query_mode": "async",
- "worker_pool_size": 1
}, - "ssl": {
- "enable": false
}, - "type": "http",
}, - {
- "cql": "insert into mqtt_msg(msgid, topic, qos, payload, arrived) values (${id}, ${topic}, ${qos}, ${payload}, ${timestamp})",
- "enable": true,
- "keyspace": "mqtt",
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "sync",
- "worker_pool_size": 8
}, - "servers": "127.0.0.1:9042",
- "type": "cassandra",
- "username": "root"
}, - {
- "command_template": [
- "LPUSH",
- "MSGS",
- "${payload}"
], - "enable": true,
- "local_topic": "local/topic/#",
- "name": "redis_bridge",
- "password": "******",
- "pool_size": 8,
- "redis_type": "cluster",
- "resource_opts": { },
- "servers": [
- "127.0.0.1:6379"
], - "ssl": {
- "enable": false
}, - "type": "redis_cluster"
}, - {
- "collection": "mycol",
- "database": "mqtt",
- "enable": true,
- "mongo_type": "sharded",
- "name": "mongodb_sharded_demo",
- "password": "******",
- "pool_size": 8,
- "servers": "localhost:27017, localhost:27018",
- "srv_record": false,
- "type": "mongodb_sharded",
- "username": "myuser",
- "w_mode": "safe"
}, - {
- "database": "example_database",
- "enable": true,
- "influxdb_type": "influxdb_api_v1",
- "local_topic": "local/topic/#",
- "name": "demo",
- "password": "******",
- "precision": "ms",
- "resource_opts": {
- "batch_size": 100,
- "batch_time": "20ms"
}, - "server": "127.0.0.1:8086",
- "ssl": {
- "enable": false
}, - "type": "influxdb_api_v1",
- "username": "example_username",
- "write_syntax": "${topic},clientid=${clientid} payload=${payload},${clientid}_int_value=${payload.int_key}i,bool=${payload.bool}"
}, - {
- "aws_access_key_id": "aws_access_key_id",
- "aws_secret_access_key": "******",
- "enable": true,
- "max_retries": 3,
- "name": "foo",
- "partition_key": "key",
- "resource_opts": {
- "health_check_interval": 15000,
- "inflight_window": 100,
- "max_buffer_bytes": 104857600,
- "query_mode": "async",
- "worker_pool_size": 1
}, - "stream_name": "stream_name",
- "type": "kinesis_producer"
}, - {
- "collection": "mycol",
- "database": "mqtt",
- "enable": true,
- "mongo_type": "single",
- "name": "mongodb_single_demo",
- "password": "******",
- "pool_size": 8,
- "server": "localhost:27017",
- "srv_record": false,
- "type": "mongodb_single",
- "username": "myuser",
- "w_mode": "safe"
}, - {
- "database": "mqtt",
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:5432",
- "sql": "insert into t_mqtt_msg(msgid, topic, qos, payload, arrived) values (${id}, ${topic}, ${qos}, ${payload}, TO_TIMESTAMP((${timestamp} :: bigint)/1000))",
- "status": "connected",
- "type": "pgsql",
- "username": "root"
}, - {
- "authentication": {
- "mechanism": "plain",
- "password": "******",
- "username": "username"
}, - "bootstrap_hosts": "localhost:9092",
- "connect_timeout": "5s",
- "enable": true,
- "kafka": {
- "buffer": {
- "memory_overload_protection": true,
- "mode": "hybrid",
- "per_partition_limit": "2GB",
- "segment_bytes": "10MB"
}, - "compression": "no_compression",
- "kafka_ext_headers": [
- {
- "kafka_ext_header_key": "clientid",
- "kafka_ext_header_value": "${clientid}"
}, - {
- "kafka_ext_header_key": "topic",
- "kafka_ext_header_value": "${topic}"
}
], - "kafka_header_value_encode_mode": "none",
- "kafka_headers": "${pub_props}",
- "max_batch_bytes": "896KB",
- "max_inflight": 10,
- "max_linger_bytes": "10MB",
- "max_linger_time": "5ms",
- "message": {
- "key": "${.clientid}",
- "timestamp": "${.timestamp}",
- "value": "${.}"
}, - "partition_count_refresh_interval": "60s",
- "partition_strategy": "random",
- "partitions_limit": "all_partitions",
- "required_acks": "all_isr",
- "topic": "kafka-topic"
}, - "local_topic": "mqtt/local/topic",
- "metadata_request_timeout": "4s",
- "min_metadata_refresh_interval": "3s",
- "name": "my_kafka_producer_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "socket_opts": {
- "nodelay": true,
- "recbuf": "1024KB",
- "sndbuf": "1024KB",
- "tcp_keepalive": "none"
}, - "status": "connected",
- "type": "kafka_producer"
}, - {
- "database": "test",
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 1
}, - "server": "127.0.0.1:3306",
- "sql": "insert into t_mqtt_msg(msgid, topic, qos, payload, arrived) values (${id}, ${topic}, ${qos}, ${payload}, FROM_UNIXTIME(${timestamp}/1000))",
- "type": "mysql",
- "username": "root"
}, - {
- "authentication": "none",
- "batch_size": 1,
- "buffer": {
- "memory_overload_protection": true,
- "mode": "memory",
- "per_partition_limit": "10MB",
- "segment_bytes": "5MB"
}, - "compression": "no_compression",
- "enable": true,
- "local_topic": "mqtt/topic/-576460752303423482",
- "max_batch_bytes": "900KB",
- "message": {
- "key": "${.clientid}",
- "value": "${.}"
}, - "name": "pulsar_example_name",
- "pulsar_topic": "pulsar_example_topic",
- "retention_period": "infinity",
- "send_buffer": "1MB",
- "servers": "pulsar://127.0.0.1:6650",
- "ssl": {
- "enable": false,
- "server_name_indication": "auto",
- "verify": "verify_none"
}, - "strategy": "key_dispatch",
- "sync_timeout": "5s",
- "type": "pulsar_producer"
}, - {
- "database": "mqtt",
- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:5432",
- "sql": "insert into t_mqtt_msg(msgid, topic, qos, payload, arrived) values (${id}, ${topic}, ${qos}, ${payload}, TO_TIMESTAMP((${timestamp} :: bigint)/1000))",
- "status": "connected",
- "type": "matrix",
- "username": "root"
}, - {
- "authentication": {
- "password": "******"
}, - "bootstrap_hosts": "namespace.servicebus.windows.net:9093",
- "connect_timeout": "5s",
- "enable": true,
- "local_topic": "mqtt/local/topic",
- "metadata_request_timeout": "4s",
- "min_metadata_refresh_interval": "3s",
- "name": "my_azure_event_hub_producer",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "buffer": {
- "memory_overload_protection": true,
- "mode": "hybrid",
- "per_partition_limit": "2GB",
- "segment_bytes": "100MB"
}, - "kafka_ext_headers": [
- {
- "kafka_ext_header_key": "clientid",
- "kafka_ext_header_value": "${clientid}"
}, - {
- "kafka_ext_header_key": "topic",
- "kafka_ext_header_value": "${topic}"
}
], - "kafka_header_value_encode_mode": "none",
- "kafka_headers": "${.pub_props}",
- "max_batch_bytes": "896KB",
- "max_inflight": 10,
- "max_linger_bytes": "10MB",
- "max_linger_time": "5ms",
- "message": {
- "key": "${.clientid}",
- "value": "${.}"
}, - "partition_count_refresh_interval": "60s",
- "partition_strategy": "random",
- "required_acks": "all_isr",
- "topic": "topic"
}, - "socket_opts": {
- "nodelay": true,
- "recbuf": "1024KB",
- "sndbuf": "1024KB",
- "tcp_keepalive": "none"
}, - "status": "connected",
- "type": "azure_event_hub_producer"
}, - {
- "enabledb": true,
- "name": "foo",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 1
}, - "type": "opents"
}, - {
- "pubsub_topic": "mytopic",
- "service_account_json": {
- "client_email": "test@myproject.iam.gserviceaccount.com",
- "client_id": "123812831923812319190",
- "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test%40myproject.iam.gserviceaccount.com",
- "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQI...",
- "private_key_id": "kid",
- "project_id": "myproject",
- "type": "service_account"
}
}, - {
- "clean_start": true,
- "egress": {
- "local": {
- "topic": "emqx/#"
}, - "remote": {
- "payload": "${payload}",
- "qos": "${qos}",
- "retain": false,
- "topic": "from_emqx/${topic}"
}
}, - "enable": true,
- "ingress": {
- "local": {
- "payload": "${payload}",
- "qos": "${qos}",
- "retain": "${retain}",
- "topic": "from_aws/${topic}"
}, - "remote": {
- "qos": 1,
- "topic": "aws/#"
}
}, - "keepalive": "300s",
- "max_inflight": 100,
- "name": "mqtt_example",
- "password": "******",
- "proto_ver": "v4",
- "resource_opts": {
- "health_check_interval": "15s",
- "max_buffer_bytes": 104857600,
- "query_mode": "sync"
}, - "retry_interval": "15s",
- "server": "127.0.0.1:1883",
- "ssl": {
- "enable": false
}, - "type": "mqtt",
- "username": "foo"
}, - {
- "authentication": {
- "mechanism": "plain",
- "password": "******",
- "username": "username"
}, - "bootstrap_hosts": "localhost:9092",
- "connect_timeout": "5s",
- "enable": true,
- "kafka": {
- "max_batch_bytes": "896KB",
- "offset_commit_interval_seconds": 5,
- "offset_reset_policy": "latest"
}, - "key_encoding_mode": "none",
- "metadata_request_timeout": "4s",
- "min_metadata_refresh_interval": "3s",
- "name": "my_kafka_producer_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "socket_opts": {
- "nodelay": true,
- "recbuf": "1024KB",
- "sndbuf": "1024KB",
- "tcp_keepalive": "none"
}, - "status": "connected",
- "topic_mapping": [
- {
- "kafka_topic": "kafka-topic-1",
- "mqtt_topic": "mqtt/topic/${.offset}",
- "payload_template": "${.}",
- "qos": 1
}, - {
- "kafka_topic": "kafka-topic-2",
- "mqtt_topic": "mqtt/topic/2",
- "payload_template": "v = ${.value}",
- "qos": 2
}
], - "type": "kafka_producer",
- "value_encoding_mode": "none"
}
]
Create a new bridge by type and name
bridge_kafka.auth_gssapi_kerberos (object) or bridge_kafka.auth_username_password (object) or string Default: "none" Authentication configs. | |
bootstrap_hosts required | string A comma separated list of Kafka |
connect_timeout | string Default: "5s" Maximum wait time for TCP connection establishment (including authentication time if enabled). |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this connector. |
health_check_topic | string Topic name used exclusively for more accurate connector health checks. |
object (bridge_kafka.consumer_kafka_opts) | |
key_encoding_mode | string Default: "none" Enum: "none" "base64" Defines how the key from the Kafka message is encoded before being forwarded via MQTT. |
metadata_request_timeout | string Default: "5s" Maximum wait time when fetching topic metadata. |
min_metadata_refresh_interval | string Default: "3s" Minimum time interval the client has to wait before refreshing Kafka broker and topic metadata. Setting too small value may add extra load on Kafka. |
name required | string Action name, used as a human-readable identifier. |
object (bridge_kafka.connector_resource_opts) | |
object (bridge_kafka.socket_opts) | |
object (bridge_kafka.ssl_client_opts) | |
tags | Array of strings Tags to annotate this config entry. |
required | Array of objects (bridge_kafka.consumer_topic_mapping) Defines the mapping between Kafka topics and MQTT topics. Must contain at least one item. |
type required | string Enum: "kafka" "kafka_producer" "kafka_consumer" The Action Type |
value_encoding_mode | string Default: "none" Enum: "none" "base64" Defines how the value from the Kafka message is encoded before being forwarded via MQTT. |
{- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:1521",
- "service_name": "ORCL",
- "sid": "ORCL",
- "sql": "insert into t_mqtt_msgs(msgid, topic, qos, payload) values (${id}, ${topic}, ${qos}, ${payload})",
- "type": "oracle",
- "username": "root"
}
{- "enable": true,
- "local_topic": "local/topic/#",
- "name": "foo",
- "password": "******",
- "pool_size": 8,
- "resource_opts": {
- "batch_size": 1,
- "batch_time": 0,
- "health_check_interval": "15s",
- "max_buffer_bytes": 268435456,
- "query_mode": "async",
- "worker_pool_size": 8
}, - "server": "127.0.0.1:1521",
- "service_name": "ORCL",
- "sid": "ORCL",
- "sql": "insert into t_mqtt_msgs(msgid, topic, qos, payload) values (${id}, ${topic}, ${qos}, ${payload})",
- "type": "oracle",
- "username": "root"
}
Get bridge metrics by Id
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
{- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "failed": 0,
- "inflight": 0,
- "matched": 0,
- "queuing": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0,
- "received": 0,
- "retried": 0,
- "success": 0
}, - "node_metrics": [
- {
- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "failed": 0,
- "inflight": 0,
- "matched": 0,
- "queuing": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0,
- "received": 0,
- "retried": 0,
- "success": 0
}, - "node": "emqx@127.0.0.1"
}
]
}
Stop/Restart bridges on all nodes in the cluster.
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
operation required | string Enum: "start" "stop" "restart" Example: start Operations can be one of: stop, restart |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Enable or Disable bridges on all nodes in the cluster.
id required | string Example: http:http_example The bridge Id. Must be of format {type}:{name} |
enable required | boolean Example: true Whether to enable this bridge |
{- "code": "BAD_REQUEST",
- "message": "string"
}
[- {
- "connector": "elasticsearch_connector",
- "description": "My example elasticsearch action",
- "enable": true,
- "name": "elasticsearch_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "action": "create",
- "doc": "${payload.doc}",
- "index": "${payload.index}",
- "overwrite": true
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "elasticsearch"
}, - {
- "connector": "oracle_connector",
- "description": "My example oracle action",
- "enable": true,
- "name": "oracle_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "sql": "insert into t_mqtt_msgs(msgid, topic, qos, payload) values (${id}, ${topic}, ${qos}, ${payload})"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "oracle"
}, - {
- "connector": "sqlserver_connector",
- "description": "My example sqlserver action",
- "enable": true,
- "name": "sqlserver_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "sql": "insert into t_mqtt_msg(msgid, topic, qos, payload) values ( ${id}, ${topic}, ${qos}, ${payload} )"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "sqlserver"
}, - {
- "connector": "hstreamdb_connector",
- "description": "My example hstreamdb action",
- "enable": true,
- "name": "hstreamdb_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "aggregation_pool_size": 8,
- "partition_key": "hej",
- "record_template": "${payload}",
- "stream": "mqtt_message",
- "writer_pool_size": 8
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "hstreamdb"
}, - {
- "connector": "tdengine_connector",
- "description": "My example tdengine action",
- "enable": true,
- "name": "tdengine_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "database": "mqtt",
- "sql": "insert into t_mqtt_msg(ts, msgid, mqtt_topic, qos, payload, arrived) values (${ts}, '${id}', '${topic}', ${qos}, '${payload}', ${timestamp})"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "tdengine"
}, - {
- "connector": "rocketmq_connector",
- "description": "My example rocketmq action",
- "enable": true,
- "name": "rocketmq_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "refresh_interval": "3s",
- "send_buffer": "1024KB",
- "sync_timeout": "3s",
- "template": "",
- "topic": "TopicTest"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "rocketmq"
}, - {
- "connector": "iotdb_connector",
- "description": "My example iotdb action",
- "enable": true,
- "name": "iotdb_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "data": [
- {
- "data_type": "BOOLEAN",
- "measurement": "status",
- "timestamp": "now",
- "value": "${st}"
}
], - "device_id": "my_device",
- "is_aligned": false
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "iotdb"
}, - {
- "connector": "dynamo_connector",
- "description": "My example dynamo action",
- "enable": true,
- "name": "dynamo_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "hash_key": "clientid",
- "table": "mqtt_msg",
- "template": ""
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "dynamo"
}, - {
- "connector": "my_connector",
- "enable": true,
- "name": "my_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "sql": "INSERT INTO client_events(clientid, event, created_at)VALUES (\n ${clientid},\n ${event},\n TO_TIMESTAMP((${timestamp} :: bigint))\n)"
}, - "resource_opts": {
- "batch_size": 1,
- "batch_time": "50ms",
- "inflight_window": 100,
- "max_buffer_bytes": "256MB",
- "request_ttl": "45s",
- "worker_pool_size": 16
}, - "status": "connected",
- "type": "timescale"
}, - {
- "connector": "my_connector",
- "description": "my action",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "sql": "insert into mqtt (key, value) values (${.id}, ${.payload})"
}, - "resource_opts": {
- "health_check_interval": "30s",
- "inflight_window": 100,
- "query_mode": "sync",
- "request_ttl": "45s",
- "worker_pool_size": 16
}, - "status": "connected"
}, - {
- "connector": "mqtt_connector",
- "description": "My example mqtt action",
- "enable": true,
- "name": "mqtt_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "payload": "${.payload}",
- "qos": 2,
- "retain": false,
- "topic": "remote/topic"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "mqtt"
}, - {
- "connector": "greptimedb_connector",
- "description": "My example greptimedb action",
- "enable": true,
- "name": "greptimedb_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "precision": "ms",
- "write_syntax": "${topic},clientid=${clientid} payload=${payload},${clientid}_int_value=${payload.int_key}i,uint_value=${payload.uint_key}u,bool=${payload.bool}"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "greptimedb"
}, - {
- "connector": "my_s3_connector",
- "description": "My upload action",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "acl": "public_read",
- "bucket": "${clientid}",
- "content": "${payload}",
- "key": "${topic}",
- "mode": "direct"
}, - "resource_opts": {
- "inflight_window": 10,
- "query_mode": "sync"
}, - "status": "connected"
}, - {
- "connector": "my_connector",
- "description": "my action",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "blob": "${.payload.blob}",
- "container": "${.payload.container}",
- "content": "${.payload}",
- "mode": "direct"
}, - "resource_opts": {
- "batch_size": 1,
- "batch_time": "0ms",
- "health_check_interval": "30s",
- "inflight_window": 100,
- "query_mode": "sync",
- "request_ttl": "45s",
- "worker_pool_size": 16
}, - "status": "connected"
}, - {
- "connector": "clickhouse_connector",
- "description": "My example clickhouse action",
- "enable": true,
- "name": "clickhouse_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "batch_value_separator": ", ",
- "sql": "INSERT INTO messages(data, arrived) VALUES ('${payload}', ${timestamp})"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "clickhouse"
}, - {
- "connector": "my_connector",
- "description": "my action",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "aggregation": {
- "container": {
- "column_order": [
- "a",
- "b"
], - "type": "csv"
}, - "max_records": 10000,
- "time_interval": "4s"
}, - "blob": "${action}/${node}/${datetime.rfc3339}/${sequence}",
- "container": "mycontainer",
- "mode": "aggregated"
}, - "resource_opts": {
- "batch_size": 100,
- "batch_time": "10ms",
- "health_check_interval": "30s",
- "inflight_window": 100,
- "query_mode": "sync",
- "request_ttl": "45s",
- "worker_pool_size": 16
}, - "status": "connected"
}, - {
- "connector": "influxdb_connector",
- "description": "My example influxdb action",
- "enable": true,
- "name": "influxdb_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "precision": "ms",
- "write_syntax": "${topic},clientid=${clientid} payload=${payload},${clientid}_int_value=${payload.int_key}i,bool=${payload.bool}"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "influxdb"
}, - {
- "connector": "my_connector_name",
- "description": "My action",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "command_template": [
- "LPUSH",
- "MSGS",
- "${payload}"
]
}, - "resource_opts": {
- "batch_size": 1
}, - "status": "connected"
}, - {
- "connector": "my_s3_connector",
- "description": "My aggregated upload action",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "acl": "public_read",
- "aggregation": {
- "max_records": 100000,
- "time_interval": "15m"
}, - "bucket": "mqtt-aggregated",
- "container": {
- "column_order": [
- "clientid",
- "topic",
- "publish_received_at"
], - "type": "csv"
}, - "key": "${action}/${node}/${datetime.rfc3339utc}_N${sequence}.csv",
- "mode": "aggregated"
}, - "resource_opts": {
- "health_check_interval": "10s",
- "inflight_window": 100,
- "query_mode": "async"
}, - "status": "connected"
}, - {
- "connector": "rabbitmq_connector",
- "description": "My example rabbitmq action",
- "enable": true,
- "name": "rabbitmq_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "delivery_mode": "non_persistent",
- "exchange": "test_exchange",
- "payload_template": "${.payload}",
- "publish_confirmation_timeout": "30s",
- "routing_key": "/",
- "wait_for_publish_confirmations": true
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "rabbitmq"
}, - {
- "connector": "cassandra_connector",
- "description": "My example cassandra action",
- "enable": true,
- "name": "cassandra_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "cql": "insert into mqtt_msg(msgid, topic, qos, payload, arrived) values (${id}, ${topic}, ${qos}, ${payload}, ${timestamp})"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "cassandra"
}, - {
- "connector": "syskeeper_forwarder",
- "enable": true,
- "name": "syskeeper_forwarder",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "target_topic": "${topic}",
- "template": "${payload}"
}, - "resource_opts": {
- "worker_pool_size": 16
}, - "status": "connected",
- "type": "syskeeper_forwarder"
}, - {
- "connector": "my_http_connector",
- "enable": true,
- "name": "my_http_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "body": "${.}",
- "headers": { },
- "method": "post",
- "path": "/room/${room_no}"
}, - "resource_opts": {
- "health_check_interval": "15s",
- "query_mode": "async",
- "worker_pool_size": 16
}, - "status": "connected",
- "type": "http"
}, - {
- "connector": "my_connector",
- "description": "my action",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "aggregation": {
- "container": {
- "type": "csv"
}, - "max_records": 1000,
- "time_interval": "60s"
}, - "connect_timeout": "15s",
- "database": "testdatabase",
- "max_retries": 3,
- "mode": "aggregated",
- "pipe": "testpipe",
- "pipe_user": "pipeuser",
- "pipelining": 100,
- "pool_size": 16,
- "private_key": "file:///path/to/secret.pem",
- "schema": "public",
- "stage": "teststage"
}, - "resource_opts": {
- "batch_size": 10000,
- "batch_time": "60s",
- "health_check_interval": "30s",
- "inflight_window": 100,
- "query_mode": "sync",
- "request_ttl": "45s",
- "worker_pool_size": 16
}, - "status": "connected"
}, - {
- "connector": "my_connector_name",
- "description": "My action",
- "enable": true,
- "local_topic": "local/topic",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "attributes_template": [
- {
- "key": "${payload.attrs.k}",
- "value": "${payload.attrs.v}"
}
], - "ordering_key_template": "${payload.ok}",
- "payload_template": "${payload}",
- "pubsub_topic": "mytopic"
}, - "resource_opts": {
- "batch_size": 5
}, - "status": "connected"
}, - {
- "connector": "mongodb_connector",
- "description": "My example mongodb action",
- "enable": true,
- "name": "mongodb_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "collection": "mycol"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "mongodb"
}, - {
- "connector": "datalayers_connector",
- "description": "My example datalayers action",
- "enable": true,
- "name": "datalayers_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "precision": "ms",
- "write_syntax": "${topic},clientid=${clientid} payload=${payload},${clientid}_int_value=${payload.int_key}i,bool=${payload.bool}"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "datalayers"
}, - {
- "connector": "pulsar_connector",
- "description": "My example pulsar action",
- "enable": true,
- "name": "pulsar_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "message": {
- "key": "${.clientid}",
- "value": "${.}"
}, - "pulsar_topic": "test_topic",
- "sync_timeout": "5s"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "pulsar"
}, - {
- "connector": "kinesis_connector",
- "description": "My example kinesis action",
- "enable": true,
- "name": "kinesis_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "partition_key": "any_key",
- "payload_template": "${.}",
- "stream_name": "my_stream"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "kinesis"
}, - {
- "connector": "my_connector",
- "enable": true,
- "name": "my_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "sql": "INSERT INTO client_events(clientid, event, created_at)VALUES (\n ${clientid},\n ${event},\n TO_TIMESTAMP((${timestamp} :: bigint))\n)"
}, - "resource_opts": {
- "batch_size": 1,
- "batch_time": "50ms",
- "inflight_window": 100,
- "max_buffer_bytes": "256MB",
- "request_ttl": "45s",
- "worker_pool_size": 16
}, - "status": "connected",
- "type": "pgsql"
}, - {
- "connector": "my_kafka_producer_connector",
- "enable": true,
- "local_topic": "mqtt/local/topic",
- "name": "my_kafka_producer_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "buffer": {
- "memory_overload_protection": true,
- "mode": "hybrid",
- "per_partition_limit": "2GB",
- "segment_bytes": "10MB"
}, - "compression": "no_compression",
- "kafka_ext_headers": [
- {
- "kafka_ext_header_key": "clientid",
- "kafka_ext_header_value": "${clientid}"
}, - {
- "kafka_ext_header_key": "topic",
- "kafka_ext_header_value": "${topic}"
}
], - "kafka_header_value_encode_mode": "none",
- "kafka_headers": "${pub_props}",
- "max_batch_bytes": "896KB",
- "max_inflight": 10,
- "max_linger_bytes": "10MB",
- "max_linger_time": "5ms",
- "message": {
- "key": "${.clientid}",
- "timestamp": "${.timestamp}",
- "value": "${.}"
}, - "partition_count_refresh_interval": "60s",
- "partition_strategy": "random",
- "partitions_limit": "all_partitions",
- "required_acks": "all_isr",
- "topic": "kafka-topic"
}, - "resource_opts": {
- "health_check_interval": "32s"
}, - "status": "connected",
- "type": "kafka_producer"
}, - {
- "connector": "mysql_connector",
- "description": "My example mysql action",
- "enable": true,
- "name": "mysql_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "sql": "insert into t_mqtt_msg(msgid, topic, qos, payload, arrived) values (${id}, ${topic}, ${qos}, ${payload}, FROM_UNIXTIME(${timestamp}/1000))"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "mysql"
}, - {
- "connector": "my_confluent_producer_connector",
- "enable": true,
- "local_topic": "mqtt/local/topic",
- "name": "my_confluent_producer_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "buffer": {
- "memory_overload_protection": true,
- "mode": "hybrid",
- "per_partition_limit": "2GB",
- "segment_bytes": "100MB"
}, - "kafka_ext_headers": [
- {
- "kafka_ext_header_key": "clientid",
- "kafka_ext_header_value": "${clientid}"
}, - {
- "kafka_ext_header_key": "topic",
- "kafka_ext_header_value": "${topic}"
}
], - "kafka_header_value_encode_mode": "none",
- "kafka_headers": "${.pub_props}",
- "max_batch_bytes": "896KB",
- "max_inflight": 10,
- "max_linger_bytes": "10MB",
- "max_linger_time": "5ms",
- "message": {
- "key": "${.clientid}",
- "value": "${.}"
}, - "partition_count_refresh_interval": "60s",
- "partition_strategy": "random",
- "required_acks": "all_isr",
- "topic": "topic"
}, - "status": "connected",
- "type": "confluent_producer"
}, - {
- "connector": "my_connector",
- "enable": true,
- "name": "my_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "sql": "INSERT INTO client_events(clientid, event, created_at)VALUES (\n ${clientid},\n ${event},\n TO_TIMESTAMP((${timestamp} :: bigint))\n)"
}, - "resource_opts": {
- "batch_size": 1,
- "batch_time": "50ms",
- "inflight_window": 100,
- "max_buffer_bytes": "256MB",
- "request_ttl": "45s",
- "worker_pool_size": 16
}, - "status": "connected",
- "type": "matrix"
}, - {
- "connector": "my_azure_event_hub_producer_connector",
- "enable": true,
- "local_topic": "mqtt/local/topic",
- "name": "my_azure_event_hub_producer_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "buffer": {
- "memory_overload_protection": true,
- "mode": "hybrid",
- "per_partition_limit": "2GB",
- "segment_bytes": "100MB"
}, - "kafka_ext_headers": [
- {
- "kafka_ext_header_key": "clientid",
- "kafka_ext_header_value": "${clientid}"
}, - {
- "kafka_ext_header_key": "topic",
- "kafka_ext_header_value": "${topic}"
}
], - "kafka_header_value_encode_mode": "none",
- "kafka_headers": "${.pub_props}",
- "max_batch_bytes": "896KB",
- "max_inflight": 10,
- "max_linger_bytes": "10MB",
- "max_linger_time": "5ms",
- "message": {
- "key": "${.clientid}",
- "value": "${.}"
}, - "partition_count_refresh_interval": "60s",
- "partition_strategy": "random",
- "required_acks": "all_isr",
- "topic": "topic"
}, - "status": "connected",
- "type": "azure_event_hub_producer"
}, - {
- "connector": "tablestore_connector",
- "description": "My example tablestore action",
- "enable": true,
- "name": "tablestore_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "data_source": "${data_source}",
- "fields": [
- {
- "column": "${column}",
- "isint": true,
- "value": "${value}"
}
], - "measurement": "${measurement}",
- "meta_update_model": "MUM_IGNORE",
- "storage_model_type": "timeseries",
- "table_name": "table_name",
- "tags": {
- "tag1": "${tag1}",
- "tag2": "${tag2}"
}
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "tablestore"
}, - {
- "connector": "opents_connector",
- "description": "My example opents action",
- "enable": true,
- "name": "opents_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "data": [
- {
- "metric": "${metric}",
- "tags": "${tags}",
- "value": "${value}"
}
]
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "opents"
}, - {
- "connector": "my_connector",
- "description": "my action",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "template": "${.}",
- "write_mode": "sync"
}, - "resource_opts": {
- "batch_size": 10000,
- "batch_time": "60s",
- "health_check_interval": "30s",
- "inflight_window": 100,
- "query_mode": "sync",
- "request_ttl": "45s",
- "worker_pool_size": 16
}, - "status": "connected"
}
]
Create a new bridge by type and name.
connector required | string Name of the connector specified by the action, used for external resource selection. |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this action. |
Array of actions_and_sources.fallback_action_republish (object) or actions_and_sources.fallback_action_reference (object) Default: [] List of fallback actions that will be triggered if a query to this action fails. | |
local_topic | string MQTT topic or topic filter as data source (action input). If rule action is used as data source, this config should be left empty, otherwise messages will be duplicated in the remote system. |
name required | string |
required | object (action_disk_log.action_parameters) |
object (actions_and_sources.action_resource_opts) | |
tags | Array of strings Tags to annotate this config entry. |
type required | string Value: "disk_log" |
{- "connector": "elasticsearch_connector",
- "description": "My example elasticsearch action",
- "enable": true,
- "name": "elasticsearch_action",
- "parameters": {
- "action": "create",
- "doc": "${payload.doc}",
- "index": "${payload.index}",
- "overwrite": true
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "type": "elasticsearch"
}
{- "connector": "elasticsearch_connector",
- "description": "My example elasticsearch action",
- "enable": true,
- "name": "elasticsearch_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "action": "create",
- "doc": "${payload.doc}",
- "index": "${payload.index}",
- "overwrite": true
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "elasticsearch"
}
[- {
- "created_at": 1736512728666,
- "enable": true,
- "last_modified_at": 1736512728666,
- "name": "myAction",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "connected",
- "status_reason": ""
}
], - "rules": [
- "rule1",
- "rule2"
], - "status": "connected",
- "status_reason": "",
- "type": "action_type"
}
]
Lists the available action types.
[- "http",
- "rocketmq",
- "rabbitmq",
- "cassandra",
- "mongodb",
- "iotdb",
- "influxdb",
- "kafka_producer",
- "syskeeper_forwarder",
- "sqlserver",
- "confluent_producer",
- "pulsar",
- "azure_event_hub_producer",
- "gcp_pubsub_producer",
- "greptimedb",
- "hstreamdb",
- "kinesis",
- "redis",
- "s3",
- "opents",
- "datalayers",
- "mqtt",
- "snowflake",
- "couchbase",
- "azure_blob_storage",
- "tdengine",
- "timescale",
- "tablestore",
- "oracle",
- "clickhouse",
- "disk_log",
- "matrix",
- "elasticsearch",
- "pgsql",
- "mysql",
- "dynamo"
]
Enable or Disable bridge on all nodes in the cluster.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
enable required | boolean Example: true Whether to enable this bridge. |
{- "code": "NOT_FOUND",
- "message": "string"
}
Start bridge on all nodes in the cluster.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Start bridge on a specific node.
node required | |
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Delete a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
also_delete_dep_actions | boolean Default: false Whether to cascade delete dependent actions. |
{- "code": "BAD_REQUEST",
- "message": "string",
- "rules": [
- "string"
]
}
Get a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
{- "connector": "elasticsearch_connector",
- "description": "My example elasticsearch action",
- "enable": true,
- "name": "elasticsearch_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "action": "create",
- "doc": "${payload.doc}",
- "index": "${payload.index}",
- "overwrite": true
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "elasticsearch"
}
Update a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
connector required | string Name of the connector specified by the action, used for external resource selection. |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this action. |
Array of actions_and_sources.fallback_action_republish (object) or actions_and_sources.fallback_action_reference (object) Default: [] List of fallback actions that will be triggered if a query to this action fails. | |
local_topic | string MQTT topic or topic filter as data source (action input). If rule action is used as data source, this config should be left empty, otherwise messages will be duplicated in the remote system. |
required | object (action_disk_log.action_parameters) |
object (actions_and_sources.action_resource_opts) | |
tags | Array of strings Tags to annotate this config entry. |
{- "connector": "elasticsearch_connector",
- "description": "My example elasticsearch action",
- "enable": true,
- "parameters": {
- "action": "create",
- "doc": "${payload.doc}",
- "index": "${payload.index}",
- "overwrite": true
}, - "resource_opts": {
- "health_check_interval": "30s"
}
}
{- "connector": "elasticsearch_connector",
- "description": "My example elasticsearch action",
- "enable": true,
- "name": "elasticsearch_action",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "action": "create",
- "doc": "${payload.doc}",
- "index": "${payload.index}",
- "overwrite": true
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "elasticsearch"
}
Get bridge metrics by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
{- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "failed": 0,
- "inflight": 0,
- "matched": 0,
- "queuing": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0,
- "received": 0,
- "retried": 0,
- "success": 0
}, - "node_metrics": [
- {
- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "failed": 0,
- "inflight": 0,
- "matched": 0,
- "queuing": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0,
- "received": 0,
- "retried": 0,
- "success": 0
}, - "node": "emqx@127.0.0.1"
}
]
}
Test creating a new bridge.
connector required | string Name of the connector specified by the action, used for external resource selection. |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this action. |
Array of actions_and_sources.fallback_action_republish (object) or actions_and_sources.fallback_action_reference (object) Default: [] List of fallback actions that will be triggered if a query to this action fails. | |
local_topic | string MQTT topic or topic filter as data source (action input). If rule action is used as data source, this config should be left empty, otherwise messages will be duplicated in the remote system. |
name required | string |
required | object (action_disk_log.action_parameters) |
object (actions_and_sources.action_resource_opts) | |
tags | Array of strings Tags to annotate this config entry. |
type required | string Value: "disk_log" |
{- "connector": "elasticsearch_connector",
- "description": "My example elasticsearch action",
- "enable": true,
- "name": "elasticsearch_action",
- "parameters": {
- "action": "create",
- "doc": "${payload.doc}",
- "index": "${payload.index}",
- "overwrite": true
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "type": "elasticsearch"
}
{- "code": "TEST_FAILED",
- "message": "string"
}
Get bridge metrics by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
{- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "failed": 0,
- "inflight": 0,
- "matched": 0,
- "queuing": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0,
- "received": 0,
- "retried": 0,
- "success": 0
}, - "node_metrics": [
- {
- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "failed": 0,
- "inflight": 0,
- "matched": 0,
- "queuing": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0,
- "received": 0,
- "retried": 0,
- "success": 0
}, - "node": "emqx@127.0.0.1"
}
]
}
[- {
- "created_at": 1736512728666,
- "enable": true,
- "last_modified_at": 1736512728666,
- "name": "mySource",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "connected",
- "status_reason": ""
}
], - "rules": [
- "rule1",
- "rule2"
], - "status": "connected",
- "status_reason": "",
- "type": "source_type"
}
]
Start bridge on all nodes in the cluster.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
[- {
- "connector": "my_connector",
- "description": "my source",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "pull_max_messages": 100,
- "topic": "my-topic"
}, - "resource_opts": {
- "health_check_interval": "30s",
- "request_ttl": "45s"
}, - "status": "connected"
}, - {
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "topic": "mytopic"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected"
}, - {
- "connector": "mqtt_connector",
- "description": "My example mqtt source",
- "enable": true,
- "name": "mqtt_source",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "qos": 1,
- "topic": "remote/topic"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "mqtt"
}, - {
- "connector": "rabbitmq_connector",
- "description": "My example rabbitmq source",
- "enable": true,
- "name": "rabbitmq_source",
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "no_ack": true,
- "queue": "test_queue"
}, - "resource_opts": {
- "health_check_interval": "30s"
}, - "status": "connected",
- "type": "rabbitmq"
}
]
Create a new bridge by type and name.
connector required | string Name of the connector specified by the action, used for external resource selection. |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this action. |
name required | string |
required | object (bridge_rabbitmq.source_parameters) |
object (actions_and_sources.source_resource_opts) | |
tags | Array of strings Tags to annotate this config entry. |
type required | string Value: "rabbitmq" |
{- "connector": "my_connector",
- "description": "my source",
- "enable": true,
- "name": "my_action",
- "parameters": {
- "pull_max_messages": 100,
- "topic": "my-topic"
}, - "resource_opts": {
- "health_check_interval": "30s",
- "request_ttl": "45s"
}, - "type": "gcp_pubsub_consumer"
}
{- "connector": "my_connector",
- "description": "my source",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "pull_max_messages": 100,
- "topic": "my-topic"
}, - "resource_opts": {
- "health_check_interval": "30s",
- "request_ttl": "45s"
}, - "status": "connected"
}
Delete a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
also_delete_dep_actions | boolean Default: false Whether to cascade delete dependent actions. |
{- "code": "BAD_REQUEST",
- "message": "string",
- "rules": [
- "string"
]
}
Get a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
{- "connector": "my_connector",
- "description": "my source",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "pull_max_messages": 100,
- "topic": "my-topic"
}, - "resource_opts": {
- "health_check_interval": "30s",
- "request_ttl": "45s"
}, - "status": "connected"
}
Update a bridge by id.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
connector required | string Name of the connector specified by the action, used for external resource selection. |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this action. |
required | object (bridge_rabbitmq.source_parameters) |
object (actions_and_sources.source_resource_opts) | |
tags | Array of strings Tags to annotate this config entry. |
{- "connector": "my_connector",
- "description": "my source",
- "enable": true,
- "parameters": {
- "pull_max_messages": 100,
- "topic": "my-topic"
}, - "resource_opts": {
- "health_check_interval": "30s",
- "request_ttl": "45s"
}
}
{- "connector": "my_connector",
- "description": "my source",
- "enable": true,
- "node_status": [
- {
- "node": "emqx@localhost",
- "status": "connected"
}
], - "parameters": {
- "pull_max_messages": 100,
- "topic": "my-topic"
}, - "resource_opts": {
- "health_check_interval": "30s",
- "request_ttl": "45s"
}, - "status": "connected"
}
Start bridge on a specific node.
node required | |
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
operation required | string Value: "start" Example: start Operation can be one of: 'start'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Test creating a new bridge.
connector required | string Name of the connector specified by the action, used for external resource selection. |
description | string Default: "" Descriptive text. |
enable | boolean Default: true Enable (true) or disable (false) this action. |
name required | string |
required | object (bridge_rabbitmq.source_parameters) |
object (actions_and_sources.source_resource_opts) | |
tags | Array of strings Tags to annotate this config entry. |
type required | string Value: "rabbitmq" |
{- "connector": "my_connector",
- "description": "my source",
- "enable": true,
- "name": "my_action",
- "parameters": {
- "pull_max_messages": 100,
- "topic": "my-topic"
}, - "resource_opts": {
- "health_check_interval": "30s",
- "request_ttl": "45s"
}, - "type": "gcp_pubsub_consumer"
}
{- "code": "TEST_FAILED",
- "message": "string"
}
Enable or Disable bridge on all nodes in the cluster.
id required | string Example: http:my_http_action The bridge id. Must be of format {type}:{name}. |
enable required | boolean Example: true Whether to enable this bridge. |
{- "code": "NOT_FOUND",
- "message": "string"
}
Get durable storage
ds required | string Example: messages Durable storage ID |
{- "name": "messages",
- "shards": [
- {
- "id": "1",
- "replicas": [
- {
- "site": "23D853AD567F0973",
- "status": "up",
- "transition": "joining"
}
]
}
]
}
Get sites
site required | string Example: 23D853AD567F0973 Site ID |
{- "node": "'emqx@example.com'",
- "shards": [
- {
- "id": "1",
- "status": "up",
- "storage": "messages",
- "transition": "joining"
}
], - "up": true
}
Remove site as a replica for the durable storage
ds required | string Example: messages Durable storage ID |
site required | string Example: 23D853AD567F0973 Site ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Add site as a replica for the durable storage
ds required | string Example: messages Durable storage ID |
site required | string Example: 23D853AD567F0973 Site ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Update replicas of the durable storage
ds required | string Example: messages Durable storage ID |
[- "string"
]
[- "string"
]
Topics list
topic | string Topic Name |
node | string Example: node=emqx@127.0.0.1 Node Name |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "node": "string",
- "session": "string",
- "topic": "string"
}
], - "meta": {
- "count": 0,
- "hasnext": true,
- "limit": 50,
- "page": 1
}
}
List all uploaded files.
following | string Cursor to start listing files from |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Show current File Transfer configuration.
{- "assemble_timeout": "32s",
- "enable": false,
- "init_timeout": "32s",
- "storage": {
- "local": {
- "enable": true,
- "exporter": {
- "local": {
- "enable": true,
- "root": "string"
}, - "s3": {
- "access_key_id": "string",
- "access_method": "path",
- "acl": "private",
- "bucket": "string",
- "enable": true,
- "host": "string",
- "max_part_size": "32MB",
- "min_part_size": "32MB",
- "port": 1,
- "secret_access_key": "R4ND0M/S∃CЯ∃T",
- "transport_options": {
- "connect_timeout": "32s",
- "enable_pipelining": 0,
- "headers": { },
- "ipv6_probe": false,
- "max_retries": 0,
- "pool_size": 8,
- "request_timeout": "32s",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}
}, - "url_expire_time": "1h"
}
}, - "segments": {
- "gc": {
- "interval": "32s",
- "maximum_segments_ttl": "1h",
- "minimum_segments_ttl": "1h"
}, - "root": "string"
}
}
}, - "store_segment_timeout": "32s"
}
Replace File Transfer configuration.
assemble_timeout | string Default: "5m" Timeout for assembling and exporting file segments into a final file. |
enable | boolean Default: false Enable the File Transfer feature. |
init_timeout | string Default: "10s" Timeout for EMQX to initialize the file transfer. |
object (file_transfer.storage_backend) | |
store_segment_timeout | string Default: "5m" Timeout for storing a file segment. |
{- "assemble_timeout": "32s",
- "enable": false,
- "init_timeout": "32s",
- "storage": {
- "local": {
- "enable": true,
- "exporter": {
- "local": {
- "enable": true,
- "root": "string"
}, - "s3": {
- "access_key_id": "string",
- "access_method": "path",
- "acl": "private",
- "bucket": "string",
- "enable": true,
- "host": "string",
- "max_part_size": "32MB",
- "min_part_size": "32MB",
- "port": 1,
- "secret_access_key": "R4ND0M/S∃CЯ∃T",
- "transport_options": {
- "connect_timeout": "32s",
- "enable_pipelining": 0,
- "headers": { },
- "ipv6_probe": false,
- "max_retries": 0,
- "pool_size": 8,
- "request_timeout": "32s",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}
}, - "url_expire_time": "1h"
}
}, - "segments": {
- "gc": {
- "interval": "32s",
- "maximum_segments_ttl": "1h",
- "minimum_segments_ttl": "1h"
}, - "root": "string"
}
}
}, - "store_segment_timeout": "32s"
}
{- "assemble_timeout": "32s",
- "enable": false,
- "init_timeout": "32s",
- "storage": {
- "local": {
- "enable": true,
- "exporter": {
- "local": {
- "enable": true,
- "root": "string"
}, - "s3": {
- "access_key_id": "string",
- "access_method": "path",
- "acl": "private",
- "bucket": "string",
- "enable": true,
- "host": "string",
- "max_part_size": "32MB",
- "min_part_size": "32MB",
- "port": 1,
- "secret_access_key": "R4ND0M/S∃CЯ∃T",
- "transport_options": {
- "connect_timeout": "32s",
- "enable_pipelining": 0,
- "headers": { },
- "ipv6_probe": false,
- "max_retries": 0,
- "pool_size": 8,
- "request_timeout": "32s",
- "ssl": {
- "cacertfile": "string",
- "cacerts": false,
- "certfile": "string",
- "ciphers": [ ],
- "depth": 10,
- "enable": false,
- "hibernate_after": "12m",
- "keyfile": "string",
- "log_level": "emergency",
- "partial_chain": true,
- "password": "",
- "reuse_sessions": true,
- "secure_renegotiate": true,
- "server_name_indication": "disable",
- "verify": "verify_peer",
- "verify_peer_ext_key_usage": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
]
}
}, - "url_expire_time": "1h"
}
}, - "segments": {
- "gc": {
- "interval": "32s",
- "maximum_segments_ttl": "1h",
- "minimum_segments_ttl": "1h"
}, - "root": "string"
}
}
}, - "store_segment_timeout": "32s"
}
List a file uploaded during specified transfer, identified by client id and file id.
clientid required | string MQTT Client ID |
fileid required | string File ID |
{- "code": "FILES_NOT_FOUND",
- "message": "string"
}
Get a file by its id.
node required | string Example: node=emqx@127.0.0.1 Node under which the file is located |
fileref required | string Example: fileref=file1 File reference |
{- "code": "NOT_FOUND",
- "message": "string"
}
Move authenticator in global authentication chain.
id required | string Authenticator ID. |
position required | string Example: before:password_based:built_in_database Position of authenticator in chain. Possible values are 'front', 'rear', 'before:{other_authenticator}', 'after:{other_authenticator}'. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get authentication cache status.
{- "metrics": {
- "hits": {
- "rate": {
- "current": 0,
- "last5m": 0,
- "max": 0
}, - "value": 0
}, - "inserts": {
- "rate": {
- "current": 0,
- "last5m": 0,
- "max": 0
}, - "value": 0
}, - "memory": 1704,
- "misses": {
- "rate": {
- "current": 0,
- "last5m": 0,
- "max": 0
}, - "value": 1
}, - "size": 0
}, - "node_metrics": [
- {
- "metrics": {
- "hits": {
- "rate": {
- "current": 0,
- "last5m": 0,
- "max": 0
}, - "value": 0
}, - "inserts": {
- "rate": {
- "current": 0,
- "last5m": 0,
- "max": 0
}, - "value": 0
}, - "memory": 1704,
- "misses": {
- "rate": {
- "current": 0,
- "last5m": 0,
- "max": 0
}, - "value": 1
}, - "size": 0
}, - "node": "test@127.0.0.1"
}
]
}
Get authenticator from global authentication chain.
id required | string Authenticator ID. |
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Update authenticator from global authentication chain.
id required | string Authenticator ID. |
required | Array of objects (authn.cinfo_check) A list of checks to perform on the client information. |
enable | boolean Default: true Set to |
mechanism required | string Value: "cinfo" Authentication mechanism. |
precondition | string Default: "" A Variform expression to evaluate with a set of pre-bound variables derived from the client information. |
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Update authentication settings.
object (auth_cache.config) |
{- "node_cache": {
- "cache_ttl": "1m",
- "cleanup_interval": "1m",
- "enable": true,
- "max_count": 100000,
- "max_memory": "100MB",
- "stat_update_interval": "1m"
}
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Delete user in authenticator in global authentication chain.
id required | string Authenticator ID. |
user_id required | string User ID. |
{- "code": "NOT_FOUND",
- "message": "string"
}
Get user from authenticator in global authentication chain.
id required | string Authenticator ID. |
user_id required | string User ID. |
{- "user_id": "user1"
}
Update user in authenticator in global authentication chain.
id required | string Authenticator ID. |
user_id required | string User ID. |
is_superuser | boolean Default: false |
password required | string |
{- "password": "******"
}
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
List authenticators for global authentication.
[- {
- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}, - {
- "backend": "built_in_database",
- "mechanism": "password_based",
- "password_hash_algorithm": {
- "name": "sha256",
- "salt_position": "suffix"
}, - "user_id_type": "username"
}, - {
- "backend": "http",
- "body": {
- "password": "${password}",
- "username": "${username}"
}, - "connect_timeout": "5s",
- "enable_pipelining": 100,
- "headers": {
- "content-type": "application/json"
}, - "mechanism": "password_based",
- "method": "post",
- "pool_size": 8,
- "request_timeout": "5s",
- "ssl": {
- "enable": false
},
}, - {
- "backend": "mongodb",
- "collection": "users",
- "database": "example",
- "filter": {
- "username": "${username}"
}, - "is_superuser_field": "is_superuser",
- "mechanism": "password_based",
- "password_hash_algorithm": {
- "name": "sha256",
- "salt_position": "suffix"
}, - "password_hash_field": "password_hash",
- "salt_field": "salt",
- "server": "127.0.0.1:27017"
}, - {
- "backend": "redis",
- "cmd": "HMGET ${username} password_hash salt",
- "database": 0,
- "mechanism": "password_based",
- "password_hash_algorithm": {
- "name": "sha256",
- "salt_position": "suffix"
}, - "redis_type": "single",
- "server": "127.0.0.1:6379"
}
]
Create authenticator for global authentication.
required | Array of objects (authn.cinfo_check) A list of checks to perform on the client information. |
enable | boolean Default: true Set to |
mechanism required | string Value: "cinfo" Authentication mechanism. |
precondition | string Default: "" A Variform expression to evaluate with a set of pre-bound variables derived from the client information. |
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Get authenticator status from global authentication chain.
id required | string Authenticator ID. |
{- "metrics": {
- "failed": 0,
- "nomatch": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0,
- "success": 0,
- "total": 0
}, - "node_error": [ ],
- "node_metrics": [
- {
- "metrics": {
- "failed": 0,
- "matched": 0,
- "nomatch": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0,
- "total": 0
}, - "node": "emqx@127.0.0.1"
}
], - "node_resource_metrics": [
- {
- "metrics": {
- "failed": 0,
- "matched": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0,
- "success": 0
}, - "node": "emqx@127.0.0.1"
}
], - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "connected"
}
], - "resource_metrics": {
- "failed": 0,
- "matched": 0,
- "rate": 0,
- "rate_last5m": 0,
- "rate_max": 0,
- "success": 0
}, - "status": "connected"
}
List users in authenticator in global authentication chain.
id required | string Authenticator ID. |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
like_user_id | string Fuzzy search user_id (username or clientid). |
is_superuser | boolean Is superuser |
{- "data": [
- {
- "user_id": "user1"
}, - {
- "is_superuser": true,
- "user_id": "user2"
}
], - "meta": {
- "count": 300,
- "limit": 20,
- "page": 0
}
}
Create users for authenticator in global authentication chain.
id required | string Authenticator ID. |
is_superuser | boolean Default: false |
password required | string |
user_id required | string |
{- "password": "******",
- "user_id": "user1"
}
{- "user_id": "user1"
}
Import users into authenticator in global authentication chain.
id required | string Authenticator ID. |
type required | string Enum: "plain" "hash" Example: type=hash The import file template type, enum with |
Import body
[- {
- "is_superuser": true,
- "password": "password1",
- "user_id": "user1"
}, - {
- "is_superuser": false,
- "password": "password2",
- "user_id": "user2"
}
]
{- "failed": 0,
- "override": 0,
- "skipped": 0,
- "success": 0,
- "total": 0
}
Reorder all authenticators in global authentication chain.
id required | string Authenticator ID. |
[- {
- "id": "password_based:built_in_database"
}
]
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get topic metrics
topic required | string Example: testtopic/1 Topic string. Notice: Topic string in url path must be encoded |
{- "create_time": "2022-01-14T21:48:47+08:00",
- "metrics": {
- "message.dropped.count": 0,
- "message.dropped.rate": 0,
- "message.in.count": 0,
- "message.in.rate": 0,
- "message.out.count": 0,
- "message.out.rate": 0,
- "message.qos0.in.count": 0,
- "message.qos0.in.rate": 0,
- "message.qos0.out.count": 0,
- "message.qos0.out.rate": 0,
- "message.qos1.in.count": 0,
- "message.qos1.in.rate": 0,
- "message.qos1.out.count": 0,
- "message.qos1.out.rate": 0,
- "message.qos2.in.count": 0,
- "message.qos2.in.rate": 0,
- "message.qos2.out.count": 0,
- "message.qos2.out.rate": 0
}, - "reset_time": "2022-01-14T21:48:47+08:00",
- "topic": "testtopic/1"
}
List delayed messages
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "delayed_interval": 1,
- "delayed_remaining": 0,
- "expected_at": "string",
- "from_clientid": "string",
- "from_username": "string",
- "msgid": 0,
- "node": "string",
- "payload": "string",
- "publish_at": "string",
- "qos": 0,
- "topic": "/sys/#"
}
], - "meta": {
- "count": 0,
- "limit": 1,
- "page": 1
}
}
View delayed message
node required | string The node where message from |
msgid required | string Delayed Message ID |
{- "delayed_interval": 1,
- "delayed_remaining": 0,
- "expected_at": "string",
- "from_clientid": "string",
- "from_username": "string",
- "msgid": 0,
- "node": "string",
- "publish_at": "string",
- "qos": 0,
- "topic": "/sys/#"
}
[- {
- "create_time": "2022-01-14T21:48:47+08:00",
- "metrics": {
- "message.dropped.count": 0,
- "message.dropped.rate": 0,
- "message.in.count": 0,
- "message.in.rate": 0,
- "message.out.count": 0,
- "message.out.rate": 0,
- "message.qos0.in.count": 0,
- "message.qos0.in.rate": 0,
- "message.qos0.out.count": 0,
- "message.qos0.out.rate": 0,
- "message.qos1.in.count": 0,
- "message.qos1.in.rate": 0,
- "message.qos1.out.count": 0,
- "message.qos1.out.rate": 0,
- "message.qos2.in.count": 0,
- "message.qos2.in.rate": 0,
- "message.qos2.out.count": 0,
- "message.qos2.out.rate": 0
}, - "reset_time": "2022-01-14T21:48:47+08:00",
- "topic": "testtopic/1"
}
]
Create topic metrics
topic required | string Raw topic string |
{- "topic": "testtopic/1"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Reset telemetry status
action required | string Action. Only support reset |
topic | string Topic Name. If this parameter is not present,all created topic metrics will be reset. |
{- "action": "reset"
}
{- "code": "TOPIC_NOT_FOUND",
- "message": "string"
}
Update all rewrite rules
action required | string Enum: "subscribe" "publish" "all" Topic rewriting takes effect on the type of operation: |
dest_topic required | string Destination topic. |
re required | string Regular expressions |
source_topic required | string Source topic, specified by the client. |
[- {
- "action": "publish",
- "dest_topic": "z/y/$1",
- "re": "^x/y/(.+)$",
- "source_topic": "x/#"
}
]
[- {
- "action": "publish",
- "dest_topic": "z/y/$1",
- "re": "^x/y/(.+)$",
- "source_topic": "x/#"
}
]
Enable or disable delayed, set max delayed messages
enable | boolean Default: true Enable this feature |
max_delayed_messages | integer Default: 0 Maximum number of delayed messages (0 is no limit). |
{- "enable": true,
- "max_delayed_messages": 0
}
{- "enable": true,
- "max_delayed_messages": 0
}
Get Prometheus Metrics for AuthN, AuthZ and Banned
mode | string Default: "node" Enum: "node" "all_nodes_aggregated" "all_nodes_unaggregated" Example: mode=node
|
{ }
{- "collectors": {
- "mnesia": "disabled",
- "vm_dist": "disabled",
- "vm_memory": "disabled",
- "vm_msacc": "disabled",
- "vm_statistics": "disabled",
- "vm_system_info": "disabled"
}, - "enable_basic_auth": false,
- "push_gateway": {
- "headers": {
- "Authorization": "Basic YWRtaW46Y2JraG55eWd5QDE="
}, - "interval": "15s",
- "job_name": "${name}/instance/${name}~${host}",
- "method": "put",
}
}
Update Prometheus config
enable required | boolean Default: false Deprecated since 5.4.0, use |
headers | object Default: {} Deprecated since 5.4.0, use |
interval required | string Default: "15s" Deprecated since 5.4.0, use |
job_name required | string Default: "${name}/instance/${name}~${host}" Deprecated since 5.4.0, use |
mnesia_collector required | string Default: "disabled" Enum: "enabled" "disabled" Deprecated since 5.4.0, use |
push_gateway_server required | string Default: "http://127.0.0.1:9091" Deprecated since 5.4.0, use |
vm_dist_collector required | string Default: "disabled" Enum: "disabled" "enabled" Deprecated since 5.4.0, use |
vm_memory_collector required | string Default: "disabled" Enum: "enabled" "disabled" Deprecated since 5.4.0, use |
vm_msacc_collector required | string Default: "disabled" Enum: "enabled" "disabled" Deprecated since 5.4.0, use |
vm_statistics_collector required | string Default: "disabled" Enum: "enabled" "disabled" Deprecated since 5.4.0, use |
vm_system_info_collector required | string Default: "disabled" Enum: "enabled" "disabled" Deprecated, use |
{- "enable": true,
- "headers": {
- "Authorization": "Basic YWRtaW46Y2JraG55eWd5QDE="
}, - "interval": "15s",
- "job_name": "${name}/instance/${name}~${host}",
- "mnesia_collector": "disabled",
- "vm_dist_collector": "disabled",
- "vm_memory_collector": "disabled",
- "vm_msacc_collector": "disabled",
- "vm_statistics_collector": "disabled",
- "vm_system_info_collector": "disabled"
}
{- "collectors": {
- "mnesia": "disabled",
- "vm_dist": "disabled",
- "vm_memory": "disabled",
- "vm_msacc": "disabled",
- "vm_statistics": "disabled",
- "vm_system_info": "disabled"
}, - "enable_basic_auth": false,
- "push_gateway": {
- "headers": {
- "Authorization": "Basic YWRtaW46Y2JraG55eWd5QDE="
}, - "interval": "15s",
- "job_name": "${name}/instance/${name}~${host}",
- "method": "put",
}
}
Get Prometheus Metrics for Message Validation
mode | string Default: "node" Enum: "node" "all_nodes_aggregated" "all_nodes_unaggregated" Example: mode=node
|
{ }
Get Prometheus Metrics
mode | string Default: "node" Enum: "node" "all_nodes_aggregated" "all_nodes_unaggregated" Example: mode=node
|
{ }
Get Prometheus Metrics for Data Integration
mode | string Default: "node" Enum: "node" "all_nodes_aggregated" "all_nodes_unaggregated" Example: mode=node
|
{ }
Get Prometheus Metrics for Schema Validation
mode | string Default: "node" Enum: "node" "all_nodes_aggregated" "all_nodes_unaggregated" Example: mode=node
|
{ }
Get opentelmetry configuration
{- "logs": {
- "enable": true,
- "level": "warning"
}, - "metrics": {
- "enable": true
}, - "traces": {
- "enable": true,
- "filter": {
- "e2e_tracing_options": {
- "attribute_meta_value": "emqxcl",
- "client_connect_disconnect": true,
- "client_publish": true,
- "client_subscribe_unsubscribe": true,
- "clientid_match_rules_max": 30,
- "msg_trace_level": 0,
- "sample_ratio": "10%",
- "topic_match_rules_max": 30
}, - "trace_all": false,
- "trace_mode": "legacy"
}, - "max_queue_size": 2048,
- "scheduled_delay": "5s"
}
}
Update opentelmetry configuration
object (opentelemetry.otel_exporter) | |
object (opentelemetry.otel_logs) | |
object (opentelemetry.otel_metrics) | |
object (opentelemetry.otel_traces) |
{- "logs": {
- "enable": true,
- "level": "warning"
}, - "metrics": {
- "enable": true
}, - "traces": {
- "enable": true,
- "filter": {
- "e2e_tracing_options": {
- "attribute_meta_value": "emqxcl",
- "client_connect_disconnect": true,
- "client_publish": true,
- "client_subscribe_unsubscribe": true,
- "clientid_match_rules_max": 30,
- "msg_trace_level": 0,
- "sample_ratio": "10%",
- "topic_match_rules_max": 30
}, - "trace_all": false,
- "trace_mode": "legacy"
}, - "max_queue_size": 2048,
- "scheduled_delay": "5s"
}
}
{- "logs": {
- "enable": true,
- "level": "warning"
}, - "metrics": {
- "enable": true
}, - "traces": {
- "enable": true,
- "filter": {
- "e2e_tracing_options": {
- "attribute_meta_value": "emqxcl",
- "client_connect_disconnect": true,
- "client_publish": true,
- "client_subscribe_unsubscribe": true,
- "clientid_match_rules_max": 30,
- "msg_trace_level": 0,
- "sample_ratio": "10%",
- "topic_match_rules_max": 30
}, - "trace_all": false,
- "trace_mode": "legacy"
}, - "max_queue_size": 2048,
- "scheduled_delay": "5s"
}
}
Enable or disable a particular transformation
name required | string Example: my_transformation Transformation name |
enable required | boolean Enable or disable transformation |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Test an input against a transformation
required | object (message_transformation_http_api.dryrun_input_message) |
required | object (message_transformation.transformation) |
{- "message": {
- "client_attrs": { },
- "payload": "{}",
- "qos": 2,
- "retain": true,
- "topic": "t/u/v",
- "user_property": { }
}, - "transformation": {
- "description": "my transformation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_transformation",
- "operations": [
- {
- "key": "topic",
- "value": "concat([topic, '/', payload.t])"
}
], - "payload_decoder": {
- "type": "json"
}, - "payload_encoder": {
- "type": "json"
}, - "tags": [
- "transformation"
], - "topics": [
- "t/+"
]
}
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Lookup a transformation
name required | string Example: my_transformation Transformation name |
{- "description": "my transformation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_transformation",
- "operations": [
- {
- "key": "topic",
- "value": "concat([topic, '/', payload.t])"
}
], - "payload_decoder": {
- "type": "json"
}, - "payload_encoder": {
- "type": "json"
}, - "tags": [
- "transformation"
], - "topics": [
- "t/+"
]
}
[- {
- "description": "my transformation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_transformation",
- "operations": [
- {
- "key": "topic",
- "value": "concat([topic, '/', payload.t])"
}
], - "payload_decoder": {
- "type": "json"
}, - "payload_encoder": {
- "type": "json"
}, - "tags": [
- "transformation"
], - "topics": [
- "t/+"
]
}, - {
- "description": "my transformation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "other_transformation",
- "operations": [
- {
- "key": "topic",
- "value": "concat([topic, '/', payload.t])"
}
], - "payload_decoder": {
- "type": "json"
}, - "payload_encoder": {
- "type": "json"
}, - "tags": [
- "transformation"
], - "topics": [
- "t/+"
]
}
]
Append a new transformation to the list of transformations
description | string Default: "" Descriptive text. |
enable | boolean Default: true |
failure_action required | string Enum: "drop" "disconnect" "ignore" |
object (message_transformation.log_failure) | |
name required | string |
Array of objects (message_transformation.operation) Default: [] | |
string or string or string or string or string Default: {"type":"none"} | |
string or string or string or string or string Default: {"type":"none"} | |
tags | Array of strings Tags to annotate this config entry. |
required | Array of strings or string |
{- "description": "my transformation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_transformation",
- "operations": [
- {
- "key": "topic",
- "value": "concat([topic, '/', payload.t])"
}
], - "payload_decoder": {
- "type": "json"
}, - "payload_encoder": {
- "type": "json"
}, - "tags": [
- "transformation"
], - "topics": [
- "t/+"
]
}
{- "description": "my transformation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_transformation",
- "operations": [
- {
- "key": "topic",
- "value": "concat([topic, '/', payload.t])"
}
], - "payload_decoder": {
- "type": "json"
}, - "payload_encoder": {
- "type": "json"
}, - "tags": [
- "transformation"
], - "topics": [
- "t/+"
]
}
Update a transformation
description | string Default: "" Descriptive text. |
enable | boolean Default: true |
failure_action required | string Enum: "drop" "disconnect" "ignore" |
object (message_transformation.log_failure) | |
name required | string |
Array of objects (message_transformation.operation) Default: [] | |
string or string or string or string or string Default: {"type":"none"} | |
string or string or string or string or string Default: {"type":"none"} | |
tags | Array of strings Tags to annotate this config entry. |
required | Array of strings or string |
{- "description": "my transformation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_transformation",
- "operations": [
- {
- "key": "topic",
- "value": "concat([topic, '/', payload.t])"
}
], - "payload_decoder": {
- "type": "json"
}, - "payload_encoder": {
- "type": "json"
}, - "tags": [
- "transformation"
], - "topics": [
- "t/+"
]
}
{- "description": "my transformation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_transformation",
- "operations": [
- {
- "key": "topic",
- "value": "concat([topic, '/', payload.t])"
}
], - "payload_decoder": {
- "type": "json"
}, - "payload_encoder": {
- "type": "json"
}, - "tags": [
- "transformation"
], - "topics": [
- "t/+"
]
}
Get metrics for a particular transformation
name required | string Example: my_transformation Transformation name |
{- "metrics": {
- "failed": 1,
- "matched": 2,
- "rate": 1.23,
- "rate_last5m": 0.88,
- "rate_max": 1.87,
- "succeeded": 1
}, - "node_metrics": [
- {
- "metrics": {
- "failed": 1,
- "matched": 2,
- "rate": 1.23,
- "rate_last5m": 0.88,
- "rate_max": 1.87,
- "succeeded": 1
}, - "node": "emqx@127.0.0.1"
}
]
}
Reorder of all transformations
order required | Array of strings |
{- "order": [
- "bar",
- "foo",
- "baz"
]
}
{- "code": "BAD_REQUEST",
- "duplicated": [
- "string"
], - "message": "string",
- "not_found": [
- "string"
], - "not_reordered": [
- "string"
]
}
Stop trace by name
name required | string Example: EMQX-TRACE-1 [a-zA-Z0-9-_] |
{- "clientid": "dev-001",
- "end_at": "2021-11-05T18:17:38+08:00",
- "formatter": "text",
- "ip_address": "127.0.0.1",
- "log_size": [
- {
- "node": "emqx@127.0.0.1",
- "size": 1024
}
], - "name": "EMQX-TRACE-1",
- "payload_encode": "hex",
- "payload_limit": 1024,
- "ruleid": "my_rule",
- "start_at": "2021-11-04T18:17:38+08:00",
- "status": "running",
- "topic": "/dev/#",
- "type": "clientid"
}
Download trace log by name
name required | string Example: EMQX-TRACE-1 [a-zA-Z0-9-_] |
node | string Example: node=emqx@127.0.0.1 Node name |
{- "code": "NOT_FOUND",
- "message": "string"
}
get trace log file's metadata, such as size, last update time
name required | string Example: EMQX-TRACE-1 [a-zA-Z0-9-_] |
[- {
- "mtime": 0,
- "node": "emqx@127.0.0.1",
- "size": 0
}
]
view trace log
name required | string Example: EMQX-TRACE-1 [a-zA-Z0-9-_] |
bytes | integer [ 0 .. 2147483647 ] Default: 1000 Maximum number of bytes to send in response |
position | integer Default: 0 Offset from the current trace position. |
node | string Example: node=emqx@127.0.0.1 Node name |
{- "items": "TEXT-LOG-ITEMS",
- "meta": {
- "bytes": 1000,
- "position": 0
}
}
[- {
- "clientid": "dev-001",
- "end_at": "2021-11-05T18:17:38+08:00",
- "formatter": "text",
- "ip_address": "127.0.0.1",
- "log_size": [
- {
- "node": "emqx@127.0.0.1",
- "size": 1024
}
], - "name": "EMQX-TRACE-1",
- "payload_encode": "hex",
- "payload_limit": 1024,
- "ruleid": "my_rule",
- "start_at": "2021-11-04T18:17:38+08:00",
- "status": "running",
- "topic": "/dev/#",
- "type": "clientid"
}
]
Create new trace
clientid | string Specify the MQTT clientid if the trace 'type' is 'clientid'. |
integer or string rfc3339 timestamp or epoch second | |
string or string The formatter that will be used to format the trace log entries. Set this to text to format the log entries as plain text (default). Set it to json to format each log entry as a JSON object. | |
ip_address | string Specify the client's IP address if the trace type is 'ip_address'. |
name required | string Unique name of the trace. Only ASCII letters in a-z, A-Z, 0-9 and underscore '_' are allowed. |
payload_encode | string Default: "text" Enum: "hex" "text" "hidden" Determine the format of the payload format in the trace file. |
payload_limit | integer Default: 1024 Determine the maximum bytes of the payload will be printed in the trace file. |
ruleid | string |
integer or string rfc3339 timestamp or epoch second | |
topic | string Specify the topic or topic filter if the trace 'type' is 'topic'. |
type required | string Enum: "clientid" "topic" "ip_address" "ruleid" Filter type |
{- "clientid": "dev-001",
- "end_at": "2021-11-05T18:17:38+08:00",
- "formatter": "text",
- "ip_address": "127.0.0.1",
- "name": "EMQX-TRACE-1",
- "payload_encode": "hex",
- "payload_limit": 1024,
- "ruleid": "my_rule",
- "start_at": "2021-11-04T18:17:38+08:00",
- "topic": "/dev/#",
- "type": "clientid"
}
{- "clientid": "dev-001",
- "end_at": "2021-11-05T18:17:38+08:00",
- "formatter": "text",
- "ip_address": "127.0.0.1",
- "log_size": [
- {
- "node": "emqx@127.0.0.1",
- "size": 1024
}
], - "name": "EMQX-TRACE-1",
- "payload_encode": "hex",
- "payload_limit": 1024,
- "ruleid": "my_rule",
- "start_at": "2021-11-04T18:17:38+08:00",
- "status": "running",
- "topic": "/dev/#",
- "type": "clientid"
}
Get status of all rebalance/evacuation processes across the cluster
{- "evacuations": [
- {
- "connection_eviction_rate": 1,
- "connection_eviction_rpc_timeout": "32s",
- "connection_goal": 0,
- "coordinator_node": "string",
- "disconnected_session_goal": 0,
- "node": "string",
- "recipients": [
- "string"
], - "session_eviction_rate": 1,
- "session_eviction_rpc_timeout": "1h",
- "session_goal": 0,
- "session_recipients": [
- "string"
], - "state": "string",
- "stats": {
- "current_connected": 0,
- "current_disconnected_sessions": 0,
- "current_sessions": 0,
- "initial_connected": 0,
- "initial_sessions": 0
}
}
], - "purges": [
- {
- "connection_eviction_rpc_timeout": "32s",
- "coordinator_node": "string",
- "node": "string",
- "purge_rate": 1,
- "session_eviction_rpc_timeout": "1h",
- "session_goal": 0,
- "state": "string",
- "stats": {
- "current_connected": 0,
- "current_disconnected_sessions": 0,
- "current_sessions": 0,
- "initial_connected": 0,
- "initial_sessions": 0
}
}
], - "rebalances": [
- {
- "connection_eviction_rate": 1,
- "connection_eviction_rpc_timeout": "32s",
- "connection_goal": 0,
- "coordinator_node": "string",
- "disconnected_session_goal": 0,
- "donor_conn_avg": 0,
- "donor_sess_avg": 0,
- "donors": [
- "string"
], - "node": "string",
- "recipients": [
- "string"
], - "session_eviction_rate": 1,
- "session_eviction_rpc_timeout": "1h",
- "state": "string"
}
]
}
Get rebalance status of the current node
{- "connection_eviction_rate": 1,
- "connection_eviction_rpc_timeout": "32s",
- "connection_goal": 0,
- "coordinator_node": "string",
- "disconnected_session_goal": 0,
- "process": "rebalance",
- "recipients": [
- "string"
], - "session_eviction_rate": 1,
- "session_eviction_rpc_timeout": "1h",
- "session_goal": 0,
- "session_recipients": [
- "string"
], - "state": "string",
- "stats": {
- "current_connected": 0,
- "current_disconnected_sessions": 0,
- "current_sessions": 0,
- "initial_connected": 0,
- "initial_sessions": 0
}, - "status": "enabled"
}
Start evacuation process
node required | string Node name |
conn_evict_rate | integer >= 1 The rate of evicting connections, in connections per second |
migrate_to | Array of strings Nodes to migrate sessions to |
redirect_to | string Server reference to redirect clients to (MQTTv5 Server redirection) |
sess_evict_rate | integer >= 1 The rate of evicting sessions, in sessions per second |
wait_health_check | string Time to wait before starting the rebalance/evacuation process, in seconds |
wait_takeover | string Time to wait before starting session evacuation process, in seconds |
null
{ }
Start rebalance process
node required | string Node name |
abs_conn_threshold | integer >= 1 Maximum desired difference between the number of connections on the node and the average number of connections on the recipient nodes. Difference lower than this is the goal of the rebalance process. |
abs_sess_threshold | integer >= 1 Maximum desired difference between the number of sessions on the node and the average number of sessions on the recipient nodes. Difference lower than this is the goal of the evacuation process. |
conn_evict_rate | integer >= 1 The rate of evicting connections, in connections per second |
conn_evict_rpc_timeout | string |
nodes | Array of strings Nodes to participate in rebalance |
rel_conn_threshold | number Maximum desired fraction between the number of connections on the node and the average number of connections on the recipient nodes. Fraction lower than this is the goal of the rebalance process. |
rel_sess_threshold | number Maximum desired fraction between the number of sessions on the node and the average number of sessions on the recipient nodes. Fraction lower than this is the goal of the evacuation process |
sess_evict_rate | integer >= 1 The rate of evicting sessions, in sessions per second |
sess_evict_rpc_timeout | string |
wait_health_check | string Time to wait before starting the rebalance/evacuation process, in seconds |
wait_takeover | string Time to wait before starting session evacuation process, in seconds |
null
{ }
{- "active_modules": [
- "Module A",
- "Module B"
], - "active_plugins": [
- "Plugin A",
- "Plugin B"
], - "emqx_version": "5.0.0-beta.3-32d1547c",
- "license": {
- "edition": "opensource"
}, - "messages_received": 2022,
- "messages_sent": 2022,
- "nodes_uuid": [
- "AAAAAAAA-BBBB-CCCC-2022-DDDDEEEEFFF",
- "ZZZZZZZZ-CCCC-BBBB-2022-DDDDEEEEFFF"
], - "num_clients": 20220113,
- "os_name": "Linux",
- "os_version": "20.04",
- "otp_version": "24",
- "up_time": 20220113,
- "uuid": "AAAAAAAA-BBBB-CCCC-2022-DDDDEEEEFFF"
}
Enable or disable telemetry
enable | boolean Default: true Enable telemetry |
{- "enable": false
}
{- "enable": false
}
API Error Codes
code required | string Enum: "BAD_USERNAME_OR_PWD" "BAD_API_KEY_OR_SECRET" "BAD_REQUEST" "NOT_MATCH" "ALREADY_EXISTS" "BAD_CONFIG_SCHEMA" "BAD_LISTENER_ID" "BAD_NODE_NAME" "BAD_RPC" "BAD_TOPIC" "EXCEED_LIMIT" "INVALID_PARAMETER" "CONFLICT" "NO_DEFAULT_VALUE" "DEPENDENCY_EXISTS" "MESSAGE_ID_SCHEMA_ERROR" "INVALID_ID" "MESSAGE_ID_NOT_FOUND" "NOT_FOUND" "CLIENTID_NOT_FOUND" "CLIENT_NOT_FOUND" "RESOURCE_NOT_FOUND" "TOPIC_NOT_FOUND" "USER_NOT_FOUND" "INTERNAL_ERROR" "SERVICE_UNAVAILABLE" "SOURCE_ERROR" "UPDATE_FAILED" "REST_FAILED" "CLIENT_NOT_RESPONSE" "UNSUPPORTED_MEDIA_TYPE" Example: BAD_USERNAME_OR_PWD API Error Codes |
{- "code": "string",
- "description": "string"
}
List all namespaces
The namespaces are sorted in lexicographical order,
so this API can be used for prefix based fuzzy search.
last_ns | string Example: last_ns=ns1 The last namespace from the previous page. |
limit | integer >= 1 Example: limit=100 The number of items to return |
[- "ns1",
- "ns2"
]
Upsert namespace configurations in bulk
object (mt.config_in) | |
ns | string |
null
{- "code": "BAD_REQUEST",
- "message": "string"
}
Update managed namespace configuration
ns required | string Example: ns1 |
object (mt.limiter_config_in) | |
object (mt.session_config_in) |
null
null
List all managed namespaces
The namespaces are sorted in lexicographical order,
so this API can be used for prefix based fuzzy search.
last_ns | string Example: last_ns=ns1 The last namespace from the previous page. |
limit | integer >= 1 Example: limit=100 The number of items to return |
[- "ns1",
- "ns2"
]
List all clients in a namespace
ns required | string Example: ns1 |
last_clientid | string Example: last_clientid=clientid1 |
limit | integer >= 1 Example: limit=100 The number of items to return |
[- "client1",
- "client2"
]
Get audit logs with filtering parameters. This feature enables users to efficiently
access the desired audit trail data and facilitates auditing, compliance,
troubleshooting, and security analysis.
node | string Example: node=emqx@127.0.0.1 Filter logs by the node name where the logs were generated. |
from | string Enum: "dashboard" "rest_api" "cli" "erlang_console" Example: from=dashboard Filter logs by source type. Possible values are: |
source | string Example: source=admin Filter logs by source. Possible values are: |
source_ip | string Example: source_ip=127.0.0.1 Filter logs by source IP when logs, applicable for logs generated from Dashboard or REST API operations. |
operation_id | string Example: operation_id=/rules/{id} Filter logs by swagger's operation_id, applicable for logs generated from Dashboard or REST API operations. |
operation_type | string Example: operation_type=rules Filter logs by operation type. |
operation_result | string Enum: "success" "failure" Example: operation_result=failure Filter logs by operation result. |
http_status_code | integer Example: http_status_code=200 Filter The HTTP API logs by response code, applicable for logs generated from Dashboard or REST API operations. |
http_method | string Enum: "post" "put" "delete" Example: http_method=post Filter The HTTP API logs by method, applicable for logs generated from Dashboard or REST API operations. |
gte_duration_ms | integer Filter logs by age duration, selecting those created no earlier than then given duration time ago. |
lte_duration_ms | integer Example: lte_duration_ms=1000 Filter logs by age duration, selecting those created no later than then given duration time ago. |
integer or string Example: gte_created_at=2023-10-15T00:00:00.820384+08:00 Filter logs by creation time, selecting logs created no earlier than the given timestamp. | |
integer or string Example: lte_created_at=2023-10-16T00:00:00.820384+08:00 Filter logs by creation time, selecting logs created no later than the given timestamp. | |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "args": [ ],
- "created_at": "2023-10-17T10:41:20.383993+08:00",
- "duration_ms": 0,
- "failure": [ ],
- "from": "dashboard",
- "http_method": "post",
- "http_request": {
- "bindings": { },
- "body": {
- "password": "******",
- "username": "admin"
}, - "headers": {
- "accept": "*/*",
- "authorization": "******",
- "connection": "keep-alive",
- "content-length": "45",
- "content-type": "application/json"
}, - "method": "post"
}, - "http_status_code": 200,
- "node": "emqx@127.0.0.1",
- "operation_id": "/login",
- "operation_result": "success",
- "operation_type": "login",
- "source": "admin",
- "source_ip": "127.0.0.1"
}, - {
- "args": [
- "show",
- "log"
], - "created_at": "2023-10-17T10:45:13.100426+08:00",
- "duration_ms": 7,
- "failure": [ ],
- "from": "cli",
- "http_method": [ ],
- "http_request": [ ],
- "http_status_code": [ ],
- "node": "emqx@127.0.0.1",
- "operation_id": [ ],
- "operation_result": [ ],
- "operation_type": "conf",
- "source": [ ],
- "source_ip": [ ]
}
], - "meta": {
- "count": 2,
- "hasnext": false,
- "limit": 50,
- "page": 1
}
}
[- {
- "checks": [
- {
- "sql": "select payload.temp as t where t > 10",
- "type": "sql"
}
], - "description": "my validation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_validation",
- "strategy": "all_pass",
- "tags": [
- "validation"
], - "topics": [
- "t/+"
]
}, - {
- "checks": [
- {
- "schema": "my_avro_schema",
- "type": "avro"
}
], - "description": "my validation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "other_validation",
- "strategy": "all_pass",
- "tags": [
- "validation"
], - "topics": [
- "t/+"
]
}
]
Append a new validation to the list of validations
required | Array of schema_validation.check_external_http (object) or schema_validation.check_protobuf (object) or schema_validation.check_avro (object) or schema_validation.check_json (object) or schema_validation.check_sql (object) Checks that will be performed during validation. They are evaluated in the same order as defined. |
description | string Default: "" Descriptive text. |
enable | boolean Default: true |
failure_action required | string Enum: "drop" "disconnect" "ignore" How to proceed if the validation fails. |
object (schema_validation.log_failure) | |
name required | string Name |
strategy required | string Enum: "any_pass" "all_pass" Strategy |
tags | Array of strings Tags to annotate this config entry. |
required | Array of strings or string A single topic filter or list of topic filters that this validation should validate. |
{- "checks": [
- {
- "schema": "my_avro_schema",
- "type": "avro"
}
], - "description": "my validation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_validation",
- "strategy": "all_pass",
- "tags": [
- "validation"
], - "topics": [
- "t/+"
]
}
{- "checks": [
- {
- "schema": "my_avro_schema",
- "type": "avro"
}
], - "description": "my validation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_validation",
- "strategy": "all_pass",
- "tags": [
- "validation"
], - "topics": [
- "t/+"
]
}
Update a validation
required | Array of schema_validation.check_external_http (object) or schema_validation.check_protobuf (object) or schema_validation.check_avro (object) or schema_validation.check_json (object) or schema_validation.check_sql (object) Checks that will be performed during validation. They are evaluated in the same order as defined. |
description | string Default: "" Descriptive text. |
enable | boolean Default: true |
failure_action required | string Enum: "drop" "disconnect" "ignore" How to proceed if the validation fails. |
object (schema_validation.log_failure) | |
name required | string Name |
strategy required | string Enum: "any_pass" "all_pass" Strategy |
tags | Array of strings Tags to annotate this config entry. |
required | Array of strings or string A single topic filter or list of topic filters that this validation should validate. |
{- "checks": [
- {
- "sql": "select payload.temp as t where t > 10",
- "type": "sql"
}
], - "description": "my validation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_validation",
- "strategy": "all_pass",
- "tags": [
- "validation"
], - "topics": [
- "t/+"
]
}
{- "checks": [
- {
- "sql": "select payload.temp as t where t > 10",
- "type": "sql"
}
], - "description": "my validation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_validation",
- "strategy": "all_pass",
- "tags": [
- "validation"
], - "topics": [
- "t/+"
]
}
Enable or disable a particular validation
name required | string Example: my_validation Validation name |
enable required | boolean Enable or disable validation |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get metrics for a particular validation
name required | string Example: my_validation Validation name |
{- "metrics": {
- "failed": 1,
- "matched": 2,
- "rate": 1.23,
- "rate_last5m": 0.88,
- "rate_max": 1.87,
- "succeeded": 1
}, - "node_metrics": [
- {
- "metrics": {
- "failed": 1,
- "matched": 2,
- "rate": 1.23,
- "rate_last5m": 0.88,
- "rate_max": 1.87,
- "succeeded": 1
}, - "node": "emqx@127.0.0.1"
}
]
}
Reorder of all validations
order required | Array of strings |
{- "order": [
- "bar",
- "foo",
- "baz"
]
}
{- "code": "BAD_REQUEST",
- "duplicated": [
- "string"
], - "message": "string",
- "not_found": [
- "string"
], - "not_reordered": [
- "string"
]
}
Lookup a validation
name required | string Example: my_validation Validation name |
{- "checks": [
- {
- "schema": "my_avro_schema",
- "type": "avro"
}
], - "description": "my validation",
- "enable": true,
- "failure_action": "drop",
- "log_failure": {
- "level": "info"
}, - "name": "my_validation",
- "strategy": "all_pass",
- "tags": [
- "validation"
], - "topics": [
- "t/+"
]
}
Send a CoAP request message to the client
clientid required | string |
content_type | string Enum: "text/plain" "application/json" "application/octet-stream" Payload type |
method | string Enum: "get" "put" "post" "delete" Request method type |
payload | string The content of the payload |
timeout | string Timespan for response |
token | string Message token, can be empty |
{- "content_type": "text/plain",
- "method": "get",
- "payload": "string",
- "timeout": "32s",
- "token": "string"
}
{- "id": 0,
- "method": "string",
- "payload": "string",
- "token": "string"
}
List subscriptions
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
node | string Example: node=emqx@127.0.0.1 Node name |
clientid | string Client ID |
qos | integer [ 0 .. 2 ] Example: qos=0 QoS |
topic | string Topic, url encoding |
match_topic | string Match topic string, url encoding |
share_group | string Shared subscription group name |
durable | boolean Filter subscriptions by durability |
[- {
- "clientid": "emqx_clientid_xx128cdhfc",
- "durable": false,
- "nl": 0,
- "node": "emqx@127.0.0.1",
- "qos": 0,
- "rap": 0,
- "rh": 0,
- "topic": "testtopic/1"
}
]
View slow topics statistics record data
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "clientid": "string",
- "last_update_time": 0,
- "node": "string",
- "timespan": 0,
- "topic": "string"
}
]
}
Update slow subs settings
enable | boolean Default: false Enable Slow Subscriptions |
expire_interval | string Default: "300s" The expiration time of the slow subscription record, if the record is not updated within the expiration time, then the record will be deleted. |
stats_type | string Default: "whole" Enum: "whole" "internal" "response" Message latency calculation method: |
threshold | string Default: "500ms" The Client ID and topic of the consumer whose message latency is greater than this threshold will be recorded in the slow subscription list. |
top_k_num | integer >= 1 Default: 10 The maximum number of slow-subscription records, up to a maximum of 1000. |
{- "enable": false,
- "expire_interval": "32s",
- "stats_type": "whole",
- "threshold": "32s",
- "top_k_num": 10
}
{- "enable": false,
- "expire_interval": "32s",
- "stats_type": "whole",
- "threshold": "32s",
- "top_k_num": 10
}
Plugins are launched in top-down order.
Use POST /plugins/{name}/move
to change the boot order.
[- {
- "author": [
- "EMQX Team"
], - "builder": {
- "contact": "emqx-support@emqx.io",
- "name": "EMQX Team",
- "website": "www.emqx.com"
}, - "built_on_otp_release": "24",
- "compatibility": {
- "emqx": "~>5.0"
}, - "description": "This is an demo plugin description",
- "functionality": [
- "Demo"
], - "git_commit_or_build_date": "2021-12-25",
- "git_ref": "ddab50fafeed6b1faea70fc9ffd8c700d7e26ec1",
- "health_status": {
- "message": "Port unavailable: 3306",
- "status": "error"
}, - "metadata_vsn": "0.1.0",
- "name": "emqx_plugin_template-5.0-rc.1",
- "readme": "This is an demo plugin.",
- "rel_apps": [
- "emqx_plugin_template-5.0.0",
- "map_sets-1.1.0"
], - "rel_vsn": "5.0-rc.1",
- "running_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "running"
}
]
}
]
Upload a plugin tarball (plugin-vsn.tar.gz).Follow emqx-plugin-template to develop plugin.
plugin | string <binary> |
{- "code": "UNEXPECTED_ERROR",
- "message": "string"
}
Forces a plugin to be synced to the cluster and removes other versions of the plugin.
name required | string |
{- "name": "emqx_plugin_demo-5.1-rc.2"
}
{- "code": "BAD_PLUGIN_INFO",
- "message": "string"
}
Update plugin config. Config schema defined by user's schema.avsc file.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+\w-[\w-.]$ |
{ }
{- "code": "BAD_CONFIG",
- "message": "string"
}
Describe a plugin according to its release.json
and README.md
.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+\w-[\w-.]$ |
{- "author": [
- "EMQX Team"
], - "builder": {
- "contact": "emqx-support@emqx.io",
- "name": "EMQX Team",
- "website": "www.emqx.com"
}, - "built_on_otp_release": "24",
- "compatibility": {
- "emqx": "~>5.0"
}, - "description": "This is an demo plugin description",
- "functionality": [
- "Demo"
], - "git_commit_or_build_date": "2021-12-25",
- "git_ref": "ddab50fafeed6b1faea70fc9ffd8c700d7e26ec1",
- "health_status": {
- "message": "Port unavailable: 3306",
- "status": "error"
}, - "metadata_vsn": "0.1.0",
- "name": "emqx_plugin_template-5.0-rc.1",
- "readme": "This is an demo plugin.",
- "rel_apps": [
- "emqx_plugin_template-5.0.0",
- "map_sets-1.1.0"
], - "rel_vsn": "5.0-rc.1",
- "running_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "running"
}
]
}
Setting the boot order of plugins.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+\w-[\w-.]$ |
string or string or string
|
{- "position": "after:emqx_plugin_demo-5.1-rc.2"
}
{- "code": "MOVE_FAILED",
- "message": "string"
}
start/stop a installed plugin.
- start: start the plugin.
- stop: stop the plugin.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+\w-[\w-.]$ |
action required | string Enum: "start" "stop" Action |
{- "code": "NOT_FOUND",
- "message": "string"
}
Upload plugin config
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+\w-[\w-.]$ |
config | string <binary> |
{- "code": "BAD_CONFIG",
- "message": "string"
}
Restart listeners on all nodes.
id required | string Example: tcp:demo The identifier of the listener, in the format of {type}:{name}, e.g. 'tcp:default', 'ssl:default', etc. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
List all running node's listeners for the specified type.
type | string Enum: "tcp" "ssl" "ws" "wss" "quic" Example: type=tcp Type of the listener (tcp, ssl, ws, wss, quic) |
[- {
- "acceptors": 16,
- "bind": "0.0.0.0:1884",
- "enable": true,
- "id": "tcp:demo",
- "name": "demo",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 100,
- "max_connections": 1024000,
- "running": true
}
}, - {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 101,
- "max_connections": 1024000,
- "running": true
}
}
], - "number": 2,
- "status": {
- "current_connections": 201,
- "max_connections": 2048000,
- "running": true
}, - "type": "tcp"
}, - {
- "acceptors": 32,
- "bind": "0.0.0.0:1883",
- "enable": true,
- "id": "tcp:default",
- "name": "default",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 200,
- "max_connections": "infinity",
- "running": true
}
}, - {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 301,
- "max_connections": "infinity",
- "running": true
}
}
], - "number": 2,
- "status": {
- "current_connections": 501,
- "max_connections": "infinity",
- "running": true
}, - "type": "tcp"
}
]
Create the specified listener on all nodes.
acceptors | integer >= 1 Default: 16 The size of the listener's receiving pool. |
bind required | string Default: 14567 IP address and port for the listening socket. |
bytes_burst | string Number of bytes that can be sent in a burst, on top of regular |
bytes_rate | string Limits the number of bytes a single client can send to the broker, per each node. |
ciphers | Array of strings Default: ["TLS_AES_256_GCM_SHA384","TLS_AES_128_GCM_SHA256","TLS_CHACHA20_POLY1305_SHA256"] This config holds TLS cipher suite names separated by comma, |
current_connections | integer >= 0 Current number of connections. |
enable | boolean Default: true Enable listener. |
enable_authn | string Default: true Enum: true false "quick_deny_anonymous" Set |
max_conn_burst | string Number of connections that can be accepted in a burst, on top of regular rate, per each node. |
max_conn_rate | string Limits how quickly this listener accepts connections, per each node. |
integer or string Default: "infinity" The maximum number of concurrent connections allowed by the listener. | |
messages_burst | string Number of messages that can be sent in a burst, on top of regular |
messages_rate | string Limits the number of messages a single client can send to the broker, per each node. |
mountpoint | string Default: ""
|
name required | string Name of the listener. |
running | boolean Status of the listener. 'true' for running, otherwise 'false'. |
object (emqx.listener_quic_ssl_opts) | |
type required | string Value: "quic" Type of the listener (tcp, ssl, ws, wss, quic) |
zone | string Default: "default" The configuration zone to which the listener belongs. |
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "0.0.0.0:1884",
- "current_connections": 10240,
- "max_connections": 204800,
- "mountpoint": "/",
- "name": "demo",
- "proxy_protocol": false,
- "proxy_protocol_timeout": "3s",
- "running": true,
- "tcp_options": {
- "active_n": 100,
- "backlog": 1024,
- "buffer": "4KB",
- "high_watermark": "1MB",
- "nodelay": false,
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true
}, - "type": "tcp",
- "zone": "default"
}
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "0.0.0.0:1884",
- "current_connections": 10240,
- "id": "tcp:demo",
- "max_connections": 204800,
- "mountpoint": "/",
- "proxy_protocol": false,
- "proxy_protocol_timeout": "3s",
- "running": true,
- "tcp_options": {
- "active_n": 100,
- "backlog": 1024,
- "buffer": "4KB",
- "high_watermark": "1MB",
- "nodelay": false,
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true
}, - "type": "tcp",
- "zone": "default"
}
Stop the listener on all nodes.
id required | string Example: tcp:demo The identifier of the listener, in the format of {type}:{name}, e.g. 'tcp:default', 'ssl:default', etc. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
List all running node's listeners live status. group by listener type
[- {
- "enable": false,
- "ids": [
- "tcp:demo"
], - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 11,
- "max_connections": 1024000,
- "running": true
}
}, - {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}
}
], - "status": {
- "current_connections": 21,
- "max_connections": 2048000,
- "running": true
}, - "type": "tcp"
}, - {
- "enable": false,
- "ids": [
- "ssl:default"
], - "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 31,
- "max_connections": "infinity",
- "running": true
}
}, - {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 40,
- "max_connections": "infinity",
- "running": true
}
}
], - "status": {
- "current_connections": 71,
- "max_connections": "infinity",
- "running": true
}, - "type": "ssl"
}
]
Delete the specified listener on all nodes.
id required | string Example: tcp:demo The identifier of the listener, in the format of {type}:{name}, e.g. 'tcp:default', 'ssl:default', etc. |
{- "code": "BAD_LISTENER_ID",
- "message": "string"
}
List all running node's listeners for the specified id.
id required | string Example: tcp:demo The identifier of the listener, in the format of {type}:{name}, e.g. 'tcp:default', 'ssl:default', etc. |
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "0.0.0.0:1884",
- "current_connections": 10240,
- "id": "tcp:demo",
- "max_connections": 204800,
- "mountpoint": "/",
- "proxy_protocol": false,
- "proxy_protocol_timeout": "3s",
- "running": true,
- "tcp_options": {
- "active_n": 100,
- "backlog": 1024,
- "buffer": "4KB",
- "high_watermark": "1MB",
- "nodelay": false,
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true
}, - "type": "tcp",
- "zone": "default"
}
Update the specified listener on all nodes.
id required | string Example: tcp:demo The identifier of the listener, in the format of {type}:{name}, e.g. 'tcp:default', 'ssl:default', etc. |
acceptors | integer >= 1 Default: 16 The size of the listener's receiving pool. |
access_rules | Array of strings Default: ["allow all"] An access rule list consisting of string rules to restrict or allow access from some addresses. The rules that appear earlier in the list are matched first. |
bind | string Default: 8084 IP address and port for the listening socket. |
bytes_burst | string Number of bytes that can be sent in a burst, on top of regular |
bytes_rate | string Limits the number of bytes a single client can send to the broker, per each node. |
current_connections | integer >= 0 Current number of connections. |
enable | boolean Default: true Enable listener. |
enable_authn | string Default: true Enum: true false "quick_deny_anonymous" Set |
id required | string The identifier of the listener, in the format of {type}:{name}, e.g. 'tcp:default', 'ssl:default', etc. |
max_conn_burst | string Number of connections that can be accepted in a burst, on top of regular rate, per each node. |
max_conn_rate | string Limits how quickly this listener accepts connections, per each node. |
integer or string Default: "infinity" The maximum number of concurrent connections allowed by the listener. | |
messages_burst | string Number of messages that can be sent in a burst, on top of regular |
messages_rate | string Limits the number of messages a single client can send to the broker, per each node. |
mountpoint | string Default: ""
|
proxy_protocol | boolean Default: false Enable the Proxy Protocol V1/2 if the EMQX cluster is deployed behind HAProxy or Nginx. |
proxy_protocol_timeout | string Default: "3s" If a reverse proxy is deployed for EMQX, and the PROXY protocol is enabled at the proxy to pass the client's real IP, this option needs to be turned on so that EMQX can extract the client's real IP from the PROXY protocol header. |
running | boolean Status of the listener. 'true' for running, otherwise 'false'. |
object (emqx.listener_wss_opts) | |
object (emqx.tcp_opts) | |
type required | string Value: "wss" Type of the listener (tcp, ssl, ws, wss, quic) |
object (emqx.ws_opts) | |
zone | string Default: "default" The configuration zone to which the listener belongs. |
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "0.0.0.0:1884",
- "current_connections": 10240,
- "id": "tcp:demo",
- "max_connections": 204800,
- "mountpoint": "/",
- "proxy_protocol": false,
- "proxy_protocol_timeout": "3s",
- "running": true,
- "tcp_options": {
- "active_n": 100,
- "backlog": 1024,
- "buffer": "4KB",
- "high_watermark": "1MB",
- "nodelay": false,
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true
}, - "type": "tcp",
- "zone": "default"
}
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "0.0.0.0:1884",
- "current_connections": 10240,
- "id": "tcp:demo",
- "max_connections": 204800,
- "mountpoint": "/",
- "proxy_protocol": false,
- "proxy_protocol_timeout": "3s",
- "running": true,
- "tcp_options": {
- "active_n": 100,
- "backlog": 1024,
- "buffer": "4KB",
- "high_watermark": "1MB",
- "nodelay": false,
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true
}, - "type": "tcp",
- "zone": "default"
}
Start the listener on all nodes.
id required | string Example: tcp:demo The identifier of the listener, in the format of {type}:{name}, e.g. 'tcp:default', 'ssl:default', etc. |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get a schema by its name
name required | string Example: my_schema The schema name |
{- "description": "My Avro Schema",
- "name": "my_avro_schema",
- "source": "{\"type\":\"record\",\"name\":\"test\",\"fields\":[{\"type\":\"int\",\"name\":\"i\"},{\"type\":\"string\",\"name\":\"s\"}]}",
- "type": "avro"
}
Update an existing schema
name required | string Example: my_schema The schema name |
description | string Default: "" A description for this schema. |
required | object (schema_registry.external_http_params) |
type required | string Value: "external_http" Must be |
{- "description": "My Avro Schema",
- "source": "{\"type\":\"record\",\"name\":\"test\",\"fields\":[{\"type\":\"int\",\"name\":\"i\"},{\"type\":\"string\",\"name\":\"s\"}]}",
- "type": "avro"
}
{- "description": "My Avro Schema",
- "name": "my_avro_schema",
- "source": "{\"type\":\"record\",\"name\":\"test\",\"fields\":[{\"type\":\"int\",\"name\":\"i\"},{\"type\":\"string\",\"name\":\"s\"}]}",
- "type": "avro"
}
Lookup external schema registry
name required | string Example: my_registry External registry name |
{- "auth": {
- "mechanism": "basic",
- "password": "******",
- "username": "cpsruser"
}, - "type": "confluent",
}
Update external schema registry
name required | string Example: my_registry External registry name |
schema_registry.confluent_schema_registry_auth_basic (object) or string Default: "none" Authentication options for accessing external registry. | |
type | string Default: "confluent" Value: "confluent" External Schema Registry Type |
url required | string URL endpoint for external registry. |
{- "auth": {
- "mechanism": "basic",
- "password": "******",
- "username": "cpsruser"
}, - "type": "confluent",
}
{- "auth": {
- "mechanism": "basic",
- "password": "******",
- "username": "cpsruser"
}, - "type": "confluent",
}
[- {
- "description": "My Avro Schema",
- "name": "my_avro_schema",
- "source": "{\"type\":\"record\",\"name\":\"test\",\"fields\":[{\"type\":\"int\",\"name\":\"i\"},{\"type\":\"string\",\"name\":\"s\"}]}",
- "type": "avro"
}
]
Register a new schema
description | string Default: "" A description for this schema. |
name required | string A name for the schema that will serve as its identifier. |
required | object (schema_registry.external_http_params) |
type required | string Value: "external_http" Must be |
{- "description": "My Avro Schema",
- "name": "my_avro_schema",
- "source": "{\"type\":\"record\",\"name\":\"test\",\"fields\":[{\"type\":\"int\",\"name\":\"i\"},{\"type\":\"string\",\"name\":\"s\"}]}",
- "type": "avro"
}
{- "description": "My Avro Schema",
- "name": "my_avro_schema",
- "source": "{\"type\":\"record\",\"name\":\"test\",\"fields\":[{\"type\":\"int\",\"name\":\"i\"},{\"type\":\"string\",\"name\":\"s\"}]}",
- "type": "avro"
}
Create external schema registry
schema_registry.confluent_schema_registry_auth_basic (object) or string Default: "none" Authentication options for accessing external registry. | |
name required | string |
type | string Default: "confluent" Value: "confluent" External Schema Registry Type |
url required | string URL endpoint for external registry. |
{- "auth": {
- "mechanism": "basic",
- "password": "******",
- "username": "cpsruser"
}, - "name": "test",
- "type": "confluent",
}
{- "auth": {
- "mechanism": "basic",
- "password": "******",
- "username": "cpsruser"
}, - "name": "test",
- "type": "confluent",
}
Delete the specific api_key. This API can only be requested using a bearer token.
name required | string Example: EMQX-API-KEY-1 ^[A-Za-z]+[A-Za-z0-9-_]*$ |
{- "code": "NOT_FOUND",
- "message": "string"
}
Return the specific api_key. This API can only be requested using a bearer token.
name required | string Example: EMQX-API-KEY-1 ^[A-Za-z]+[A-Za-z0-9-_]*$ |
{- "api_key": "a4697a5c75a769f6",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true,
- "expired_at": "2021-12-05T02:01:34.186Z",
- "name": "EMQX-API-KEY-1",
- "role": "administrator"
}
Update the specific api_key. This API can only be requested using a bearer token.
name required | string Example: EMQX-API-KEY-1 ^[A-Za-z]+[A-Za-z0-9-_]*$ |
desc | string |
enable | boolean Enable/Disable |
expired | boolean Expired |
(integer or string) or string Default: "infinity" No longer valid datetime | |
role | string Default: "administrator" Role for this API |
{- "desc": "Note",
- "enable": true,
- "expired": true,
- "expired_at": "2021-12-05T02:01:34.186Z",
- "role": "administrator"
}
{- "api_key": "a4697a5c75a769f6",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true,
- "expired_at": "2021-12-05T02:01:34.186Z",
- "name": "EMQX-API-KEY-1",
- "role": "administrator"
}
Return api_key list. This API can only be requested using a bearer token.
{- "api_key": "a4697a5c75a769f6",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true,
- "expired_at": "2021-12-05T02:01:34.186Z",
- "name": "EMQX-API-KEY-1",
- "role": "administrator"
}
Create new api_key. This API can only be requested using a bearer token.
desc | string |
enable | boolean Enable/Disable |
expired | boolean Expired |
(integer or string) or string Default: "infinity" No longer valid datetime | |
name | string Unique and format by [a-zA-Z0-9-_] |
role | string Default: "administrator" Role for this API |
{- "desc": "Note",
- "enable": true,
- "expired": true,
- "expired_at": "2021-12-05T02:01:34.186Z",
- "name": "EMQX-API-KEY-1",
- "role": "administrator"
}
{- "api_key": "a4697a5c75a769f6",
- "api_secret": "MzAyMjk3ODMwMDk0NjIzOTUxNjcwNzQ0NzQ3MTE2NDYyMDI",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true,
- "expired_at": "2021-12-05T02:01:34.186Z",
- "name": "EMQX-API-KEY-1",
- "role": "administrator"
}
{- "customer": "Foo",
- "customer_type": 10,
- "deployment": "bar-deployment",
- "email": "contact@foo.com",
- "expiry": false,
- "expiry_at": "2295-10-27",
- "max_sessions": 10,
- "start_at": "2022-01-11",
- "type": "trial"
}
Update a license key
required | string or string or string Default: "default" This configuration parameter is designated for the license key and supports below input formats: |
{- "key": "xxx"
}
{- "customer": "Foo",
- "customer_type": 10,
- "deployment": "bar-deployment",
- "email": "contact@foo.com",
- "expiry": false,
- "expiry_at": "2295-10-27",
- "max_sessions": 10,
- "start_at": "2022-01-11",
- "type": "trial"
}
Update license setting
connection_high_watermark | string Default: "80%" High watermark limit above which license connection quota usage alarms are activated |
connection_low_watermark | string Default: "75%" Low watermark limit below which license connection quota usage alarms are deactivated |
{- "connection_high_watermark": "80%",
- "connection_low_watermark": "75%"
}
{- "connection_high_watermark": "80%",
- "connection_low_watermark": "75%"
}
Get the information of a durable queue.
id required | string The ID of the durable queue. |
{- "created_at": "2024-01-01T12:34:56.789+02:00",
- "group": "mygrp",
- "id": "mygrp:1234EF",
- "start_time": "2024-01-01T00:00:00.000+02:00",
- "topic": "t/devices/#"
}
Get the list of durable queues.
cursor | string Opaque value representing the current iteration state. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "created_at": "2024-01-01T12:34:56.789+02:00",
- "group": "mygrp",
- "id": "mygrp:1234EF",
- "start_time": "2024-01-01T00:00:00.000+02:00",
- "topic": "t/devices/#"
}, - {
- "created_at": "2024-02-02T22:33:44.000+02:00",
- "group": "mygrp",
- "id": "mygrp:567890AABBCC",
- "start_time": "1970-01-01T02:00:00+02:00",
- "topic": "t/devices/#"
}
], - "meta": {
- "count": 2,
- "cursor": "g2wAAAADYQFhAm0AAAACYzJq",
- "hasnext": true
}
}
Declare new durable queue.
group required | string |
integer or string | |
topic required | string |
{- "group": "string",
- "start_time": 1640995200000,
- "topic": "string"
}
{- "created_at": "2024-01-01T12:34:56.789+02:00",
- "group": "mygrp",
- "id": "mygrp:1234EF",
- "start_time": "2024-01-01T00:00:00.000+02:00",
- "topic": "t/devices/#"
}
Get Dashboard Auth Token.
backend required | string Enum: "ldap" "oidc" "saml" Example: ldap |
backend required | string Value: "saml" Backend type. |
{- "backend": "saml"
}
{- "license": {
- "edition": "opensource"
}, - "role": "administrator",
- "token": "string",
- "version": "5.0.0"
}
Get details of a backend
backend required | string Enum: "ldap" "oidc" "saml" Example: ldap |
{- "backend": "saml",
- "enable": false,
- "sp_private_key": "pa$$word",
- "sp_public_key": "Pub Key",
- "sp_sign_request": false
}
Update a backend
backend required | string Enum: "ldap" "oidc" "saml" Example: ldap |
backend required | string Value: "saml" Backend type. |
dashboard_addr | string Default: "https://127.0.0.1:18083" The address of the EMQX Dashboard. |
enable | boolean Default: false Whether to enable this backend. |
idp_metadata_url | string Default: "https://idp.example.com" The URL of the IdP metadata. |
sp_private_key | string <password> The private key of the SP. |
sp_public_key | string Default: "Pub Key" The public key of the SP. |
sp_sign_request | boolean Default: false Whether to sign the SAML request. |
{- "backend": "saml",
- "enable": false,
- "sp_private_key": "pa$$word",
- "sp_public_key": "Pub Key",
- "sp_sign_request": false
}
{- "backend": "saml",
- "enable": false,
- "sp_private_key": "pa$$word",
- "sp_public_key": "Pub Key",
- "sp_sign_request": false
}
{- "allow_never_expire": true,
- "backend": {
- "enable": true,
- "index_specs": [
- [
- 2,
- 4
], - [
- 1,
- 3
]
], - "max_retained_messages": 0,
- "storage_type": "ram",
- "type": "built_in_database"
}, - "delivery_rate": "1000/s",
- "enable": true,
- "max_payload_size": "32MB",
- "max_publish_rate": "1000/s",
- "msg_clear_interval": "32s",
- "msg_expiry_interval": "32s",
- "msg_expiry_interval_override": "disabled",
- "stop_publish_clear_msg": false
}
Update retainer config.
allow_never_expire | boolean Default: true If true, retained messages set to never expire (i.e., whose |
object (retainer.mnesia_config) | |
delivery_rate | string Default: "1000/s" The maximum rate of delivering retained messages |
enable | boolean Deprecated Default: true Enable retainer feature |
max_payload_size | string Default: "1MB" The maximum size of retained messages allowed to be stored. EMQX will refuse to store retained messages larger than this size and output an Error log with the keyword 'retain_failed_for_payload_size_exceeded_limit'. |
max_publish_rate | string Default: "1000/s" The maximum rate of publishing retained messages. Messages that are published over the limit are delivered but not stored as retained. |
msg_clear_interval | string Default: "0s" The time interval for checking and clearing expired retained messages. This can prevent expired retained messages from being stored for a long time. |
msg_expiry_interval | string Default: "0s" Expired retained messages will not be delivered again, and a setting of 0 means that retained messages will never expire. |
string or string Default: "disabled" If set, this value will take precedence over any | |
stop_publish_clear_msg | boolean Default: false When the retained flag of the |
{- "allow_never_expire": true,
- "backend": {
- "enable": true,
- "index_specs": [
- [
- 2,
- 4
], - [
- 1,
- 3
]
], - "max_retained_messages": 0,
- "storage_type": "ram",
- "type": "built_in_database"
}, - "delivery_rate": "1000/s",
- "enable": true,
- "max_payload_size": "32MB",
- "max_publish_rate": "1000/s",
- "msg_clear_interval": "32s",
- "msg_expiry_interval": "32s",
- "msg_expiry_interval_override": "disabled",
- "stop_publish_clear_msg": false
}
{- "allow_never_expire": true,
- "backend": {
- "enable": true,
- "index_specs": [
- [
- 2,
- 4
], - [
- 1,
- 3
]
], - "max_retained_messages": 0,
- "storage_type": "ram",
- "type": "built_in_database"
}, - "delivery_rate": "1000/s",
- "enable": true,
- "max_payload_size": "32MB",
- "max_publish_rate": "1000/s",
- "msg_clear_interval": "32s",
- "msg_expiry_interval": "32s",
- "msg_expiry_interval_override": "disabled",
- "stop_publish_clear_msg": false
}
List retained messages.
topic | string Topic filter, supports wildcards, omit this to match all messages. |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "from_clientid": "string",
- "from_username": "string",
- "msgid": "string",
- "publish_at": "string",
- "qos": 0,
- "topic": "string"
}
], - "meta": {
- "count": 0,
- "hasnext": true,
- "limit": 50,
- "page": 1
}
}
Lookup a message by a topic without wildcards.
topic required | string Topic. |
{- "from_clientid": "string",
- "from_username": "string",
- "msgid": "string",
- "payload": "string",
- "publish_at": "string",
- "qos": 0,
- "topic": "string"
}
Node monitor (statistics) data, e.g. number of connections and connection rate on the specified node.
node required | string Example: emqx@127.0.0.1 Node name |
{- "cluster_sessions": 0,
- "connections": 0,
- "disconnected_durable_sessions": 0,
- "dropped_msg_rate": 0,
- "license_quota": 0,
- "live_connections": 0,
- "node_uptime": 0,
- "persisted_rate": 0,
- "received_msg_rate": 0,
- "retained_msg_count": 0,
- "sent_msg_rate": 0,
- "sessions_hist_hwmark": {
- "current_value": 0,
- "peak_time": 0,
- "peak_value": 0
}, - "shared_subscriptions": 0,
- "subscriptions": 0,
- "subscriptions_durable": 0,
- "topics": 0,
- "transformation_failed_rate": 0,
- "transformation_succeeded_rate": 0,
- "validation_failed_rate": 0,
- "validation_succeeded_rate": 0
}
List the monitor (statistics) data on the specified node.
node required | string Example: emqx@127.0.0.1 Node name |
latest | integer >= 1 Example: latest=300 The latest N seconds data. For example |
[- {
- "connections": 0,
- "disconnected_durable_sessions": 0,
- "dropped": 0,
- "live_connections": 0,
- "persisted": 0,
- "received": 0,
- "sent": 0,
- "subscriptions": 0,
- "subscriptions_durable": 0,
- "time_stamp": 0,
- "topics": 0,
- "transformation_failed": 0,
- "transformation_succeeded": 0,
- "validation_failed": 0,
- "validation_succeeded": 0
}
]
EMQX stats
aggregate | boolean Calculation aggregate for all nodes |
{- "channels.count": 0,
- "channels.max": 0,
- "cluster_sessions.count": 0,
- "cluster_sessions.max": 0,
- "connections.count": 0,
- "connections.max": 0,
- "delayed.count": 0,
- "delayed.max": 0,
- "live_connections.count": 0,
- "live_connections.max": 0,
- "retained.count": 0,
- "retained.max": 0,
- "sessions.count": 0,
- "sessions.max": 0,
- "suboptions.count": 0,
- "suboptions.max": 0,
- "subscribers.count": 0,
- "subscribers.max": 0,
- "subscriptions.count": 0,
- "subscriptions.max": 0,
- "subscriptions.shared.count": 0,
- "subscriptions.shared.max": 0,
- "topics.count": 0,
- "topics.max": 0
}
Current monitor (statistics) data, e.g. number of connections and connection rate in the whole cluster.
{- "cluster_sessions": 0,
- "connections": 0,
- "disconnected_durable_sessions": 0,
- "dropped_msg_rate": 0,
- "license_quota": 0,
- "live_connections": 0,
- "persisted_rate": 0,
- "received_msg_rate": 0,
- "retained_msg_count": 0,
- "sent_msg_rate": 0,
- "sessions_hist_hwmark": {
- "current_value": 0,
- "peak_time": 0,
- "peak_value": 0
}, - "shared_subscriptions": 0,
- "subscriptions": 0,
- "subscriptions_durable": 0,
- "topics": 0,
- "transformation_failed_rate": 0,
- "transformation_succeeded_rate": 0,
- "validation_failed_rate": 0,
- "validation_succeeded_rate": 0
}
EMQX metrics
aggregate | boolean Whether to aggregate all nodes Metrics. Default value is 'true'. |
node | string Specify which specific node to fetch data from. If not provided, return values for all nodes. This parameter only works when 'aggregate' is 'false'. |
[ ]
List monitor (statistics) data for the whole cluster.
latest | integer >= 1 Example: latest=300 The latest N seconds data. For example |
[- {
- "connections": 0,
- "disconnected_durable_sessions": 0,
- "dropped": 0,
- "live_connections": 0,
- "persisted": 0,
- "received": 0,
- "sent": 0,
- "subscriptions": 0,
- "subscriptions_durable": 0,
- "time_stamp": 0,
- "topics": 0,
- "transformation_failed": 0,
- "transformation_succeeded": 0,
- "validation_failed": 0,
- "validation_succeeded": 0
}
]
Possible HTTP response status code are:
200: All messages are delivered to at least one subscriber;
202: At least one message was not delivered to any subscriber;
400: At least one message is invalid. For example bad topic name, or QoS is out of range;
503: Failed to deliver at least one of the messages;
In case there is at lest one invalid message in the batch, the HTTP response body
is the same as for /publish
API.
Otherwise the HTTP response body is an array of JSON objects indicating the publish
result of each individual message in the batch.
clientid | string Deprecated |
payload required | string The MQTT message payload. |
payload_encoding | string Default: "plain" Enum: "plain" "base64" MQTT Payload Encoding, |
object (emqx_mgmt_api_publish.message_properties) | |
qos | integer [ 0 .. 2 ] Default: 0 MQTT message QoS |
retain | boolean Default: false A boolean field to indicate if this message should be retained. |
topic required | string Topic Name |
[- {
- "clientid": "string",
- "payload": "hello emqx api",
- "payload_encoding": "plain",
- "properties": {
- "content_type": "text/plain",
- "correlation_data": "string",
- "message_expiry_interval": 0,
- "payload_format_indicator": 0,
- "response_topic": "some_other_topic",
- "user_properties": {
- "foo": "bar"
}
}, - "qos": 0,
- "retain": false,
- "topic": "api/example/topic"
}
]
[- {
- "id": "string"
}
]
Possible HTTP status response codes are:200
: The message is delivered to at least one subscriber;202
: No matched subscribers;400
: Message is invalid. for example bad topic name, or QoS is out of range;503
: Failed to deliver the message to subscriber(s)
clientid | string Deprecated |
payload required | string The MQTT message payload. |
payload_encoding | string Default: "plain" Enum: "plain" "base64" MQTT Payload Encoding, |
object (emqx_mgmt_api_publish.message_properties) | |
qos | integer [ 0 .. 2 ] Default: 0 MQTT message QoS |
retain | boolean Default: false A boolean field to indicate if this message should be retained. |
topic required | string Topic Name |
{- "clientid": "string",
- "payload": "hello emqx api",
- "payload_encoding": "plain",
- "properties": {
- "content_type": "text/plain",
- "correlation_data": "string",
- "message_expiry_interval": 0,
- "payload_format_indicator": 0,
- "response_topic": "some_other_topic",
- "user_properties": {
- "foo": "bar"
}
}, - "qos": 0,
- "retain": false,
- "topic": "api/example/topic"
}
{- "id": "string"
}
Update auto subscribe topic list
nl | integer [ 0 .. 1 ] Default: 0 Default value 0. |
qos | integer [ 0 .. 2 ] Default: 0 Default value 0. Quality of service. |
rap | integer [ 0 .. 1 ] Default: 0 Default value 0. This option is used to specify whether the server retains the RETAIN mark when forwarding messages to the client, and this option does not affect the RETAIN mark in the retained message. Therefore, when the option Retain As Publish is set to 0, the client will directly distinguish whether this is a normal forwarded message or a retained message according to the RETAIN mark in the message, instead of judging whether this message is the first received after subscribing(the forwarded message may be sent before the retained message, which depends on the specific implementation of different brokers). |
rh | integer [ 0 .. 2 ] Default: 0 Default value 0. This option is used to specify whether the server forwards the retained message to the client when establishing a subscription. |
topic required | string Topic name, placeholders are supported. For example: client/${clientid}/username/${username}/host/${host}/port/${port} |
[- {
- "nl": 0,
- "qos": 0,
- "rap": 0,
- "rh": 0,
- "topic": "/clientid/${clientid}/username/${username}/host/${host}/port/${port}"
}
]
[- {
- "nl": 0,
- "qos": 0,
- "rap": 0,
- "rh": 0,
- "topic": "/clientid/${clientid}/username/${username}/host/${host}/port/${port}"
}
]
Get a device imported from GCP IoT Core
deviceid required | string Example: c2-ec-x509 Device identifier |
{- "config": "bXktY29uZmln",
- "created_at": 1690484400,
- "deviceid": "c2-ec-x509",
- "keys": [ ],
- "location": "europe-west1",
- "project": "iot-export",
- "registry": "my-registry"
}
Update a device imported from GCP IoT Core
deviceid required | string Example: c2-ec-x509 Device identifier |
config required | string Configuration |
Array of objects (emqx_gcp_device_api.key) Default: [] Public keys associated to GCP device | |
location | string Default: "" Cloud region |
project | string Default: "" Cloud project identifier |
registry | string Default: "" Device registry identifier |
{- "config": "bXktY29uZmln",
- "keys": [ ],
- "location": "europe-west1",
- "project": "iot-export",
- "registry": "my-registry"
}
{- "config": "bXktY29uZmln",
- "deviceid": "c2-ec-x509",
- "keys": [ ],
- "location": "europe-west1",
- "project": "iot-export",
- "registry": "my-registry"
}
List all devices imported from GCP IoT Core
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "data": [
- {
- "config": "bXktY29uZmln",
- "created_at": 1690484400,
- "deviceid": "c2-ec-x509",
- "keys": [ ],
- "location": "europe-west1",
- "project": "iot-export",
- "registry": "my-registry"
}
], - "meta": {
- "count": 0,
- "hasnext": true,
- "limit": 50,
- "page": 1
}
}
Import authentication and config data for devices from GCP IoT Core
blocked required | boolean Blocked |
config required | string Configuration |
deviceid required | string Device identifier |
Array of objects (emqx_gcp_device_api.key) Default: [] Public keys associated to GCP device | |
location | string Default: "" Cloud region |
project | string Default: "" Cloud project identifier |
registry | string Default: "" Device registry identifier |
[- {
- "blocked": false,
- "config": "bXktY29uZmln",
- "deviceid": "c2-ec-x509",
- "keys": [ ],
- "location": "europe-west1",
- "project": "iot-export",
- "registry": "my-registry"
}
]
{- "errors": 0,
- "imported": 14
}
Import users into the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Example: stomp:tcp:def Listener ID |
filename | string <binary> |
{- "failed": 0,
- "override": 0,
- "skipped": 0,
- "success": 0,
- "total": 0
}
Delete the authenticator of the specified gateway.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Gets the configuration of the specified gateway authenticator.
Returns 404 when gateway or authentication is not enabled.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Enables the authenticator for client authentication for the specified gateway.
When the authenticator is not configured or turned off, all client connections are assumed to be allowed.
Note: Only one authenticator is allowed to be enabled at a time in the gateway, rather than allowing multiple authenticators to be configured to form an authentication chain as in MQTT.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
required | Array of objects (authn.cinfo_check) A list of checks to perform on the client information. |
enable | boolean Default: true Set to |
mechanism required | string Value: "cinfo" Authentication mechanism. |
precondition | string Default: "" A Variform expression to evaluate with a set of pre-bound variables derived from the client information. |
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Update the configuration of the specified gateway authenticator, or disable the authenticator.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
required | Array of objects (authn.cinfo_check) A list of checks to perform on the client information. |
enable | boolean Default: true Set to |
mechanism required | string Value: "cinfo" Authentication mechanism. |
precondition | string Default: "" A Variform expression to evaluate with a set of pre-bound variables derived from the client information. |
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Import users into the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
filename | string <binary> |
{- "failed": 0,
- "override": 0,
- "skipped": 0,
- "success": 0,
- "total": 0
}
Delete the user for the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
uid required | string Example: test_username User ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get user info from the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
uid required | string Example: test_username User ID |
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
Update the user info for the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
uid required | string Example: test_username User ID |
is_superuser | boolean Default: false |
password required | string |
{- "password": "******"
}
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
Get the users for the authenticator (only supported by built_in_database
).
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
like_user_id | string Example: like_user_id=test_ Fuzzy search using user ID (username or clientid), only supports search by substring. |
is_superuser | boolean Is superuser |
{- "data": [
- {
- "user_id": "user1"
}, - {
- "is_superuser": true,
- "user_id": "user2"
}
], - "meta": {
- "count": 300,
- "limit": 20,
- "page": 0
}
}
Add user for the authenticator (only supports built_in_database).
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
is_superuser | boolean Default: false |
password required | string |
user_id required | string |
{- "password": "******",
- "user_id": "user1"
}
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
Gets a list of gateway listeners. This interface returns all the configs of the listener (including the authenticator on that listener), as well as the status of that listener running in the cluster.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
[- {
- "bind": "22212",
- "name": "udp-def",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}
}
], - "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}, - "type": "udp",
- "udp_options": {
- "active_n": 100,
- "buffer": "10KB",
- "recbuf": "10KB",
- "reuseaddr": true,
- "sndbuf": "10KB"
}
}, - {
- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22213",
- "dtls_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_none",
- "versions": [
- "dtlsv1.2",
- "dtlsv1"
]
}, - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "dtls-def",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}
}
], - "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}, - "type": "dtls",
- "udp_options": {
- "active_n": 100,
- "backlog": 1024
}
}, - {
- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22211",
- "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "ssl-def",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}
}
], - "ssl_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_none",
- "versions": [
- "tlsv1.3",
- "tlsv1.2",
- "tlsv1.1",
- "tlsv1"
]
}, - "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}, - "tcp_options": {
- "active_n": 100,
- "backlog": 1024
}, - "type": "ssl"
}, - {
- "acceptors": 16,
- "bind": "22210",
- "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "tcp-def",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}
}
], - "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}, - "tcp_options": {
- "active_n": 100,
- "backlog": 1024,
- "buffer": "10KB",
- "high_watermark": "1MB",
- "keepalive": "none",
- "nodelay": false,
- "recbuf": "10KB",
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "sndbuf": "10KB"
}, - "type": "tcp"
}, - {
- "acceptors": 16,
- "bind": "33043",
- "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "ws-def",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}
}
], - "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}, - "tcp_options": {
- "active_n": 100,
- "backlog": 1024,
- "buffer": "10KB",
- "high_watermark": "1MB",
- "keepalive": "none",
- "nodelay": false,
- "recbuf": "10KB",
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "sndbuf": "10KB"
}, - "type": "ws",
- "websocket": {
- "check_origin_enable": false,
- "check_origins": "http://localhost:18083, http://127.0.0.1:18083",
- "compress": false,
- "fail_if_no_subprotocol": true,
- "path": "/ocpp",
- "piggyback": "single",
- "supported_subprotocols": "ocpp1.6"
}
}, - {
- "acceptors": 16,
- "bind": "33053",
- "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "ws-ssl-def",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}
}
], - "ssl_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_none",
- "versions": [
- "tlsv1.3",
- "tlsv1.2",
- "tlsv1.1",
- "tlsv1"
]
}, - "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}, - "tcp_options": {
- "active_n": 100,
- "backlog": 1024,
- "buffer": "10KB",
- "high_watermark": "1MB",
- "keepalive": "none",
- "nodelay": false,
- "recbuf": "10KB",
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "sndbuf": "10KB"
}, - "type": "wss",
- "websocket": {
- "check_origin_enable": false,
- "check_origins": "http://localhost:18083, http://127.0.0.1:18083",
- "compress": false,
- "fail_if_no_subprotocol": true,
- "path": "/ocpp",
- "piggyback": "single",
- "supported_subprotocols": "ocpp1.6"
}
}, - {
- "acceptors": 16,
- "bind": "22214",
- "dtls_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "ciphers": "RSA-PSK-AES256-GCM-SHA384,RSA-PSK-AES256-CBC-SHA384,RSA-PSK-AES128-GCM-SHA256,RSA-PSK-AES128-CBC-SHA256,RSA-PSK-AES256-CBC-SHA,RSA-PSK-AES128-CBC-SHA",
- "fail_if_no_peer_cert": false,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "user_lookup_fun": "emqx_tls_psk:lookup",
- "verify": "verify_none",
- "versions": [
- "dtlsv1.2",
- "dtlsv1"
]
}, - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "dtls-psk",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}
}
], - "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}, - "type": "dtls"
}, - {
- "acceptors": 16,
- "authentication": {
- "backend": "built_in_database",
- "mechanism": "password_based",
- "password_hash_algorithm": {
- "name": "sha256"
}, - "user_id_type": "username"
}, - "bind": "22215",
- "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "tcp-with-authn",
- "node_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}
}
], - "status": {
- "current_connections": 10,
- "max_connections": 1024000,
- "running": true
}, - "type": "tcp"
}
]
Create the gateway listener.
Note: For listener types not supported by a gateway, this API returns 400: BAD_REQUEST
.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
acceptors | integer Default: 16 Size of the acceptor pool. |
access_rules | Array of strings Default: [] An access rule list consisting of string rules to restrict or allow access from some addresses. |
bind | string The IP address and port that the listener will bind. |
enable | boolean Default: true Enable the listener. |
enable_authn | boolean Default: true Set |
id | string Listener ID |
max_conn_rate | integer Default: 1000 Maximum connections per second. |
string or integer Default: 1024 The maximum number of concurrent connections allowed by the listener. | |
mountpoint | string When publishing or subscribing, prefix all topics with a mountpoint string. |
name | string Listener Name |
proxy_protocol | boolean Default: false If a reverse proxy is deployed for EMQX, and the PROXY protocol is enabled at the proxy to pass the client's real IP, |
proxy_protocol_timeout | string Default: "3s" Timeout for proxy protocol. |
running | boolean Listener Running status |
object (emqx.listener_wss_opts) | |
object (emqx.tcp_opts) | |
type | string Value: "wss" Listener Type |
object (gateway.websocket) |
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22213",
- "dtls_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_none",
- "versions": [
- "dtlsv1.2",
- "dtlsv1"
]
}, - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "dtls-def",
- "type": "dtls",
- "udp_options": {
- "active_n": 100,
- "backlog": 1024
}
}
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22213",
- "dtls_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_none",
- "versions": [
- "dtlsv1.2",
- "dtlsv1"
]
}, - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "dtls-def",
- "type": "dtls",
- "udp_options": {
- "active_n": 100,
- "backlog": 1024
}
}
Get the users for the authenticator (only supported by built_in_database
)
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
Add user for the authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
is_superuser | boolean Default: false |
password required | string |
user_id required | string |
{- "password": "******",
- "user_id": "user1"
}
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
Delete the gateway listener. All connected clients under the deleted listener will be disconnected.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the gateway listener configs
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22213",
- "dtls_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_none",
- "versions": [
- "dtlsv1.2",
- "dtlsv1"
]
}, - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "dtls-def",
- "type": "dtls",
- "udp_options": {
- "active_n": 100,
- "backlog": 1024
}
}
Update the gateway listener. The listener being updated performs a restart and all clients connected to that listener will be disconnected.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
acceptors | integer Default: 16 Size of the acceptor pool. |
access_rules | Array of strings Default: [] An access rule list consisting of string rules to restrict or allow access from some addresses. |
bind | string The IP address and port that the listener will bind. |
enable | boolean Default: true Enable the listener. |
enable_authn | boolean Default: true Set |
id | string Listener ID |
max_conn_rate | integer Default: 1000 Maximum connections per second. |
string or integer Default: 1024 The maximum number of concurrent connections allowed by the listener. | |
mountpoint | string When publishing or subscribing, prefix all topics with a mountpoint string. |
name | string Listener Name |
proxy_protocol | boolean Default: false If a reverse proxy is deployed for EMQX, and the PROXY protocol is enabled at the proxy to pass the client's real IP, |
proxy_protocol_timeout | string Default: "3s" Timeout for proxy protocol. |
running | boolean Listener Running status |
object (emqx.listener_wss_opts) | |
object (emqx.tcp_opts) | |
type | string Value: "wss" Listener Type |
object (gateway.websocket) |
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22213",
- "dtls_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_none",
- "versions": [
- "dtlsv1.2",
- "dtlsv1"
]
}, - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "dtls-def",
- "type": "dtls",
- "udp_options": {
- "active_n": 100,
- "backlog": 1024
}
}
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22213",
- "dtls_options": {
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_none",
- "versions": [
- "dtlsv1.2",
- "dtlsv1"
]
}, - "max_conn_rate": 1000,
- "max_connections": 1024000,
- "name": "dtls-def",
- "type": "dtls",
- "udp_options": {
- "active_n": 100,
- "backlog": 1024
}
}
Delete the user for the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
uid required | string User ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get user info from the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
uid required | string User ID |
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
Update the user info for the gateway authenticator (only supports built_in_database)
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
uid required | string User ID |
is_superuser | boolean Default: false |
password required | string |
{- "password": "******"
}
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
Remove authenticator for the listener.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the listener's authenticator configs.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Enable authenticator for specified listener for client authentication.
When authenticator is enabled for a listener, all clients connecting to that listener will use that authenticator for authentication.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
required | Array of objects (authn.cinfo_check) A list of checks to perform on the client information. |
enable | boolean Default: true Set to |
mechanism required | string Value: "cinfo" Authentication mechanism. |
precondition | string Default: "" A Variform expression to evaluate with a set of pre-bound variables derived from the client information. |
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Update authenticator configs for the listener, or disable/enable it.
name required | string Enum: "coap" "exproto" "gbt32960" "jt808" "lwm2m" "mqttsn" "ocpp" "stomp" Example: stomp Gateway Name |
id required | string Listener ID |
required | Array of objects (authn.cinfo_check) A list of checks to perform on the client information. |
enable | boolean Default: true Set to |
mechanism required | string Value: "cinfo" Authentication mechanism. |
precondition | string Default: "" A Variform expression to evaluate with a set of pre-bound variables derived from the client information. |
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
Serves as a health check for the node.
Returns response to describe the status of the node and the application.
This endpoint requires no authentication.
Returns status code 200 if the EMQX application is up and running, 503 otherwise.
This API was introduced in v5.0.10.
The GET /status
endpoint (without the /api/...
prefix) is also an alias to this endpoint and works in the same way.
This alias has been available since v5.0.0.
Starting from v5.0.25 or e5.0.4, you can also use 'format' parameter to get JSON format information.
format | string Default: "text" Specify the response format, 'text' (default) to return the HTTP body in free text, |
Purge white list for specific type
type required | string Enum: "clientid" "topic" Example: clientid Type of white list. Can be |
{- "code": "INTERNAL_ERROR",
- "message": "string"
}
Show the list of sampler white list for specific type
type required | string Enum: "clientid" "topic" Example: clientid Type of white list. Can be |
[- "clientid",
- "clientid2"
]
Update white list for specific type
type required | string Enum: "clientid" "topic" Example: clientid Type of white list. Can be |
[- "clientid",
- "clientid2"
]
{- "code": "INTERNAL_ERROR",
- "message": "string"
}
[- {
- "cluster_sessions": 0,
- "connections": 0,
- "edition": "Opensource",
- "live_connections": 0,
- "load1": 2.66,
- "load15": 2.66,
- "load5": 2.66,
- "log_path": "path/to/log | The log path is not yet set",
- "max_fds": 1024,
- "memory_total": "512.00M",
- "memory_used": "256.00M",
- "node": "emqx@127.0.0.1",
- "node_status": "running",
- "otp_release": "24.2/12.2",
- "process_available": 2097152,
- "process_used": 1024,
- "role": "core",
- "sys_path": "path/to/emqx",
- "uptime": 5120000,
- "version": "5.0.0"
}
]
Get node run-time counter metrics. Such as received or sent bytes or messages, the number of succeeded or failed authentications or authorizations, etc.
node required | string Example: emqx@127.0.0.1 Node name |
{- "messages.transformation_failed": 0,
- "session.created": 0,
- "packets.connack.sent": 0,
- "overload_protection.delay.ok": 0,
- "client.unsubscribe": 0,
- "messages.dropped.receive_maximum": 0,
- "session.discarded": 0,
- "authorization.cache_hit": 0,
- "packets.pubcomp.sent": 0,
- "messages.persisted": 0,
- "messages.qos0.received": 0,
- "packets.puback.sent": 0,
- "packets.publish.sent": 0,
- "packets.pubrel.missed": 0,
- "client.connected": 0,
- "packets.suback.sent": 0,
- "messages.validation_failed": 0,
- "messages.dropped.quota_exceeded": 0,
- "client.authenticate": 0,
- "messages.dropped": 0,
- "delivery.dropped.qos0_msg": 0,
- "packets.received": 0,
- "packets.auth.sent": 0,
- "packets.subscribe.error": 0,
- "messages.publish": 0,
- "overload_protection.new_conn": 0,
- "packets.pubrel.received": 0,
- "authentication.success.anonymous": 0,
- "authentication.success": 0,
- "packets.pubrec.received": 0,
- "delivery.dropped": 0,
- "client.disconnected": 0,
- "messages.delivered": 0,
- "client.authorize": 0,
- "messages.transformation_succeeded": 0,
- "messages.qos1.received": 0,
- "packets.unsubscribe.error": 0,
- "authorization.allow": 0,
- "overload_protection.gc": 0,
- "packets.publish.auth_error": 0,
- "delivery.dropped.no_local": 0,
- "session.takenover": 0,
- "packets.unsuback.sent": 0,
- "packets.publish.received": 0,
- "packets.puback.missed": 0,
- "packets.pubrec.missed": 0,
- "packets.publish.inuse": 0,
- "bytes.received": 0,
- "messages.qos2.sent": 0,
- "client.connack": 0,
- "packets.puback.received": 0,
- "packets.pubcomp.inuse": 0,
- "messages.qos2.received": 0,
- "packets.sent": 0,
- "packets.disconnect.sent": 0,
- "packets.pubrel.sent": 0,
- "packets.disconnect.received": 0,
- "packets.pingresp.sent": 0,
- "packets.connect.received": 0,
- "messages.sent": 0,
- "packets.publish.quota_exceeded": 0,
- "packets.auth.received": 0,
- "messages.received": 0,
- "packets.pubrec.sent": 0,
- "authorization.cache_miss": 0,
- "messages.dropped.await_pubrel_timeout": 0,
- "packets.subscribe.received": 0,
- "delivery.dropped.expired": 0,
- "session.terminated": 0,
- "overload_protection.hibernation": 0,
- "client.connect": 0,
- "messages.delayed": 0,
- "packets.pubcomp.received": 0,
- "authentication.failure": 0,
- "client.auth.anonymous": 0,
- "messages.qos1.sent": 0,
- "packets.pingreq.received": 0,
- "delivery.dropped.too_large": 0,
- "bytes.sent": 0,
- "overload_protection.delay.timeout": 0,
- "authorization.deny": 0,
- "packets.subscribe.auth_error": 0,
- "packets.connack.error": 0,
- "messages.dropped.no_subscribers": 0,
- "messages.forward": 0,
- "messages.acked": 0,
- "packets.puback.inuse": 0,
- "delivery.dropped.queue_full": 0,
- "packets.publish.error": 0,
- "messages.validation_succeeded": 0,
- "session.resumed": 0,
- "node": "string",
- "packets.pubrec.inuse": 0,
- "messages.qos0.sent": 0,
- "packets.unsubscribe.received": 0,
- "client.subscribe": 0,
- "packets.pubcomp.missed": 0,
- "packets.connack.auth_error": 0
}
Get node info
node required | string Example: emqx@127.0.0.1 Node name |
{- "cluster_sessions": 0,
- "connections": 0,
- "edition": "Opensource",
- "live_connections": 0,
- "load1": 2.66,
- "load15": 2.66,
- "load5": 2.66,
- "log_path": "path/to/log | The log path is not yet set",
- "max_fds": 1024,
- "memory_total": "512.00M",
- "memory_used": "256.00M",
- "node": "emqx@127.0.0.1",
- "node_status": "running",
- "otp_release": "24.2/12.2",
- "process_available": 2097152,
- "process_used": 1024,
- "role": "core",
- "sys_path": "path/to/emqx",
- "uptime": 5120000,
- "version": "5.0.0"
}
Get node run-time stats. Such as the number of topics, connections, etc.
node required | string Example: emqx@127.0.0.1 Node name |
{- "channels.count": 0,
- "channels.max": 0,
- "cluster_sessions.count": 0,
- "cluster_sessions.max": 0,
- "connections.count": 0,
- "connections.max": 0,
- "delayed.count": 0,
- "delayed.max": 0,
- "live_connections.count": 0,
- "live_connections.max": 0,
- "retained.count": 0,
- "retained.max": 0,
- "sessions.count": 0,
- "sessions.max": 0,
- "suboptions.count": 0,
- "suboptions.max": 0,
- "subscribers.count": 0,
- "subscribers.max": 0,
- "subscriptions.count": 0,
- "subscriptions.max": 0,
- "subscriptions.shared.count": 0,
- "subscriptions.shared.max": 0,
- "topics.count": 0,
- "topics.max": 0
}
List currently activated alarms or historical alarms, determined by query parameters.
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 10000 ] Default: 100 Example: limit=50 Results per page |
activated | boolean It is used to specify the alarm type of the query. |
{- "data": [
- {
- "activate_at": "2021-10-25T11:52:52.548+08:00",
- "deactivate_at": "2021-10-31T10:52:52.548+08:00",
- "details": {
- "high_watermark": 70
}, - "duration": 297056,
- "message": "System memory usage is higher than 70%",
- "name": "high_system_memory_usage",
- "node": "emqx@127.0.0.1"
}
], - "meta": {
- "count": 0,
- "hasnext": true,
- "limit": 50,
- "page": 1
}
}