路由

GET /api/v4/routes

返回集群下的所有路由信息,支持分页机制。

Query String Parameters:

NameTypeRequiredDefaultDescription
_pageIntegerFalse1页码
_limitIntegerFalse10000每页显示的数据条数,未指定时由 emqx-management 插件的配置项 max_row_limit 决定

Success Response Body (JSON):

NameTypeDescription
codeInteger0
dataArray of Objects所有路由信息
data[0].topicStringMQTT 主题
data[0].nodeString节点名称
metaObject/api/v4/clients

Examples:

  1. $ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/routes"
  2. {"meta":{"page":1,"limit":10000,"count":2},"data":[{"topic":"a/+/c","node":"emqx@127.0.0.1"},{"topic":"a/b/c","node":"emqx@127.0.0.1"}],"code":0}

GET /api/v4/routes/{topic}

返回集群下指定主题的路由信息。

Path Parameters:

NameTypeRequiredDescription
topicIntegerTrue主题

Success Response Body (JSON):

NameTypeDescription
codeInteger0
dataObject所有路由信息
data.topicStringMQTT 主题
data.nodeString节点名称

Examples:

  1. $ curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/routes/a%2fb%2fc"
  2. {"data":[{"topic":"a/b/c","node":"emqx@127.0.0.1"}],"code":0}