Download OpenAPI specification:Download
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"
}
Update user in authenticator in global authentication chain.
id required | string Authenticator ID. |
user_id required | string User ID. |
password required | string |
is_superuser | boolean Default: false |
{- "password": "******"
}
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
Import users into authenticator in global authentication chain.
id required | string Authenticator ID. |
filename | string <binary> |
{- "code": "BAD_REQUEST",
- "message": "string"
}
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 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
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. |
user_id required | string |
password required | string |
is_superuser | boolean Default: false |
{- "password": "******",
- "user_id": "user1"
}
{- "user_id": "user1"
}
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"
}
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. |
mechanism required | string Value: "scram" Authentication mechanism. |
backend required | string Value: "built_in_database" Backend type. |
algorithm | string Default: "sha256" Enum: "sha256" "sha512" Hashing algorithm. |
iteration_count | integer >= 0 Default: 4096 Iteration count. |
enable | boolean Default: true Set to |
{- "algorithm": "hmac-based",
- "mechanism": "jwt",
- "secret": "mysecret",
- "secret_base64_encoded": false,
- "use_jwks": false,
- "verify_claims": {
- "username": "${username}"
}
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
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": 5000,
- "enable_pipelining": 100,
- "headers": {
- "content-type": "application/json"
}, - "mechanism": "password_based",
- "method": "post",
- "pool_size": 8,
- "request_timeout": 5000,
- "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.
mechanism required | string Value: "scram" Authentication mechanism. |
backend required | string Value: "built_in_database" Backend type. |
algorithm | string Default: "sha256" Enum: "sha256" "sha512" Hashing algorithm. |
iteration_count | integer >= 0 Default: 4096 Iteration count. |
enable | boolean Default: true Set to |
{- "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}"
}
}
Node current status. Gauge and rate.
node required | string Example: emqx@127.0.0.1 EMQX node name. |
{- "dropped_msg_rate": 0,
- "received_msg_rate": 0,
- "sent_msg_rate": 0,
- "subscriptions": 0,
- "topics": 0,
- "connections": 0
}
List the monitor data on the node.
node required | string Example: emqx@127.0.0.1 EMQX node name. |
latest | integer >= 1 Example: latest=300 The latest N seconds data. Like 300 for 5 min. |
[- {
- "time_stamp": 0,
- "subscriptions": 0,
- "topics": 0,
- "connections": 0,
- "received": 0,
- "sent": 0,
- "dropped": 0
}
]
List monitor data.
latest | integer >= 1 Example: latest=300 The latest N seconds data. Like 300 for 5 min. |
[- {
- "time_stamp": 0,
- "subscriptions": 0,
- "topics": 0,
- "connections": 0,
- "received": 0,
- "sent": 0,
- "dropped": 0
}
]
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
}
View delayed message
node required | string The node where message from |
msgid required | string Delayed Message ID |
{- "msgid": 0,
- "node": "string",
- "publish_at": "string",
- "delayed_interval": 1,
- "delayed_remaining": 0,
- "expected_at": "string",
- "topic": "/sys/#",
- "qos": 0,
- "from_clientid": "string",
- "from_username": "string"
}
Update all rewrite rules
action required | string Enum: "subscribe" "publish" "all" Topic rewriting takes effect on the type of operation: |
source_topic required | string Source topic, specified by the client. |
dest_topic required | string Destination topic. |
re required | string Regular expressions |
[- {
- "action": "publish",
- "source_topic": "x/#",
- "dest_topic": "z/y/$1",
- "re": "^x/y/(.+)$"
}
]
[- {
- "action": "publish",
- "source_topic": "x/#",
- "dest_topic": "z/y/$1",
- "re": "^x/y/(.+)$"
}
]
Get topic metrics
topic required | string Example: testtopic/1 Topic string. Notice: Topic string in url path must be encoded |
{- "topic": "testtopic/1",
- "create_time": "2022-01-14T21:48:47+08:00",
- "reset_time": "2022-01-14T21:48:47+08:00",
- "metrics": {
- "message.dropped.count": 0,
- "message.in.count": 0,
- "message.out.count": 0,
- "message.qos0.in.count": 0,
- "message.qos0.out.count": 0,
- "message.qos1.in.count": 0,
- "message.qos1.out.count": 0,
- "message.qos2.in.count": 0,
- "message.qos2.out.count": 0,
- "message.dropped.rate": 0,
- "message.in.rate": 0,
- "message.out.rate": 0,
- "message.qos0.in.rate": 0,
- "message.qos0.out.rate": 0,
- "message.qos1.in.rate": 0,
- "message.qos1.out.rate": 0,
- "message.qos2.in.rate": 0,
- "message.qos2.out.rate": 0
}
}
[- {
- "topic": "testtopic/1",
- "create_time": "2022-01-14T21:48:47+08:00",
- "reset_time": "2022-01-14T21:48:47+08:00",
- "metrics": {
- "message.dropped.count": 0,
- "message.in.count": 0,
- "message.out.count": 0,
- "message.qos0.in.count": 0,
- "message.qos0.out.count": 0,
- "message.qos1.in.count": 0,
- "message.qos1.out.count": 0,
- "message.qos2.in.count": 0,
- "message.qos2.out.count": 0,
- "message.dropped.rate": 0,
- "message.in.rate": 0,
- "message.out.rate": 0,
- "message.qos0.in.rate": 0,
- "message.qos0.out.rate": 0,
- "message.qos1.in.rate": 0,
- "message.qos1.out.rate": 0,
- "message.qos2.in.rate": 0,
- "message.qos2.out.rate": 0
}
}
]
Create topic metrics
topic required | string Raw topic string |
{- "topic": "testtopic/1"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Reset telemetry status
topic | string Topic Name. If this parameter is not present,all created topic metrics will be reset. |
action required | string Action. Only support reset |
{- "action": "reset"
}
{- "code": "TOPIC_NOT_FOUND",
- "message": "string"
}
List delayed messages
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
{- "data": [
- {
- "msgid": 0,
- "node": "string",
- "publish_at": "string",
- "delayed_interval": 1,
- "delayed_remaining": 0,
- "expected_at": "string",
- "topic": "/sys/#",
- "qos": 0,
- "from_clientid": "string",
- "from_username": "string",
- "payload": "string"
}
], - "meta": {
- "page": 1,
- "limit": 1,
- "count": 0
}
}
Update the node-level limiter configs
max_conn_rate | string Maximum connection rate. |
messages_rate | string Messages publish rate. |
bytes_rate | string Data publish rate. |
{- "max_conn_rate": "1000/s",
- "messages_rate": "1000/s",
- "bytes_rate": "100MB/s"
}
{- "max_conn_rate": "1000/s",
- "messages_rate": "1000/s",
- "bytes_rate": "100MB/s"
}
Get the sub-configurations under sys_topics
{- "sys_msg_interval": "1m",
- "sys_heartbeat_interval": "30s",
- "sys_event_messages": {
- "client_connected": true,
- "client_disconnected": true,
- "client_subscribed": false,
- "client_unsubscribed": false
}
}
Update the sub-configurations under sys_topics
string or string Default: "1m" Time interval of publishing | |
string or string Default: "30s" Time interval for publishing following heartbeat messages: | |
object (broker.event_names) |
{- "sys_msg_interval": "1m",
- "sys_heartbeat_interval": "30s",
- "sys_event_messages": {
- "client_connected": true,
- "client_disconnected": true,
- "client_subscribed": false,
- "client_unsubscribed": false
}
}
{- "sys_msg_interval": "1m",
- "sys_heartbeat_interval": "30s",
- "sys_event_messages": {
- "client_connected": true,
- "client_disconnected": true,
- "client_subscribed": false,
- "client_unsubscribed": false
}
}
Get the sub-configurations under sysmon
{- "vm": {
- "process_check_interval": "12m",
- "process_high_watermark": "12%",
- "process_low_watermark": "12%",
- "long_gc": "disabled",
- "long_schedule": "240ms",
- "large_heap": "32MB",
- "busy_dist_port": true,
- "busy_port": true
}, - "os": {
- "cpu_check_interval": "12m",
- "cpu_high_watermark": "12%",
- "cpu_low_watermark": "12%",
- "mem_check_interval": "60s",
- "sysmem_high_watermark": "12%",
- "procmem_high_watermark": "12%"
}
}
Update the sub-configurations under sysmon
object (broker.sysmon_vm) | |
object (broker.sysmon_os) |
{- "vm": {
- "process_check_interval": "12m",
- "process_high_watermark": "12%",
- "process_low_watermark": "12%",
- "long_gc": "disabled",
- "long_schedule": "240ms",
- "large_heap": "32MB",
- "busy_dist_port": true,
- "busy_port": true
}, - "os": {
- "cpu_check_interval": "12m",
- "cpu_high_watermark": "12%",
- "cpu_low_watermark": "12%",
- "mem_check_interval": "60s",
- "sysmem_high_watermark": "12%",
- "procmem_high_watermark": "12%"
}
}
{- "vm": {
- "process_check_interval": "12m",
- "process_high_watermark": "12%",
- "process_low_watermark": "12%",
- "long_gc": "disabled",
- "long_schedule": "240ms",
- "large_heap": "32MB",
- "busy_dist_port": true,
- "busy_port": true
}, - "os": {
- "cpu_check_interval": "12m",
- "cpu_high_watermark": "12%",
- "cpu_low_watermark": "12%",
- "mem_check_interval": "60s",
- "sysmem_high_watermark": "12%",
- "procmem_high_watermark": "12%"
}
}
{- "mqtt": {
- "idle_timeout": "15s",
- "max_packet_size": "32MB",
- "max_clientid_len": 65535,
- "max_topic_levels": 128,
- "max_qos_allowed": 0,
- "max_topic_alias": 65535,
- "retain_available": true,
- "wildcard_subscription": true,
- "shared_subscription": true,
- "exclusive_subscription": false,
- "ignore_loop_deliver": false,
- "strict_mode": false,
- "response_information": "",
- "server_keepalive": "disabled",
- "keepalive_multiplier": 1.5,
- "max_subscriptions": "infinity",
- "upgrade_qos": false,
- "max_inflight": 32,
- "retry_interval": "12m",
- "max_awaiting_rel": 100,
- "await_rel_timeout": "12m",
- "session_expiry_interval": "12m",
- "max_mqueue_len": 1000,
- "mqueue_priorities": "disabled",
- "mqueue_default_priority": "highest",
- "mqueue_store_qos0": true,
- "use_username_as_clientid": false,
- "peer_cert_as_username": "disabled",
- "peer_cert_as_clientid": "disabled"
}, - "force_shutdown": {
- "enable": true,
- "max_mailbox_size": 1000,
- "max_heap_size": "1024KB"
}, - "force_gc": {
- "enable": true,
- "count": 16000,
- "bytes": "32MB"
}
}
Update global zone configs
object (broker.mqtt) | |
object (broker.force_shutdown) | |
object (broker.force_gc) |
{- "mqtt": {
- "idle_timeout": "15s",
- "max_packet_size": "32MB",
- "max_clientid_len": 65535,
- "max_topic_levels": 128,
- "max_qos_allowed": 0,
- "max_topic_alias": 65535,
- "retain_available": true,
- "wildcard_subscription": true,
- "shared_subscription": true,
- "exclusive_subscription": false,
- "ignore_loop_deliver": false,
- "strict_mode": false,
- "response_information": "",
- "server_keepalive": "disabled",
- "keepalive_multiplier": 1.5,
- "max_subscriptions": "infinity",
- "upgrade_qos": false,
- "max_inflight": 32,
- "retry_interval": "12m",
- "max_awaiting_rel": 100,
- "await_rel_timeout": "12m",
- "session_expiry_interval": "12m",
- "max_mqueue_len": 1000,
- "mqueue_priorities": "disabled",
- "mqueue_default_priority": "highest",
- "mqueue_store_qos0": true,
- "use_username_as_clientid": false,
- "peer_cert_as_username": "disabled",
- "peer_cert_as_clientid": "disabled"
}, - "force_shutdown": {
- "enable": true,
- "max_mailbox_size": 1000,
- "max_heap_size": "1024KB"
}, - "force_gc": {
- "enable": true,
- "count": 16000,
- "bytes": "32MB"
}
}
{- "mqtt": {
- "idle_timeout": "15s",
- "max_packet_size": "32MB",
- "max_clientid_len": 65535,
- "max_topic_levels": 128,
- "max_qos_allowed": 0,
- "max_topic_alias": 65535,
- "retain_available": true,
- "wildcard_subscription": true,
- "shared_subscription": true,
- "exclusive_subscription": false,
- "ignore_loop_deliver": false,
- "strict_mode": false,
- "response_information": "",
- "server_keepalive": "disabled",
- "keepalive_multiplier": 1.5,
- "max_subscriptions": "infinity",
- "upgrade_qos": false,
- "max_inflight": 32,
- "retry_interval": "12m",
- "max_awaiting_rel": 100,
- "await_rel_timeout": "12m",
- "session_expiry_interval": "12m",
- "max_mqueue_len": 1000,
- "mqueue_priorities": "disabled",
- "mqueue_default_priority": "highest",
- "mqueue_store_qos0": true,
- "use_username_as_clientid": false,
- "peer_cert_as_username": "disabled",
- "peer_cert_as_clientid": "disabled"
}, - "force_shutdown": {
- "enable": true,
- "max_mailbox_size": 1000,
- "max_heap_size": "1024KB"
}, - "force_gc": {
- "enable": true,
- "count": 16000,
- "bytes": "32MB"
}
}
Update the sub-configurations under alarm
actions | Array of strings Default: ["log","publish"] The actions triggered when the alarm is activated. |
size_limit | integer [ 1 .. 3000 ] Default: 1000 The maximum total number of deactivated alarms to keep as history. |
validity_period | string Default: "24h" Retention time of deactivated alarms. Alarms are not deleted immediately |
{- "actions": [
- "log",
- "publish"
], - "size_limit": 1000,
- "validity_period": "24h"
}
{- "actions": [
- "log",
- "publish"
], - "size_limit": 1000,
- "validity_period": "24h"
}
Get the sub-configurations under persistent_session_store
{- "enabled": false,
- "on_disc": true,
- "ram_cache": false,
- "backend": {
- "messages": {
- "ram_cache": "false"
}, - "session": {
- "ram_cache": "true"
}, - "session_messages": {
- "ram_cache": "true"
}, - "type": "builtin"
}, - "max_retain_undelivered": "12m",
- "message_gc_interval": "12m",
- "session_message_gc_interval": "12m"
}
Update the sub-configurations under persistent_session_store
enabled | boolean Default: false Use the database to store information about persistent sessions. |
on_disc | boolean Default: true Save information about the persistent sessions on disc. |
ram_cache | boolean Default: false Maintain a copy of the data in RAM for faster access. |
broker.persistent_session_builtin (object) Default: {"messages":{"ram_cache":"false"},"session":{"ram_cache":"true"},"session_messages":{"ram_cache":"true"},"type":"builtin"} Database management system used to store information about persistent sessions and messages. | |
max_retain_undelivered | string Default: "1h" The time messages that was not delivered to a persistent session |
message_gc_interval | string Default: "1h" The starting interval for garbage collection of undelivered messages to |
session_message_gc_interval | string Default: "1m" The starting interval for garbage collection of transient data for |
{- "enabled": false,
- "on_disc": true,
- "ram_cache": false,
- "backend": {
- "messages": {
- "ram_cache": "false"
}, - "session": {
- "ram_cache": "true"
}, - "session_messages": {
- "ram_cache": "true"
}, - "type": "builtin"
}, - "max_retain_undelivered": "12m",
- "message_gc_interval": "12m",
- "session_message_gc_interval": "12m"
}
{- "enabled": false,
- "on_disc": true,
- "ram_cache": false,
- "backend": {
- "messages": {
- "ram_cache": "false"
}, - "session": {
- "ram_cache": "true"
}, - "session_messages": {
- "ram_cache": "true"
}, - "type": "builtin"
}, - "max_retain_undelivered": "12m",
- "message_gc_interval": "12m",
- "session_message_gc_interval": "12m"
}
Get the sub-configurations under dashboard
{- "listeners": {
- "http": {
- "enable": true,
- "bind": "0.0.0.0:18083",
- "num_acceptors": 8,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false
}, - "https": {
- "enable": false,
- "bind": "0.0.0.0:18084",
- "num_acceptors": 8,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false,
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": "",
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "dhfile": "string",
- "honor_cipher_order": true,
- "client_renegotiation": true,
- "handshake_timeout": "12m"
}
}, - "token_expired_time": "12m",
- "cors": false
}
Update the sub-configurations under dashboard
object (dashboard.listeners) | |
token_expired_time | string Default: "60m" JWT token expiration time. Default is 60 minutes |
cors | boolean Default: false Support Cross-Origin Resource Sharing (CORS). |
{- "listeners": {
- "http": {
- "enable": true,
- "bind": "0.0.0.0:18083",
- "num_acceptors": 8,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false
}, - "https": {
- "enable": false,
- "bind": "0.0.0.0:18084",
- "num_acceptors": 8,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false,
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": "",
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "dhfile": "string",
- "honor_cipher_order": true,
- "client_renegotiation": true,
- "handshake_timeout": "12m"
}
}, - "token_expired_time": "12m",
- "cors": false
}
{- "listeners": {
- "http": {
- "enable": true,
- "bind": "0.0.0.0:18083",
- "num_acceptors": 8,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false
}, - "https": {
- "enable": false,
- "bind": "0.0.0.0:18084",
- "num_acceptors": 8,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false,
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": "",
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "dhfile": "string",
- "honor_cipher_order": true,
- "client_renegotiation": true,
- "handshake_timeout": "12m"
}
}, - "token_expired_time": "12m",
- "cors": false
}
Get the sub-configurations under zones
{- "$name": {
- "mqtt": {
- "idle_timeout": "12m",
- "max_packet_size": "32MB",
- "max_clientid_len": 23,
- "max_topic_levels": 1,
- "max_qos_allowed": 0,
- "max_topic_alias": 65535,
- "retain_available": true,
- "wildcard_subscription": true,
- "shared_subscription": true,
- "exclusive_subscription": true,
- "ignore_loop_deliver": true,
- "strict_mode": true,
- "response_information": "string",
- "server_keepalive": "disabled",
- "keepalive_multiplier": 0,
- "max_subscriptions": "infinity",
- "upgrade_qos": true,
- "max_inflight": 1,
- "retry_interval": "12m",
- "max_awaiting_rel": "infinity",
- "await_rel_timeout": "12m",
- "session_expiry_interval": "12m",
- "max_mqueue_len": "infinity",
- "mqueue_priorities": { },
- "mqueue_default_priority": "highest",
- "mqueue_store_qos0": true,
- "use_username_as_clientid": true,
- "peer_cert_as_username": "disabled",
- "peer_cert_as_clientid": "disabled"
}, - "force_shutdown": {
- "enable": true,
- "max_mailbox_size": 0,
- "max_heap_size": "1024KB"
}, - "force_gc": {
- "enable": true,
- "count": 0,
- "bytes": "32MB"
}
}
}
Update the sub-configurations under zones
object (broker.zone) |
{- "$name": {
- "mqtt": {
- "idle_timeout": "12m",
- "max_packet_size": "32MB",
- "max_clientid_len": 23,
- "max_topic_levels": 1,
- "max_qos_allowed": 0,
- "max_topic_alias": 65535,
- "retain_available": true,
- "wildcard_subscription": true,
- "shared_subscription": true,
- "exclusive_subscription": true,
- "ignore_loop_deliver": true,
- "strict_mode": true,
- "response_information": "string",
- "server_keepalive": "disabled",
- "keepalive_multiplier": 0,
- "max_subscriptions": "infinity",
- "upgrade_qos": true,
- "max_inflight": 1,
- "retry_interval": "12m",
- "max_awaiting_rel": "infinity",
- "await_rel_timeout": "12m",
- "session_expiry_interval": "12m",
- "max_mqueue_len": "infinity",
- "mqueue_priorities": { },
- "mqueue_default_priority": "highest",
- "mqueue_store_qos0": true,
- "use_username_as_clientid": true,
- "peer_cert_as_username": "disabled",
- "peer_cert_as_clientid": "disabled"
}, - "force_shutdown": {
- "enable": true,
- "max_mailbox_size": 0,
- "max_heap_size": "1024KB"
}, - "force_gc": {
- "enable": true,
- "count": 0,
- "bytes": "32MB"
}
}
}
{- "$name": {
- "mqtt": {
- "idle_timeout": "12m",
- "max_packet_size": "32MB",
- "max_clientid_len": 23,
- "max_topic_levels": 1,
- "max_qos_allowed": 0,
- "max_topic_alias": 65535,
- "retain_available": true,
- "wildcard_subscription": true,
- "shared_subscription": true,
- "exclusive_subscription": true,
- "ignore_loop_deliver": true,
- "strict_mode": true,
- "response_information": "string",
- "server_keepalive": "disabled",
- "keepalive_multiplier": 0,
- "max_subscriptions": "infinity",
- "upgrade_qos": true,
- "max_inflight": 1,
- "retry_interval": "12m",
- "max_awaiting_rel": "infinity",
- "await_rel_timeout": "12m",
- "session_expiry_interval": "12m",
- "max_mqueue_len": "infinity",
- "mqueue_priorities": { },
- "mqueue_default_priority": "highest",
- "mqueue_store_qos0": true,
- "use_username_as_clientid": true,
- "peer_cert_as_username": "disabled",
- "peer_cert_as_clientid": "disabled"
}, - "force_shutdown": {
- "enable": true,
- "max_mailbox_size": 0,
- "max_heap_size": "1024KB"
}, - "force_gc": {
- "enable": true,
- "count": 0,
- "bytes": "32MB"
}
}
}
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: "zones" "persistent_session_store" "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"
}
Get all the configurations of the specified node, including hot and non-hot updatable items.
node | string Example: node=emqx@127.0.0.1 Node's name: If you do not fill in the fields, this node will be used by default. |
{- "zones": {
- "$name": {
- "mqtt": {
- "idle_timeout": "12m",
- "max_packet_size": "32MB",
- "max_clientid_len": 23,
- "max_topic_levels": 1,
- "max_qos_allowed": 0,
- "max_topic_alias": 65535,
- "retain_available": true,
- "wildcard_subscription": true,
- "shared_subscription": true,
- "exclusive_subscription": true,
- "ignore_loop_deliver": true,
- "strict_mode": true,
- "response_information": "string",
- "server_keepalive": "disabled",
- "keepalive_multiplier": 0,
- "max_subscriptions": "infinity",
- "upgrade_qos": true,
- "max_inflight": 1,
- "retry_interval": "12m",
- "max_awaiting_rel": "infinity",
- "await_rel_timeout": "12m",
- "session_expiry_interval": "12m",
- "max_mqueue_len": "infinity",
- "mqueue_priorities": { },
- "mqueue_default_priority": "highest",
- "mqueue_store_qos0": true,
- "use_username_as_clientid": true,
- "peer_cert_as_username": "disabled",
- "peer_cert_as_clientid": "disabled"
}, - "force_shutdown": {
- "enable": true,
- "max_mailbox_size": 0,
- "max_heap_size": "1024KB"
}, - "force_gc": {
- "enable": true,
- "count": 0,
- "bytes": "32MB"
}
}
}, - "log": {
- "console": {
- "level": "debug",
- "enable": true,
- "formatter": "text",
- "time_offset": "system"
}, - "file": {
- "level": "warning"
}
}, - "sysmon": {
- "vm": {
- "process_check_interval": "12m",
- "process_high_watermark": "12%",
- "process_low_watermark": "12%",
- "long_gc": "disabled",
- "long_schedule": "240ms",
- "large_heap": "32MB",
- "busy_dist_port": true,
- "busy_port": true
}, - "os": {
- "cpu_check_interval": "12m",
- "cpu_high_watermark": "12%",
- "cpu_low_watermark": "12%",
- "mem_check_interval": "60s",
- "sysmem_high_watermark": "12%",
- "procmem_high_watermark": "12%"
}
}, - "sys_topics": {
- "sys_msg_interval": "1m",
- "sys_heartbeat_interval": "30s",
- "sys_event_messages": {
- "client_connected": true,
- "client_disconnected": true,
- "client_subscribed": false,
- "client_unsubscribed": false
}
}, - "alarm": {
- "actions": [
- "log",
- "publish"
], - "size_limit": 1000,
- "validity_period": "24h"
}, - "dashboard": {
- "listeners": {
- "http": {
- "enable": true,
- "bind": "0.0.0.0:18083",
- "num_acceptors": 8,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false
}, - "https": {
- "enable": false,
- "bind": "0.0.0.0:18084",
- "num_acceptors": 8,
- "max_connections": 512,
- "backlog": 1024,
- "send_timeout": "12m",
- "inet6": false,
- "ipv6_v6only": false,
- "proxy_header": false,
- "cacertfile": "${EMQX_ETC_DIR}/certs/cacert.pem",
- "certfile": "${EMQX_ETC_DIR}/certs/cert.pem",
- "keyfile": "${EMQX_ETC_DIR}/certs/key.pem",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": "",
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "dhfile": "string",
- "honor_cipher_order": true,
- "client_renegotiation": true,
- "handshake_timeout": "12m"
}
}, - "token_expired_time": "12m",
- "cors": false
}
}
Update the sub-configurations under log
object (emqx_conf_schema.console_handler) | |
object or emqx_conf_schema.log_file_handler (object) Default: {"level":"warning"} File-based log handlers. |
{- "console": {
- "level": "debug",
- "enable": true,
- "formatter": "text",
- "time_offset": "system"
}, - "file": {
- "level": "warning"
}
}
{- "console": {
- "level": "debug",
- "enable": true,
- "formatter": "text",
- "time_offset": "system"
}, - "file": {
- "level": "warning"
}
}
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"
}
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 |
{- "clientid": "urn:oma:lwm2m:oma:2",
- "path": "/3/0/7",
- "action": "discover",
- "codeMsg": "reply_not_received",
- "content": [
- {
- "operations": "E",
- "dataType": "Integer",
- "path": "urn:oma:lwm2m:oma:2",
- "name": "lwm2m-test"
}
]
}
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"
}
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"
}
Describs plugin according to its release.json
and README.md
.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+[A-Za-z0-9-_.]*$ |
{- "name": "emqx_plugin_template-5.0-rc.1",
- "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"
}, - "git_commit_or_build_date": "2021-12-25",
- "functionality": [
- "Demo"
], - "git_ref": "ddab50fafeed6b1faea70fc9ffd8c700d7e26ec1",
- "metadata_vsn": "0.1.0",
- "rel_vsn": "5.0-rc.1",
- "rel_apps": [
- "emqx_plugin_template-5.0.0",
- "map_sets-1.1.0"
], - "description": "This is an demo plugin description",
- "running_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "running"
}
], - "readme": "This is an demo plugin."
}
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]+[A-Za-z0-9-_.]*$ |
action required | string Enum: "start" "stop" Action |
{- "code": "NOT_FOUND",
- "message": "string"
}
Plugins are launched in top-down order.
Use POST /plugins/{name}/move
to change the boot order.
[- {
- "name": "emqx_plugin_template-5.0-rc.1",
- "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"
}, - "git_commit_or_build_date": "2021-12-25",
- "functionality": [
- "Demo"
], - "git_ref": "ddab50fafeed6b1faea70fc9ffd8c700d7e26ec1",
- "metadata_vsn": "0.1.0",
- "rel_vsn": "5.0-rc.1",
- "rel_apps": [
- "emqx_plugin_template-5.0.0",
- "map_sets-1.1.0"
], - "description": "This is an demo plugin description",
- "running_status": [
- {
- "node": "emqx@127.0.0.1",
- "status": "running"
}
], - "readme": "This is an demo plugin."
}
]
Setting the boot order of plugins.
name required | string Example: emqx_plugin_template-5.0-rc.1 ^[A-Za-z]+[A-Za-z0-9-_.]*$ |
string or string or string
|
{- "position": "after:emqx_plugin_demo-5.1-rc.2"
}
Upload a plugin tarball (plugin-vsn.tar.gz).Follow emqx-plugin-template to develop plugin.
plugin | string <binary> |
{- "code": "UNEXPECTED_ERROR",
- "message": "string"
}
Stop/Restart bridges on a specific node.
node required | |
id required | string Example: webhook:webhook_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"
}
Test creating a new bridge by given ID
The ID must be of format '{type}:{name}'
type required | string Value: "webhook" The Bridge Type |
name required | string Bridge name, used as a human-readable description of the bridge. |
enable | boolean Default: true Enable or disable this bridge |
object (bridge_webhook.creation_opts) | |
connect_timeout | string Default: "15s" The timeout when connecting to the HTTP server. |
retry_interval | string Deprecated |
pool_type | string Default: "random" Enum: "random" "hash" The type of the pool. Can be one of |
pool_size | integer >= 1 Default: 8 The pool size. |
enable_pipelining | integer >= 1 Default: 100 A positive integer. Whether to send HTTP requests continuously, when set to 1, it means that after each HTTP request is sent, you need to wait for the server to return and then continue to send the next request. |
object (connector-http.request) | |
object (broker.ssl_client_opts) | |
url required | string The URL of the HTTP Bridge. |
direction | string Deprecated Value: "egress" Deprecated, The direction of this bridge, MUST be 'egress' |
local_topic | string The MQTT topic filter to be forwarded to the HTTP server. All MQTT 'PUBLISH' messages with the topic |
method | string Default: "post" Enum: "post" "put" "get" "delete" The method of the HTTP request. All the available methods are: post, put, get, delete. |
headers | object Default: {"accept":"application/json","cache-control":"no-cache","connection":"keep-alive","content-type":"application/json","keep-alive":"timeout=5"} The headers of the HTTP request. |
body | string The body of the HTTP request. |
max_retries | integer >= 0 Default: 2 HTTP request max retry times if failed. |
request_timeout | string Deprecated Default: "15s" HTTP request timeout. |
{- "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,
- "mode": "cluster_shareload",
- "name": "mqtt_example",
- "password": "******",
- "proto_ver": "v4",
- "resource_opts": {
- "auto_restart_interval": "60s",
- "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"
}
{- "code": "TEST_FAILED",
- "message": "string"
}
Enable or Disable bridges on all nodes in the cluster.
id required | string Example: webhook:webhook_example 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 bridge metrics by Id
id required | string Example: webhook:webhook_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,
- "matched": 0,
- "queuing": 0,
- "retried": 0,
- "failed": 0,
- "inflight": 0,
- "success": 0,
- "rate": 0,
- "rate_max": 0,
- "rate_last5m": 0,
- "received": 0
}, - "node_metrics": [
- {
- "node": "emqx@127.0.0.1",
- "metrics": {
- "dropped": 0,
- "dropped.other": 0,
- "dropped.queue_full": 0,
- "dropped.resource_not_found": 0,
- "dropped.resource_stopped": 0,
- "matched": 0,
- "queuing": 0,
- "retried": 0,
- "failed": 0,
- "inflight": 0,
- "success": 0,
- "rate": 0,
- "rate_max": 0,
- "rate_last5m": 0,
- "received": 0
}
}
]
}
Get a bridge by Id
id required | string Example: webhook:webhook_example The bridge Id. Must be of format {type}:{name} |
{- "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,
- "mode": "cluster_shareload",
- "name": "mqtt_example",
- "password": "******",
- "proto_ver": "v4",
- "resource_opts": {
- "auto_restart_interval": "60s",
- "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"
}
Update a bridge by Id
id required | string Example: webhook:webhook_example The bridge Id. Must be of format {type}:{name} |
enable | boolean Default: true Enable or disable this bridge |
object (bridge_webhook.creation_opts) | |
connect_timeout | string Default: "15s" The timeout when connecting to the HTTP server. |
retry_interval | string Deprecated |
pool_type | string Default: "random" Enum: "random" "hash" The type of the pool. Can be one of |
pool_size | integer >= 1 Default: 8 The pool size. |
enable_pipelining | integer >= 1 Default: 100 A positive integer. Whether to send HTTP requests continuously, when set to 1, it means that after each HTTP request is sent, you need to wait for the server to return and then continue to send the next request. |
object (connector-http.request) | |
object (broker.ssl_client_opts) | |
url required | string The URL of the HTTP Bridge. |
direction | string Deprecated Value: "egress" Deprecated, The direction of this bridge, MUST be 'egress' |
local_topic | string The MQTT topic filter to be forwarded to the HTTP server. All MQTT 'PUBLISH' messages with the topic |
method | string Default: "post" Enum: "post" "put" "get" "delete" The method of the HTTP request. All the available methods are: post, put, get, delete. |
headers | object Default: {"accept":"application/json","cache-control":"no-cache","connection":"keep-alive","content-type":"application/json","keep-alive":"timeout=5"} The headers of the HTTP request. |
body | string The body of the HTTP request. |
max_retries | integer >= 0 Default: 2 HTTP request max retry times if failed. |
request_timeout | string Deprecated Default: "15s" HTTP request timeout. |
{- "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,
- "mode": "cluster_shareload",
- "password": "******",
- "proto_ver": "v4",
- "resource_opts": {
- "auto_restart_interval": "60s",
- "health_check_interval": "15s",
- "max_buffer_bytes": 104857600,
- "query_mode": "sync"
}, - "retry_interval": "15s",
- "server": "127.0.0.1:1883",
- "ssl": {
- "enable": false
}, - "username": "foo"
}
{- "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,
- "mode": "cluster_shareload",
- "name": "mqtt_example",
- "password": "******",
- "proto_ver": "v4",
- "resource_opts": {
- "auto_restart_interval": "60s",
- "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"
}
Stop/Restart bridges on all nodes in the cluster.
id required | string Example: webhook:webhook_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"
}
[- {
- "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,
- "mode": "cluster_shareload",
- "name": "mqtt_example",
- "password": "******",
- "proto_ver": "v4",
- "resource_opts": {
- "auto_restart_interval": "60s",
- "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"
}, - {
- "body": "${payload}",
- "connect_timeout": "15s",
- "enable": true,
- "enable_pipelining": 100,
- "local_topic": "emqx_webhook/#",
- "max_retries": 3,
- "method": "post",
- "name": "webhook_example",
- "pool_size": 4,
- "pool_type": "random",
- "request_timeout": "15s",
- "resource_opts": {
- "auto_restart_interval": 15000,
- "health_check_interval": 15000,
- "inflight_window": 100,
- "max_buffer_bytes": 104857600,
- "query_mode": "async",
- "worker_pool_size": 1
}, - "ssl": {
- "enable": false
}, - "type": "webhook",
}
]
Create a new bridge by type and name
type required | string Value: "webhook" The Bridge Type |
name required | string Bridge name, used as a human-readable description of the bridge. |
enable | boolean Default: true Enable or disable this bridge |
object (bridge_webhook.creation_opts) | |
connect_timeout | string Default: "15s" The timeout when connecting to the HTTP server. |
retry_interval | string Deprecated |
pool_type | string Default: "random" Enum: "random" "hash" The type of the pool. Can be one of |
pool_size | integer >= 1 Default: 8 The pool size. |
enable_pipelining | integer >= 1 Default: 100 A positive integer. Whether to send HTTP requests continuously, when set to 1, it means that after each HTTP request is sent, you need to wait for the server to return and then continue to send the next request. |
object (connector-http.request) | |
object (broker.ssl_client_opts) | |
url required | string The URL of the HTTP Bridge. |
direction | string Deprecated Value: "egress" Deprecated, The direction of this bridge, MUST be 'egress' |
local_topic | string The MQTT topic filter to be forwarded to the HTTP server. All MQTT 'PUBLISH' messages with the topic |
method | string Default: "post" Enum: "post" "put" "get" "delete" The method of the HTTP request. All the available methods are: post, put, get, delete. |
headers | object Default: {"accept":"application/json","cache-control":"no-cache","connection":"keep-alive","content-type":"application/json","keep-alive":"timeout=5"} The headers of the HTTP request. |
body | string The body of the HTTP request. |
max_retries | integer >= 0 Default: 2 HTTP request max retry times if failed. |
request_timeout | string Deprecated Default: "15s" HTTP request timeout. |
{- "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,
- "mode": "cluster_shareload",
- "name": "mqtt_example",
- "password": "******",
- "proto_ver": "v4",
- "resource_opts": {
- "auto_restart_interval": "60s",
- "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"
}
{- "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,
- "mode": "cluster_shareload",
- "name": "mqtt_example",
- "password": "******",
- "proto_ver": "v4",
- "resource_opts": {
- "auto_restart_interval": "60s",
- "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"
}
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, |
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 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
{- "data": [
- {
- "topic": "string",
- "node": "string"
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
Get node stats
node required | string Example: emqx@127.0.0.1 Node name |
{- "channels.count": 0,
- "channels.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
}
Get node metrics
node required | string Example: emqx@127.0.0.1 Node name |
{- "node": "string",
- "actions.failure": 0,
- "actions.success": 0,
- "bytes.received": 0,
- "bytes.sent": 0,
- "client.auth.anonymous": 0,
- "client.authenticate": 0,
- "client.check_authz": 0,
- "client.connack": 0,
- "client.connect": 0,
- "client.connected": 0,
- "client.disconnected": 0,
- "client.subscribe": 0,
- "client.unsubscribe": 0,
- "delivery.dropped": 0,
- "delivery.dropped.expired": 0,
- "delivery.dropped.no_local": 0,
- "delivery.dropped.qos0_msg": 0,
- "delivery.dropped.queue_full": 0,
- "delivery.dropped.too_large": 0,
- "messages.acked": 0,
- "messages.delayed": 0,
- "messages.delivered": 0,
- "messages.dropped": 0,
- "messages.dropped.await_pubrel_timeout": 0,
- "messages.dropped.no_subscribers": 0,
- "messages.forward": 0,
- "messages.publish": 0,
- "messages.qos0.received": 0,
- "messages.qos0.sent": 0,
- "messages.qos1.received": 0,
- "messages.qos1.sent": 0,
- "messages.qos2.received": 0,
- "messages.qos2.sent": 0,
- "messages.received": 0,
- "messages.retained": 0,
- "messages.sent": 0,
- "packets.auth.received": 0,
- "packets.auth.sent": 0,
- "packets.connack.auth_error": 0,
- "packets.connack.error": 0,
- "packets.connack.sent": 0,
- "packets.connect.received": 0,
- "packets.disconnect.received": 0,
- "packets.disconnect.sent": 0,
- "packets.pingreq.received": 0,
- "packets.pingresp.sent": 0,
- "packets.puback.inuse": 0,
- "packets.puback.missed": 0,
- "packets.puback.received": 0,
- "packets.puback.sent": 0,
- "packets.pubcomp.inuse": 0,
- "packets.pubcomp.missed": 0,
- "packets.pubcomp.received": 0,
- "packets.pubcomp.sent": 0,
- "packets.publish.auth_error": 0,
- "packets.publish.dropped": 0,
- "packets.publish.error": 0,
- "packets.publish.inuse": 0,
- "packets.publish.received": 0,
- "packets.publish.sent": 0,
- "packets.pubrec.inuse": 0,
- "packets.pubrec.missed": 0,
- "packets.pubrec.received": 0,
- "packets.pubrec.sent": 0,
- "packets.pubrel.missed": 0,
- "packets.pubrel.received": 0,
- "packets.pubrel.sent": 0,
- "packets.received": 0,
- "packets.sent": 0,
- "packets.suback.sent": 0,
- "packets.subscribe.auth_error": 0,
- "packets.subscribe.error": 0,
- "packets.subscribe.received": 0,
- "packets.unsuback.sent": 0,
- "packets.unsubscribe.error": 0,
- "packets.unsubscribe.received": 0,
- "rules.matched": 0,
- "session.created": 0,
- "session.discarded": 0,
- "session.resumed": 0,
- "session.takenover": 0,
- "session.terminated": 0
}
Get node info
node required | string Example: emqx@127.0.0.1 Node name |
{- "node": "emqx@127.0.0.1",
- "connections": 0,
- "load1": 2.66,
- "load5": 2.66,
- "load15": 2.66,
- "max_fds": 1024,
- "memory_total": "512.00M",
- "memory_used": "256.00M",
- "node_status": "running",
- "otp_release": "24.2/12.2",
- "process_available": 2097152,
- "process_used": 1024,
- "uptime": 5120000,
- "version": "5.0.0",
- "edition": "Opensource",
- "sys_path": "path/to/emqx",
- "log_path": "path/to/log | The log path is not yet set",
- "role": "core"
}
[- {
- "node": "emqx@127.0.0.1",
- "connections": 0,
- "load1": 2.66,
- "load5": 2.66,
- "load15": 2.66,
- "max_fds": 1024,
- "memory_total": "512.00M",
- "memory_used": "256.00M",
- "node_status": "running",
- "otp_release": "24.2/12.2",
- "process_available": 2097152,
- "process_used": 1024,
- "uptime": 5120000,
- "version": "5.0.0",
- "edition": "Opensource",
- "sys_path": "path/to/emqx",
- "log_path": "path/to/log | The log path is not yet set",
- "role": "core"
}
]
Get the detail information of Exhook server
name required | string Example: default The Exhook server name |
{- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}, - "node_metrics": [
- {
- "node": "string",
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "name": "default",
- "enable": true,
- "request_timeout": "12m",
- "failed_action": "deny",
- "ssl": {
- "cacertfile": "string",
- "certfile": "string",
- "keyfile": "string",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": "",
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "enable": false,
- "server_name_indication": "disable"
}, - "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "auto_reconnect": "60s",
- "pool_size": 8
}
Update the server
name required | string Example: default The Exhook server name |
name required | string Name of the exhook server |
enable | boolean Default: true Enable this Exhook server |
url required | string URL of the gRPC server |
request_timeout | string Default: "5s" The timeout of request gRPC 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 |
object (exhook.ssl_conf) | |
object (exhook.socket_options) | |
string or string Default: "60s" Whether to automatically reconnect (initialize) the gRPC server. | |
pool_size | integer >= 1 Default: 8 The process pool size for gRPC client |
{- "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"
},
}
{- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}, - "node_metrics": [
- {
- "node": "string",
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "name": "default",
- "enable": true,
- "request_timeout": "12m",
- "failed_action": "deny",
- "ssl": {
- "cacertfile": "string",
- "certfile": "string",
- "keyfile": "string",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": "",
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "enable": false,
- "server_name_indication": "disable"
}, - "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "auto_reconnect": "60s",
- "pool_size": 8
}
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"
}
[- {
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}, - "node_metrics": [
- {
- "node": "string",
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "name": "default",
- "enable": true,
- "request_timeout": "12m",
- "failed_action": "deny",
- "ssl": {
- "cacertfile": "string",
- "certfile": "string",
- "keyfile": "string",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": "",
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "enable": false,
- "server_name_indication": "disable"
}, - "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "auto_reconnect": "60s",
- "pool_size": 8
}
]
Add a server
name required | string Name of the exhook server |
enable | boolean Default: true Enable this Exhook server |
url required | string URL of the gRPC server |
request_timeout | string Default: "5s" The timeout of request gRPC 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 |
object (exhook.ssl_conf) | |
object (exhook.socket_options) | |
string or string Default: "60s" Whether to automatically reconnect (initialize) the gRPC server. | |
pool_size | integer >= 1 Default: 8 The process pool size for gRPC client |
{- "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"
},
}
{- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}, - "node_metrics": [
- {
- "node": "string",
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}
}
], - "node_status": [
- {
- "node": "string",
- "status": "connected"
}
], - "hooks": [
- {
- "name": "string",
- "params": {
- "$name": "string"
}
}
], - "name": "default",
- "enable": true,
- "request_timeout": "12m",
- "failed_action": "deny",
- "ssl": {
- "cacertfile": "string",
- "certfile": "string",
- "keyfile": "string",
- "verify": "verify_peer",
- "reuse_sessions": true,
- "depth": 10,
- "password": "",
- "versions": [
- "tlsv1.3",
- "tlsv1.2"
], - "ciphers": "",
- "secure_renegotiate": true,
- "log_level": "emergency",
- "hibernate_after": "12m",
- "enable": false,
- "server_name_indication": "disable"
}, - "socket_options": {
- "keepalive": true,
- "nodelay": true,
- "recbuf": "64KB",
- "sndbuf": "16KB"
}, - "auto_reconnect": "60s",
- "pool_size": 8
}
Get the hooks information of server
name required | string Example: default The Exhook server name |
[- {
- "name": "string",
- "params": {
- "$name": "string"
}, - "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}, - "node_metrics": [
- {
- "node": "string",
- "metrics": {
- "succeed": 0,
- "failed": 0,
- "rate": 0,
- "max_rate": 0
}
}
]
}
]
{- "enable": true,
- "headers": {
- "header-name": "header-value"
}, - "interval": "15s",
- "job_name": "${name}/instance/${name}~${host}",
}
Update Prometheus config
push_gateway_server required | string Default: "http://127.0.0.1:9091" URL of Prometheus server |
interval required | string Default: "15s" Data reporting interval |
headers | Array of objects Default: {} A list of HTTP Headers when pushing to Push Gateway. |
job_name required | string Default: "${name}/instance/${name}~${host}" Job Name that is pushed to the Push Gateway. Available variables: |
enable required | boolean Default: false Turn Prometheus data pushing on or off |
{- "enable": true,
- "headers": {
- "header-name": "header-value"
}, - "interval": "15s",
- "job_name": "${name}/instance/${name}~${host}",
}
{- "enable": true,
- "headers": {
- "header-name": "header-value"
}, - "interval": "15s",
- "job_name": "${name}/instance/${name}~${host}",
}
Update auto subscribe topic list
topic required | string Topic name, placeholders are supported. For example: client/${clientid}/username/${username}/host/${host}/port/${port} |
qos | integer [ 0 .. 2 ] Default: 0 Default value 0. Quality of service. |
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. |
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). |
nl | integer [ 0 .. 1 ] Default: 0 Default value 0. |
[- {
- "topic": "/clientid/${clientid}/username/${username}/host/${host}/port/${port}",
- "qos": 0,
- "rh": 0,
- "rap": 0,
- "nl": 0
}
]
[- {
- "topic": "/clientid/${clientid}/username/${username}/host/${host}/port/${port}",
- "qos": 0,
- "rh": 0,
- "rap": 0,
- "nl": 0
}
]
Remove authenticator for the listener.
name required | string Example: stomp Gateway Name. |
id required | string Listener ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the listener's authenticator configs.
name required | string 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 Example: stomp Gateway Name. |
id required | string Listener ID |
use_jwks required | string Value: true Whether to use JWKS. |
endpoint required | string JWKS endpoint, it's a read-only endpoint that returns the server's public key set in the JWKS format. |
pool_size | integer >= 1 Default: 8 Size of the connection pool towards the bridge target service. |
refresh_interval | integer Default: 300 JWKS refresh interval. |
object (broker.ssl_client_opts) | |
mechanism required | string Value: "jwt" Authentication mechanism. |
acl_claim_name | string Default: "acl" JWT claim name to use for getting ACL rules. |
verify_claims | Array of strings Default: {} A list of custom claims to validate, which is a list of name/value pairs. |
from | string Default: "password" Enum: "username" "password" Field to take JWT from. |
enable | boolean Default: true Set to |
{- "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 Example: stomp Gateway Name. |
id required | string Listener ID |
use_jwks required | string Value: true Whether to use JWKS. |
endpoint required | string JWKS endpoint, it's a read-only endpoint that returns the server's public key set in the JWKS format. |
pool_size | integer >= 1 Default: 8 Size of the connection pool towards the bridge target service. |
refresh_interval | integer Default: 300 JWKS refresh interval. |
object (broker.ssl_client_opts) | |
mechanism required | string Value: "jwt" Authentication mechanism. |
acl_claim_name | string Default: "acl" JWT claim name to use for getting ACL rules. |
verify_claims | Array of strings Default: {} A list of custom claims to validate, which is a list of name/value pairs. |
from | string Default: "password" Enum: "username" "password" Field to take JWT from. |
enable | boolean Default: true Set to |
{- "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}"
}
}
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 Example: stomp Gateway Name. |
[- {
- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22213",
- "dtls_options": {
- "cacertfile": "/etc/emqx/certs/cacert.pem",
- "certfile": "/etc/emqx/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "/etc/emqx/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,
- "bind": "22214",
- "dtls_options": {
- "cacertfile": "/etc/emqx/certs/cacert.pem",
- "certfile": "/etc/emqx/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": "/etc/emqx/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"
}, - {
- "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": "/etc/emqx/certs/cacert.pem",
- "certfile": "/etc/emqx/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "/etc/emqx/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",
- "nodelay": false,
- "recbuf": "10KB",
- "reuseaddr": true,
- "send_timeout": "15s",
- "send_timeout_close": true,
- "sndbuf": "10KB"
}, - "type": "tcp"
}, - {
- "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"
}
}
]
Create the gateway listener.
Note: For listener types not supported by a gateway, this API returns 400: BAD_REQUEST
.
name required | string Example: stomp Gateway Name. |
id | string Listener ID |
type | string Value: "dtls" Listener Type |
name | string Listener Name |
running | boolean Listener Running status |
acceptors | integer Default: 16 Size of the acceptor pool. |
object (gateway.udp_opts) | |
enable | boolean Default: true Enable the listener. |
integer or string The IP address and port that the listener will bind. | |
max_connections | integer Default: 1024 Maximum number of concurrent connections. |
max_conn_rate | integer Default: 1000 Maximum connections per second. |
enable_authn | boolean Default: true Set |
mountpoint | string When publishing or subscribing, prefix all topics with a mountpoint string. |
access_rules | Array of strings Default: "" The access control rules for this listener. |
object (gateway.dtls_opts) |
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22213",
- "dtls_options": {
- "cacertfile": "/etc/emqx/certs/cacert.pem",
- "certfile": "/etc/emqx/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "/etc/emqx/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": "/etc/emqx/certs/cacert.pem",
- "certfile": "/etc/emqx/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "/etc/emqx/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 gateway listener. All connected clients under the deleted listener will be disconnected.
name required | string Example: stomp Gateway Name. |
id required | string Listener ID |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the gateway listener configs
name required | string Example: stomp Gateway Name. |
id required | string Listener ID |
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22213",
- "dtls_options": {
- "cacertfile": "/etc/emqx/certs/cacert.pem",
- "certfile": "/etc/emqx/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "/etc/emqx/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 Example: stomp Gateway Name. |
id required | string Listener ID |
id | string Listener ID |
type | string Value: "dtls" Listener Type |
name | string Listener Name |
running | boolean Listener Running status |
acceptors | integer Default: 16 Size of the acceptor pool. |
object (gateway.udp_opts) | |
enable | boolean Default: true Enable the listener. |
integer or string The IP address and port that the listener will bind. | |
max_connections | integer Default: 1024 Maximum number of concurrent connections. |
max_conn_rate | integer Default: 1000 Maximum connections per second. |
enable_authn | boolean Default: true Set |
mountpoint | string When publishing or subscribing, prefix all topics with a mountpoint string. |
access_rules | Array of strings Default: "" The access control rules for this listener. |
object (gateway.dtls_opts) |
{- "acceptors": 16,
- "access_rules": [
- "allow all"
], - "bind": "22213",
- "dtls_options": {
- "cacertfile": "/etc/emqx/certs/cacert.pem",
- "certfile": "/etc/emqx/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "/etc/emqx/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": "/etc/emqx/certs/cacert.pem",
- "certfile": "/etc/emqx/certs/cert.pem",
- "fail_if_no_peer_cert": false,
- "keyfile": "/etc/emqx/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 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 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 Example: stomp Gateway Name. |
id required | string Listener ID |
uid required | string User ID |
password required | string |
is_superuser | boolean Default: false |
{- "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 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 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
{- "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 Example: stomp Gateway Name. |
id required | string Listener ID |
user_id required | string |
password required | string |
is_superuser | boolean Default: false |
{- "password": "******",
- "user_id": "user1"
}
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
Enable or disable telemetry
enable | boolean Default: true Enable telemetry |
{- "enable": false
}
{- "enable": false
}
{- "emqx_version": "5.0.0-beta.3-32d1547c",
- "license": {
- "edition": "opensource"
}, - "os_name": "Linux",
- "os_version": "20.04",
- "otp_version": "24",
- "up_time": 20220113,
- "uuid": "AAAAAAAA-BBBB-CCCC-2022-DDDDEEEEFFF",
- "nodes_uuid": [
- "AAAAAAAA-BBBB-CCCC-2022-DDDDEEEEFFF",
- "ZZZZZZZZ-CCCC-BBBB-2022-DDDDEEEEFFF"
], - "active_plugins": [
- "Plugin A",
- "Plugin B"
], - "active_modules": [
- "Module A",
- "Module B"
], - "num_clients": 20220113,
- "messages_received": 2022,
- "messages_sent": 2022
}
Get the gateway client information
clientid required | string Client ID |
name required | string Gateway Name |
{- "created_at": "2021-12-07T10:44:02.721+08:00",
- "keepalive": 0,
- "recv_cnt": 1,
- "subscriptions_max": "infinity",
- "connected_at": "2021-12-07T10:44:02.721+08:00",
- "subscriptions_cnt": 0,
- "awaiting_rel_cnt": 0,
- "mailbox_len": 0,
- "connected": true,
- "mqueue_dropped": 0,
- "recv_msg": 0,
- "mqueue_max": "infinity",
- "disconnected_at": null,
- "proto_ver": "1.0",
- "inflight_cnt": 0,
- "ip_address": "127.0.0.1",
- "reductions": 72022,
- "mqueue_len": 0,
- "send_pkt": 1,
- "expiry_interval": 0,
- "send_oct": 61,
- "clientid": "MzAyMzEzNTUwNzk1NDA1MzYyMzIwNzUxNjQwMTY1NzQ0NjE",
- "is_bridge": false,
- "recv_pkt": 1,
- "clean_start": true,
- "username": "guest",
- "send_cnt": 1,
- "node": "emqx@127.0.0.1",
- "awaiting_rel_max": "infinity",
- "proto_name": "STOMP",
- "inflight_max": "infinity",
- "heap_size": 4185,
- "port": 50675,
- "send_msg": 0,
- "recv_oct": 56
}
Get the gateway client subscriptions
clientid required | string Client ID |
name required | string 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 Gateway Name |
topic | string Topic Filter/Name |
qos | integer QoS level, enum: 0, 1, 2 |
nl | integer No Local option, enum: 0, 1 |
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) |
{- "nl": 0,
- "qos": 1,
- "rap": 0,
- "rh": 0,
- "topic": "test/topic"
}
{- "nl": 0,
- "qos": 1,
- "rap": 0,
- "rh": 0,
- "topic": "test/topic"
}
Delete a subscriptions membership
topic required | string Topic Filter/Name |
clientid required | string Client ID |
name required | string Gateway Name |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the gateway client list
name required | string 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 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
{- "data": [
- {
- "node": "string",
- "clientid": "string",
- "username": "string",
- "mountpoint": "string",
- "proto_name": "string",
- "proto_ver": "string",
- "ip_address": "string",
- "port": 0,
- "is_bridge": true,
- "connected_at": 1640995200000,
- "disconnected_at": 1640995200000,
- "connected": true,
- "keepalive": 0,
- "clean_start": true,
- "expiry_interval": 0,
- "created_at": 1640995200000,
- "subscriptions_cnt": 0,
- "subscriptions_max": 0,
- "inflight_cnt": 0,
- "inflight_max": 0,
- "mqueue_len": 0,
- "mqueue_max": 0,
- "mqueue_dropped": 0,
- "awaiting_rel_cnt": 0,
- "awaiting_rel_max": 0,
- "recv_oct": 0,
- "recv_cnt": 0,
- "recv_pkt": 0,
- "recv_msg": 0,
- "send_oct": 0,
- "send_cnt": 0,
- "send_pkt": 0,
- "send_msg": 0,
- "mailbox_len": 0,
- "heap_size": 0,
- "reductions": 0
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
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.
payload_encoding | string Default: "plain" Enum: "plain" "base64" MQTT Payload Encoding, |
topic required | string Topic Name |
qos | integer [ 0 .. 2 ] Default: 0 MQTT message QoS |
clientid | string Deprecated |
payload required | string The MQTT message payload. |
object (emqx_mgmt_api_publish.message_properties) | |
retain | boolean Default: false A boolean field to indicate if this message should be retained. |
[- {
- "payload_encoding": "plain",
- "topic": "api/example/topic",
- "qos": 0,
- "clientid": "string",
- "payload": "hello emqx api",
- "properties": {
- "payload_format_indicator": 0,
- "message_expiry_interval": 0,
- "response_topic": "some_other_topic",
- "correlation_data": "string",
- "user_properties": {
- "foo": "bar"
}, - "content_type": "text/plain"
}, - "retain": false
}
]
[- {
- "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)
payload_encoding | string Default: "plain" Enum: "plain" "base64" MQTT Payload Encoding, |
topic required | string Topic Name |
qos | integer [ 0 .. 2 ] Default: 0 MQTT message QoS |
clientid | string Deprecated |
payload required | string The MQTT message payload. |
object (emqx_mgmt_api_publish.message_properties) | |
retain | boolean Default: false A boolean field to indicate if this message should be retained. |
{- "payload_encoding": "plain",
- "topic": "api/example/topic",
- "qos": 0,
- "clientid": "string",
- "payload": "hello emqx api",
- "properties": {
- "payload_format_indicator": 0,
- "message_expiry_interval": 0,
- "response_topic": "some_other_topic",
- "correlation_data": "string",
- "user_properties": {
- "foo": "bar"
}, - "content_type": "text/plain"
}, - "retain": false
}
{- "id": "string"
}
Test a rule
emqx_rule_api_schema.ctx_delivery_dropped (object) or emqx_rule_api_schema.ctx_bridge_mqtt (object) or emqx_rule_api_schema.ctx_check_authz_complete (object) or emqx_rule_api_schema.ctx_connack (object) or emqx_rule_api_schema.ctx_disconnected (object) or emqx_rule_api_schema.ctx_connected (object) or emqx_rule_api_schema.ctx_dropped (object) or emqx_rule_api_schema.ctx_acked (object) or emqx_rule_api_schema.ctx_delivered (object) or emqx_rule_api_schema.ctx_unsub (object) or emqx_rule_api_schema.ctx_sub (object) or emqx_rule_api_schema.ctx_pub (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"
}
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 |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
{- "data": [
- {
- "id": "293fb66f",
- "from": "t/#",
- "created_at": "2021-12-01T15:00:43.153+08:00",
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
Create a new rule using given Id
name | string Default: "" The name of the rule |
sql required | string SQL query to transform the messages. |
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. | |
enable | boolean Default: true Enable or disable the rule |
description | string Default: "" The description of the rule |
metadata | object Rule metadata, do not change manually |
{- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
{- "id": "293fb66f",
- "from": "t/#",
- "created_at": "2021-12-01T15:00:43.153+08:00",
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
Get a rule's metrics by given Id
id required | string Example: my_rule_id |
{- "id": "293fb66f",
- "metrics": {
- "matched": 0,
- "matched.rate": 0,
- "matched.rate.max": 0,
- "matched.rate.last5m": 0,
- "passed": 0,
- "failed": 0,
- "failed.exception": 0,
- "failed.unknown": 0,
- "actions.total": 0,
- "actions.success": 0,
- "actions.failed": 0,
- "actions.failed.out_of_service": 0,
- "actions.failed.unknown": 0
}, - "node_metrics": [
- {
- "node": "emqx@127.0.0.1",
- "matched": 0,
- "matched.rate": 0,
- "matched.rate.max": 0,
- "matched.rate.last5m": 0,
- "passed": 0,
- "failed": 0,
- "failed.exception": 0,
- "failed.unknown": 0,
- "actions.total": 0,
- "actions.success": 0,
- "actions.failed": 0,
- "actions.failed.out_of_service": 0,
- "actions.failed.unknown": 0
}
]
}
List all events can be used in rules
{- "event": "$events/client_connected",
- "title": "some title",
- "description": "some desc",
- "columns": { },
- "test_columns": { },
- "sql_example": "string"
}
Get a rule by given Id
id required | string Example: my_rule_id |
{- "id": "293fb66f",
- "from": "t/#",
- "created_at": "2021-12-01T15:00:43.153+08:00",
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
Update a rule by given Id to all nodes in the cluster
id required | string Example: my_rule_id |
name | string Default: "" The name of the rule |
sql required | string SQL query to transform the messages. |
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. | |
enable | boolean Default: true Enable or disable the rule |
description | string Default: "" The description of the rule |
metadata | object Rule metadata, do not change manually |
{- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
{- "id": "293fb66f",
- "from": "t/#",
- "created_at": "2021-12-01T15:00:43.153+08:00",
- "name": "foo",
- "sql": "SELECT * FROM \"test/topic\" WHERE payload.x = 1",
- "actions": [
- "webhook:my_webhook",
- {
- "args": {
- "payload": "${payload}",
- "topic": "t/1"
}, - "function": "republish"
}, - {
- "function": "console"
}
], - "enable": true,
- "description": "Some description",
- "metadata": { }
}
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"
}
Get clients info by client ID
clientid required | string |
{- "awaiting_rel_cnt": 0,
- "awaiting_rel_max": 0,
- "clean_start": true,
- "clientid": "string",
- "connected": true,
- "connected_at": 1640995200000,
- "created_at": 1640995200000,
- "disconnected_at": 1640995200000,
- "expiry_interval": 0,
- "heap_size": 0,
- "inflight_cnt": 0,
- "inflight_max": 0,
- "ip_address": "string",
- "is_bridge": true,
- "keepalive": 0,
- "mailbox_len": 0,
- "mqueue_dropped": 0,
- "mqueue_len": 0,
- "mqueue_max": 0,
- "node": "string",
- "port": 0,
- "proto_name": "string",
- "proto_ver": 0,
- "recv_cnt": 0,
- "recv_msg": 0,
- "recv_msg.dropped": 0,
- "recv_msg.dropped.await_pubrel_timeout": 0,
- "recv_msg.qos0": 0,
- "recv_msg.qos1": 0,
- "recv_msg.qos2": 0,
- "recv_oct": 0,
- "recv_pkt": 0,
- "reductions": 0,
- "send_cnt": 0,
- "send_msg": 0,
- "send_msg.dropped": 0,
- "send_msg.dropped.expired": 0,
- "send_msg.dropped.queue_full": 0,
- "send_msg.dropped.too_large": 0,
- "send_msg.qos0": 0,
- "send_msg.qos1": 0,
- "send_msg.qos2": 0,
- "send_oct": 0,
- "send_pkt": 0,
- "subscriptions_cnt": 0,
- "subscriptions_max": 0,
- "username": "string",
- "mountpoint": "string",
- "zone": "string"
}
Unsubscribe bulk
clientid required | string |
topic | string Topic |
[- {
- "topic": "string"
}
]
{- "code": "CLIENTID_NOT_FOUND",
- "message": "string"
}
Subscribe bulk
clientid required | string |
topic required | string Topic |
qos | integer [ 0 .. 2 ] Default: 0 QoS |
nl | integer Default: 0 No Local |
rap | integer Default: 0 Retain as Published |
rh | integer Default: 0 Retain Handling |
[- {
- "topic": "string",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0
}
]
[- {
- "node": "string",
- "topic": "string",
- "clientid": "string",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0
}
]
Subscribe
clientid required | string |
topic required | string Topic |
qos | integer [ 0 .. 2 ] Default: 0 QoS |
nl | integer Default: 0 No Local |
rap | integer Default: 0 Retain as Published |
rh | integer Default: 0 Retain Handling |
{- "topic": "string",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0
}
{- "node": "string",
- "topic": "string",
- "clientid": "string",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0
}
Unsubscribe
clientid required | string |
topic | string Topic |
{- "topic": "string"
}
{- "code": "CLIENTID_NOT_FOUND",
- "message": "string"
}
List clients
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
node | string Example: node=emqx@127.0.0.1 Node name |
username | string User name |
zone | string |
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 Whether the client uses a new session |
proto_ver | string Client 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(millisecond) |
{- "data": [
- {
- "awaiting_rel_cnt": 0,
- "awaiting_rel_max": 0,
- "clean_start": true,
- "clientid": "string",
- "connected": true,
- "connected_at": 1640995200000,
- "created_at": 1640995200000,
- "disconnected_at": 1640995200000,
- "expiry_interval": 0,
- "heap_size": 0,
- "inflight_cnt": 0,
- "inflight_max": 0,
- "ip_address": "string",
- "is_bridge": true,
- "keepalive": 0,
- "mailbox_len": 0,
- "mqueue_dropped": 0,
- "mqueue_len": 0,
- "mqueue_max": 0,
- "node": "string",
- "port": 0,
- "proto_name": "string",
- "proto_ver": 0,
- "recv_cnt": 0,
- "recv_msg": 0,
- "recv_msg.dropped": 0,
- "recv_msg.dropped.await_pubrel_timeout": 0,
- "recv_msg.qos0": 0,
- "recv_msg.qos1": 0,
- "recv_msg.qos2": 0,
- "recv_oct": 0,
- "recv_pkt": 0,
- "reductions": 0,
- "send_cnt": 0,
- "send_msg": 0,
- "send_msg.dropped": 0,
- "send_msg.dropped.expired": 0,
- "send_msg.dropped.queue_full": 0,
- "send_msg.dropped.too_large": 0,
- "send_msg.qos0": 0,
- "send_msg.qos1": 0,
- "send_msg.qos2": 0,
- "send_oct": 0,
- "send_pkt": 0,
- "subscriptions_cnt": 0,
- "subscriptions_max": 0,
- "username": "string",
- "mountpoint": "string",
- "zone": "string"
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
Update the gateway basic configurations and running status.
Note: The Authentication and Listener configurations should be updated by other special APIs.
name required | string 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"
}
]
Get the gateway configurations
name required | string 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 Example: stomp Gateway Name. |
required | object (emqx_exproto_schema.exproto_grpc_server) |
required | object (emqx_exproto_schema.exproto_grpc_handler) |
mountpoint | string Default: "" When publishing or subscribing, prefix all topics with a mountpoint string. |
enable | boolean Default: true Whether to enable this gateway |
enable_stats | boolean Default: true Whether to enable client process statistic |
idle_timeout | string Default: "30s" The idle time of the client connection process. It has two purposes: |
object (gateway.clientinfo_override) |
{- "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"
}
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"
}
[- {
- "name": "EMQX-TRACE-1",
- "type": "clientid",
- "topic": "/dev/#",
- "clientid": "dev-001",
- "ip_address": "127.0.0.1",
- "status": "running",
- "payload_encode": "hex",
- "start_at": "2021-11-04T18:17:38+08:00",
- "end_at": "2021-11-05T18:17:38+08:00",
- "log_size": [
- {
- "node": "emqx@127.0.0.1",
- "size": 1024
}
]
}
]
Create new trace
name required | string Unique and format by [a-zA-Z0-9-_] |
type required | string Enum: "clientid" "topic" "ip_address" Filter type |
topic | string support mqtt wildcard topic. |
clientid | string mqtt clientid. |
ip_address | string client ip address |
payload_encode | string Default: "text" Enum: "hex" "text" "hidden" Determine the format of the payload format in the trace file. |
integer or string rfc3339 timestamp or epoch second | |
integer or string rfc3339 timestamp or epoch second |
{- "name": "EMQX-TRACE-1",
- "type": "clientid",
- "topic": "/dev/#",
- "clientid": "dev-001",
- "ip_address": "127.0.0.1",
- "payload_encode": "hex",
- "start_at": "2021-11-04T18:17:38+08:00",
- "end_at": "2021-11-05T18:17:38+08:00"
}
{- "name": "EMQX-TRACE-1",
- "type": "clientid",
- "topic": "/dev/#",
- "clientid": "dev-001",
- "ip_address": "127.0.0.1",
- "status": "running",
- "payload_encode": "hex",
- "start_at": "2021-11-04T18:17:38+08:00",
- "end_at": "2021-11-05T18:17:38+08:00",
- "log_size": [
- {
- "node": "emqx@127.0.0.1",
- "size": 1024
}
]
}
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
}
}
Stop trace by name
name required | string Example: EMQX-TRACE-1 [a-zA-Z0-9-_] |
{- "name": "EMQX-TRACE-1",
- "type": "clientid",
- "topic": "/dev/#",
- "clientid": "dev-001",
- "ip_address": "127.0.0.1",
- "status": "running",
- "payload_encode": "hex",
- "start_at": "2021-11-04T18:17:38+08:00",
- "end_at": "2021-11-05T18:17:38+08:00",
- "log_size": [
- {
- "node": "emqx@127.0.0.1",
- "size": 1024
}
]
}
Create dashboard user
username | string <= 100 characters Dashboard Username |
password | string <= 100 characters Dashboard Password |
description | string Dashboard User Description |
{- "username": "admin",
- "password": "public",
- "description": "administrator"
}
{- "username": "admin",
- "description": "administrator"
}
Get Dashboard Auth Token.
username | string <= 100 characters Dashboard Username |
password | string <= 100 characters Dashboard Password |
{- "username": "admin",
- "password": "public"
}
{- "token": "string",
- "version": "5.0.0",
- "license": {
- "edition": "opensource"
}
}
Update dashboard user description
username required | string Example: admin Dashboard Username |
description | string Dashboard User Description |
{- "description": "administrator"
}
{- "username": "admin",
- "description": "administrator"
}
Change dashboard user password
username required | string Example: admin Dashboard Username |
old_pwd | string Old password |
new_pwd | string New password |
{- "old_pwd": "string",
- "new_pwd": "string"
}
{- "code": "BAD_REQUEST",
- "message": "string"
}
Dashboard user logout
username | string <= 100 characters Dashboard Username |
{- "username": "admin"
}
{- "code": "BAD_USERNAME_OR_PWD",
- "message": "string"
}
List all running node's listeners for the specified type.
type | string Enum: "tcp" "ssl" "ws" "wss" "quic" Example: type=tcp Listener type |
[- {
- "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.
type required | string Value: "quic" Listener type |
running | boolean Listener status |
name required | string Listener name |
current_connections | integer >= 0 Current connections |
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, |
object (broker.listener_quic_ssl_opts) | |
enabled | boolean Default: true Enable listener. |
required | integer or string Default: 14567 IP address and port for the listening socket. |
acceptors | integer >= 1 Default: 16 The size of the listener's receiving pool. |
integer or string Default: 5000000 The maximum number of concurrent connections allowed by the listener. | |
mountpoint | string Default: "" When publishing or subscribing, prefix all topics with a mountpoint string. |
zone | string Default: "default" The configuration zone to which the listener belongs. |
enable_authn | string Default: true Enum: true false "quick_deny_anonymous" Set |
max_conn_rate | string Maximum connection rate. |
messages_rate | string Messages publish rate. |
bytes_rate | string Data publish rate. |
{- "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"
}
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 authenticator of the specified gateway.
name required | string 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 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 Example: stomp Gateway Name. |
use_jwks required | string Value: true Whether to use JWKS. |
endpoint required | string JWKS endpoint, it's a read-only endpoint that returns the server's public key set in the JWKS format. |
pool_size | integer >= 1 Default: 8 Size of the connection pool towards the bridge target service. |
refresh_interval | integer Default: 300 JWKS refresh interval. |
object (broker.ssl_client_opts) | |
mechanism required | string Value: "jwt" Authentication mechanism. |
acl_claim_name | string Default: "acl" JWT claim name to use for getting ACL rules. |
verify_claims | Array of strings Default: {} A list of custom claims to validate, which is a list of name/value pairs. |
from | string Default: "password" Enum: "username" "password" Field to take JWT from. |
enable | boolean Default: true Set to |
{- "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 Example: stomp Gateway Name. |
use_jwks required | string Value: true Whether to use JWKS. |
endpoint required | string JWKS endpoint, it's a read-only endpoint that returns the server's public key set in the JWKS format. |
pool_size | integer >= 1 Default: 8 Size of the connection pool towards the bridge target service. |
refresh_interval | integer Default: 300 JWKS refresh interval. |
object (broker.ssl_client_opts) | |
mechanism required | string Value: "jwt" Authentication mechanism. |
acl_claim_name | string Default: "acl" JWT claim name to use for getting ACL rules. |
verify_claims | Array of strings Default: {} A list of custom claims to validate, which is a list of name/value pairs. |
from | string Default: "password" Enum: "username" "password" Field to take JWT from. |
enable | boolean Default: true Set to |
{- "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 Example: stomp Gateway Name. |
filename | string <binary> |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Get the users for the authenticator (only supported by built_in_database
).
name required | string Example: stomp Gateway Name. |
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
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 Example: stomp Gateway Name. |
user_id required | string |
password required | string |
is_superuser | boolean Default: false |
{- "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 user for the gateway authenticator (only supports built_in_database)
name required | string 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 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 Example: stomp Gateway Name. |
uid required | string Example: test_username User ID |
password required | string |
is_superuser | boolean Default: false |
{- "password": "******"
}
{- "regular_user": {
- "summary": "Regular user",
- "value": {
- "user_id": "user1"
}
}, - "super_user": {
- "summary": "Superuser",
- "value": {
- "is_superuser": true,
- "user_id": "user2"
}
}
}
Import users into the gateway authenticator (only supports built_in_database)
name required | string Example: stomp Gateway Name. |
id required | string Example: stomp:tcp:def Listener ID |
filename | string <binary> |
{- "code": "BAD_REQUEST",
- "message": "string"
}
Send a CoAP request message to the client
clientid required | string |
token | string Message token, can be empty |
method | string Enum: "get" "put" "post" "delete" Request method type |
timeout | string Timespan for response |
content_type | string Enum: "text/plain" "application/json" "application/octet-stream" Payload type |
payload | string The content of the payload |
{- "token": "string",
- "method": "get",
- "timeout": "32s",
- "content_type": "text/plain",
- "payload": "string"
}
{- "id": 0,
- "token": "string",
- "method": "string",
- "payload": "string"
}
List retained messages.
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
{- "data": [
- {
- "msgid": "string",
- "topic": "string",
- "qos": 0,
- "publish_at": "string",
- "from_clientid": "string",
- "from_username": "string"
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
Lookup a message by a topic without wildcards.
topic required | string Topic. |
{- "payload": "string",
- "msgid": "string",
- "topic": "string",
- "qos": 0,
- "publish_at": "string",
- "from_clientid": "string",
- "from_username": "string"
}
{- "enable": true,
- "msg_expiry_interval": "32s",
- "msg_clear_interval": "32s",
- "max_payload_size": "32MB",
- "stop_publish_clear_msg": false,
- "backend": {
- "type": "built_in_database",
- "storage_type": "ram",
- "max_retained_messages": 0,
- "index_specs": [
- [
- 2,
- 4
], - [
- 1,
- 3
]
]
}
}
Update retainer config.
enable | boolean Default: true Enable retainer feature |
msg_expiry_interval | string Default: "0s" Message retention time. 0 means message will never be expired. |
msg_clear_interval | string Default: "0s" Periodic interval for cleaning up expired messages. |
max_payload_size | string Default: "1MB" Maximum retained message size. |
stop_publish_clear_msg | boolean Default: false When the retained flag of the |
object (retainer.mnesia_config) |
{- "enable": true,
- "msg_expiry_interval": "32s",
- "msg_clear_interval": "32s",
- "max_payload_size": "32MB",
- "stop_publish_clear_msg": false,
- "backend": {
- "type": "built_in_database",
- "storage_type": "ram",
- "max_retained_messages": 0,
- "index_specs": [
- [
- 2,
- 4
], - [
- 1,
- 3
]
]
}
}
{- "enable": true,
- "msg_expiry_interval": "32s",
- "msg_clear_interval": "32s",
- "max_payload_size": "32MB",
- "stop_publish_clear_msg": false,
- "backend": {
- "type": "built_in_database",
- "storage_type": "ram",
- "max_retained_messages": 0,
- "index_specs": [
- [
- 2,
- 4
], - [
- 1,
- 3
]
]
}
}
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 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
activated | boolean It is used to specify the alarm type of the query. |
{- "data": [
- {
- "node": "emqx@127.0.0.1",
- "name": "high_system_memory_usage",
- "message": "System memory usage is higher than 70%",
- "details": {
- "high_watermark": 70
}, - "duration": 297056,
- "activate_at": "2021-10-25T11:52:52.548+08:00",
- "deactivate_at": "2021-10-31T10:52:52.548+08:00"
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
List subscriptions
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
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 |
[- {
- "node": "string",
- "topic": "string",
- "clientid": "string",
- "qos": 0,
- "nl": 0,
- "rap": 0,
- "rh": 0
}
]
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" Example: BAD_USERNAME_OR_PWD API Error Codes |
{- "code": "string",
- "description": "string"
}
Update slow subs settings
enable | boolean Default: false Enable this feature |
threshold | string Default: "500ms" The latency threshold for statistics |
expire_interval | string Default: "300s" The eviction time of the record, which in the statistics record table |
top_k_num | integer >= 1 Default: 10 The maximum number of records in the slow subscription statistics record table |
stats_type | string Default: "whole" Enum: "whole" "internal" "response" The method to calculate the latency |
{- "enable": false,
- "threshold": "32s",
- "expire_interval": "32s",
- "top_k_num": 10,
- "stats_type": "whole"
}
{- "enable": false,
- "threshold": "32s",
- "expire_interval": "32s",
- "top_k_num": 10,
- "stats_type": "whole"
}
View slow topics statistics record data
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
{- "data": [
- {
- "clientid": "string",
- "node": "string",
- "topic": "string",
- "timespan": 0,
- "last_update_time": 0
}
]
}
{- "name": "EMQX-API-KEY-1",
- "api_key": "a4697a5c75a769f6",
- "expired_at": "2021-12-05T02:01:34.186Z",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
Create new api_key
name | string Unique and format by [a-zA-Z0-9-_] |
(integer or string) or string Default: "infinity" No longer valid datetime | |
desc | string |
enable | boolean Enable/Disable |
expired | boolean Expired |
{- "name": "EMQX-API-KEY-1",
- "expired_at": "2021-12-05T02:01:34.186Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
{- "name": "EMQX-API-KEY-1",
- "api_key": "a4697a5c75a769f6",
- "api_secret": "MzAyMjk3ODMwMDk0NjIzOTUxNjcwNzQ0NzQ3MTE2NDYyMDI",
- "expired_at": "2021-12-05T02:01:34.186Z",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
Return the specific api_key
name required | string Example: EMQX-API-KEY-1 ^[A-Za-z]+[A-Za-z0-9-_]*$ |
{- "name": "EMQX-API-KEY-1",
- "api_key": "a4697a5c75a769f6",
- "expired_at": "2021-12-05T02:01:34.186Z",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
Update the specific api_key
name required | string Example: EMQX-API-KEY-1 ^[A-Za-z]+[A-Za-z0-9-_]*$ |
(integer or string) or string Default: "infinity" No longer valid datetime | |
desc | string |
enable | boolean Enable/Disable |
expired | boolean Expired |
{- "expired_at": "2021-12-05T02:01:34.186Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
{- "name": "EMQX-API-KEY-1",
- "api_key": "a4697a5c75a769f6",
- "expired_at": "2021-12-05T02:01:34.186Z",
- "created_at": "2021-12-01T00:00:00.000Z",
- "desc": "Note",
- "enable": true,
- "expired": true
}
List all currently banned client IDs, usernames and IP addresses.
page | integer >= 1 Default: 1 Example: page=1 Page number of the results to fetch. |
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=50 Results per page(max 1000) |
{- "data": [
- {
- "as": "username",
- "who": "Banned name",
- "by": "mgmt_api",
- "reason": "Too many requests",
- "at": "2021-10-25T21:48:47+08:00",
- "until": "2021-10-25T21:53:47+08:00"
}
], - "meta": {
- "page": 1,
- "limit": 50,
- "count": 0,
- "hasnext": true
}
}
Add a client ID, username or IP address to the blacklist.
as required | string Enum: "clientid" "username" "peerhost" Ban method, which can be client ID, username or IP address. |
who required | string Ban object, specific client ID, username or IP address. |
by | string Initiator of the ban. |
reason | string Ban reason, record the reason why the current object was banned. |
integer or string The start time of the ban, the format is rfc3339, the default is the time when the operation was initiated. | |
integer or string The end time of the ban, the format is rfc3339, the default is the time when the operation was initiated + 1 year. |
{- "as": "username",
- "who": "Banned name",
- "by": "mgmt_api",
- "reason": "Too many requests",
- "at": "2021-10-25T21:48:47+08:00",
- "until": "2021-10-25T21:53:47+08:00"
}
{- "data": [
- {
- "as": "username",
- "who": "Banned name",
- "by": "mgmt_api",
- "reason": "Too many requests",
- "at": "2021-10-25T21:48:47+08:00",
- "until": "2021-10-25T21:53:47+08:00"
}
]
}
Remove a client ID, username or IP address from the blacklist.
as required | string Enum: "clientid" "username" "peerhost" Example: username Ban method, which can be client ID, username or IP address. |
who required | string Example: Badass Ban object, specific client ID, username or IP address. |
{- "code": "NOT_FOUND",
- "message": "string"
}