Skip to content

サブスクリプション情報API

本APIドキュメントでは、MQTTクライアントのサブスクリプション情報の閲覧に関する操作について説明します。全サブスクリプション情報の取得や特定クライアントの全サブスクリプション情報の取得が含まれます。

全サブスクリプション情報の取得

デプロイメント内のすべてのサブスクリプション情報を取得します。ページネーションに対応しています。

URI

GET /subscriptions

リクエストメッセージ

クエリパラメータ:

名前説明
_pageIntegerページ番号
_limitInteger1ページあたりのデータ件数
clientidStringクライアント識別子
qosInteger取り得る値:012
shareString共有サブスクリプションのグループ名
_match_topicStringマッチングクエリ用のトピック

レスポンスメッセージ

名前説明
dataオブジェクト配列すべてのサブスクリプション情報
data[].nodeStringノード名
data[].clientidStringクライアント識別子
data[].topicStringサブスクライブしているトピック
data[].qosIntegerQoSレベル
nlIntegerNo Local
rapIntegerRetain as Published
rhIntegerRetain Handling
metaオブジェクトページネーション情報
meta.pageIntegerページ番号
meta.limitInteger1ページあたりのデータ件数
meta.countInteger総データ件数

リクエスト例

bash
curl -u app_id:app_secret -X GET {api}/subscriptions

レスポンス例

json
// HTTPステータスコード
200
// HTTPレスポンスボディ
{
  "meta": {
    "page": 1,
    "limit": 100,
    "hasnext": false,
    "count": 2
  },
  "data": [
    {
      "topic": "t/a",
      "qos": 0,
      "node": "emqx@10.12.50.91",
      "clientid": "client_1",
      "nl": 0,
      "rap": 0,
      "rh": 0
    },
    {
      "topic": "t/b",
      "qos": 1,
      "node": "emqx@10.12.50.91",
      "clientid": "client_2",
      "nl": 0,
      "rap": 0,
      "rh": 0
    }
  ]
}

特定クライアントの全サブスクリプション情報の取得

URI

GET /clients/{client_id}/subscriptions

リクエストメッセージ

なし

レスポンスメッセージ

名前説明
dataオブジェクト配列すべてのサブスクリプション情報
data[].nodeStringノード名
data[].clientidStringクライアント識別子
data[].topicStringサブスクライブしているトピック
data[].qosIntegerQoSレベル
nlIntegerNo Local
rapIntegerRetain as Published
rhIntegerRetain Handling

リクエスト例

bash
curl -u app_id:app_secret -X GET {api}/clients/client_1/subscriptions

レスポンス例

json
{
  "data": [
    {
      "topic": "t/a",
      "qos": 0,
      "node": "emqx@10.12.50.36",
      "clientid": "client_1",
      "nl": 0,
      "rap": 0,
      "rh": 0
    },
    {
      "topic": "t/b",
      "qos": 1,
      "node": "emqx@10.12.50.36",
      "clientid": "client_1",
      "nl": 0,
      "rap": 0,
      "rh": 0
    }
  ]
}