请求示例:

    返回数据:

    1. {
    2. "code": 0,
    3. "data": [
    4. {
    5. "awaiting_rel_len": 0,
    6. "binding": "local",
    7. "clean_start": true,
    8. "client_id": "mqttjs_f79fbc5a4b",
    9. "created_at": "2019-04-29 11:28:04",
    10. "deliver_msg": 0,
    11. "enqueue_msg": 0,
    12. "expiry_interval": 0,
    13. "heap_size": 233,
    14. "inflight_len": 0,
    15. "mailbox_len": 0,
    16. "max_awaiting_rel": 100,
    17. "max_inflight": 32,
    18. "max_mqueue": 1000,
    19. "max_subscriptions": 0,
    20. "mqueue_dropped": 0,
    21. "mqueue_len": 0,
    22. "node": "emqx@127.0.0.1",
    23. "reductions": 211,
    24. "subscriptions_count": 0,
    25. "username": ""
    26. },
    27. {
    28. "awaiting_rel_len": 0,
    29. "clean_start": true,
    30. "client_id": "mosquitto_mqtt",
    31. "deliver_msg": 0,
    32. "enqueue_msg": 0,
    33. "expiry_interval": 0,
    34. "heap_size": 376,
    35. "inflight_len": 0,
    36. "mailbox_len": 0,
    37. "max_awaiting_rel": 100,
    38. "max_inflight": 32,
    39. "max_mqueue": 1000,
    40. "max_subscriptions": 0,
    41. "mqueue_dropped": 0,
    42. "mqueue_len": 0,
    43. "node": "emqx@127.0.0.1",
    44. "reductions": 202,
    45. "subscriptions_count": 0,
    46. "username": "undefined"
    47. }
    48. ],
    49. "meta": {
    50. "page": 1,
    51. "limit": 10000,
    52. "count": 2
    53. }
    54. }

    API 定义:

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

    返回数据:

    1. {
    2. "code": 0,
    3. "data": [
    4. {
    5. "awaiting_rel_len": 0,
    6. "client_id": "mosquitto_mqtt",
    7. "created_at": "2019-04-29 11:28:28",
    8. "deliver_msg": 0,
    9. "enqueue_msg": 0,
    10. "expiry_interval": 0,
    11. "heap_size": 376,
    12. "inflight_len": 0,
    13. "mailbox_len": 0,
    14. "max_awaiting_rel": 100,
    15. "max_inflight": 32,
    16. "max_mqueue": 1000,
    17. "max_subscriptions": 0,
    18. "mqueue_dropped": 0,
    19. "mqueue_len": 0,
    20. "node": "emqx@127.0.0.1",
    21. "reductions": 453,
    22. "subscriptions_count": 1,
    23. "username": "undefined"
    24. }
    25. ]
    26. }

    API 定义:

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

    请求示例:

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

    API 定义:

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

    请求示例:

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

    请求参数:

    1. {
    2. "topic": "test_topic",
    3. "payload": "hello",
    4. "qos": 1,
    5. "retain": false,
    6. "client_id": "mqttjs_ab9069449e"