订阅(Subscriptions)

获取集群订阅信息

API 定义:

  1. GET api/v3/subscriptions/

请求示例:

  1. GET api/v3/subscriptions/?_page=1&_limit=10000

返回数据:

  1. {
  2. "code": 0,
  3. "data": [
  4. {
  5. "client_id": "mqttjs_f79fbc5a4b",
  6. "node": "emqx@127.0.0.1",
  7. "qos": 0,
  8. "topic": "testtopic/#"
  9. },
  10. {
  11. "client_id": "mosquitto_mqtt",
  12. "node": "emqx@127.0.0.1",
  13. "qos": 0,
  14. "topic": "t"
  15. }
  16. ],
  17. "meta": {
  18. "page": 1,
  19. "limit": 10000,
  20. "count": 2
  21. }
  22. }

获取集群指定连接订阅信息

API 定义:

  1. GET api/v3/subscriptions/${clientid}

请求示例:

  1. GET api/v3/subscriptions/mosquitto_mqtt

返回数据:

  1. {
  2. "code": 0,
  3. "data": [
  4. {
  5. "client_id": "mosquitto_mqtt",
  6. "node": "emqx@127.0.0.1",
  7. "qos": 0,
  8. "topic": "t"
  9. }
  10. ]
  11. }

获取节点订阅信息

API 定义:

  1. GET api/v3/nodes/${node}/subscriptions/

请求示例:

  1. GET api/v3/nodes/emqx@127.0.0.1/subscriptions/?_page=1&_limit=10000

返回数据:

  1. {
  2. "code": 0,
  3. "data": [
  4. {
  5. "client_id": "mqttjs_f79fbc5a4b",
  6. "node": "emqx@127.0.0.1",
  7. "qos": 0,
  8. "topic": "testtopic/#"
  9. },
  10. {
  11. "client_id": "mosquitto_mqtt",
  12. "node": "emqx@127.0.0.1",
  13. "qos": 0,
  14. "topic": "t"
  15. }
  16. ],
  17. "meta": {
  18. "page": 1,
  19. "limit": 10000,
  20. "count": 2
  21. }
  22. }

获取节点指定连接订阅信息

API 定义:

  1. GET api/v3/nodes/${node}/subscriptions/${clientid}

请求示例:

  1. GET api/v3/nodes/emqx@127.0.0.1/subscriptions/mosquitto_mqtt

返回数据:

  1. {
  2. "code": 0,
  3. "data": [
  4. {
  5. "client_id": "mosquitto_mqtt",
  6. "node": "emqx@127.0.0.1",
  7. "qos": 0,
  8. "topic": "t"
  9. }
  10. ]
  11. }