订阅(Subscriptions)
获取集群订阅信息
API 定义:
GET api/v3/subscriptions/
请求示例:
GET api/v3/subscriptions/?_page=1&_limit=10000
返回数据:
{
"code": 0,
"data": [
{
"client_id": "mqttjs_f79fbc5a4b",
"node": "emqx@127.0.0.1",
"qos": 0,
"topic": "testtopic/#"
},
{
"client_id": "mosquitto_mqtt",
"node": "emqx@127.0.0.1",
"qos": 0,
"topic": "t"
}
],
"meta": {
"page": 1,
"limit": 10000,
"count": 2
}
}
获取集群指定连接订阅信息
API 定义:
GET api/v3/subscriptions/${clientid}
请求示例:
GET api/v3/subscriptions/mosquitto_mqtt
返回数据:
{
"code": 0,
"data": [
{
"client_id": "mosquitto_mqtt",
"node": "emqx@127.0.0.1",
"qos": 0,
"topic": "t"
}
]
}
获取节点订阅信息
API 定义:
GET api/v3/nodes/${node}/subscriptions/
请求示例:
GET api/v3/nodes/emqx@127.0.0.1/subscriptions/?_page=1&_limit=10000
返回数据:
{
"code": 0,
"data": [
{
"client_id": "mqttjs_f79fbc5a4b",
"node": "emqx@127.0.0.1",
"qos": 0,
"topic": "testtopic/#"
},
{
"client_id": "mosquitto_mqtt",
"node": "emqx@127.0.0.1",
"qos": 0,
"topic": "t"
}
],
"meta": {
"page": 1,
"limit": 10000,
"count": 2
}
}
获取节点指定连接订阅信息
API 定义:
GET api/v3/nodes/${node}/subscriptions/${clientid}
请求示例:
GET api/v3/nodes/emqx@127.0.0.1/subscriptions/mosquitto_mqtt
返回数据:
{
"code": 0,
"data": [
{
"client_id": "mosquitto_mqtt",
"node": "emqx@127.0.0.1",
"qos": 0,
"topic": "t"
}
]
}