Cluster API イベント
イベントの Cluster API 解説書
イベント
- GET /eventsdefs
イベントを取得する
- 応答 JSON オブジェクト:
[key].maps[] (object) --
[key].maps[].id (string) --
[key].maps[].key[] (string) --
[key].maps[].source (string) --
[key].maps[].value (undefined) --
[key].maps[].where.key[] (string) --
[key].maps[].where.name (string) --
[key].maps[].where.type (string) --
[key].maps[].where.$in[] (undefined) --
[key].maps[].where.$search (string) --
[key].maps[].where.$searchIn[] (string) --
[key].maps[].where.$caseSensitive (boolean) --
[key].maps[].where.$eq (undefined) --
[key].maps[].where.$neq (undefined) --
[key].maps[].where.$gt (undefined) --
[key].maps[].where.$gte (undefined) --
[key].maps[].where.$lt (undefined) --
[key].maps[].where.$lte (undefined) --
[key].maps[].where.$or (undefined) --
[key].maps[].where.$and (undefined) --
[key].reductions[] (object) --
[key].reductions[].id (string) --
[key].reductions[].key[] (string) --
[key].reductions[].period (integer) --
[key].reductions[].value[] (string) --
[key].reductions[].where.key[] (string) --
[key].reductions[].where.name (string) --
[key].reductions[].where.type (string) --
[key].reductions[].where.$in[] (undefined) --
[key].reductions[].where.$search (string) --
[key].reductions[].where.$searchIn[] (string) --
[key].reductions[].where.$caseSensitive (boolean) --
[key].reductions[].where.$eq (undefined) --
[key].reductions[].where.$neq (undefined) --
[key].reductions[].where.$gt (undefined) --
[key].reductions[].where.$gte (undefined) --
[key].reductions[].where.$lt (undefined) --
[key].reductions[].where.$lte (undefined) --
[key].reductions[].where.$or (undefined) --
[key].reductions[].where.$and (undefined) --
[key].reductions[].publishers[] (string) --
応答例 :
{ "game": { "maps": [ { "value": 1, "id": "cheer", "where": { "type": "string", "name": "<name>", "key": [ "cheer" ] }, "source": "userinput", "key": [ "cheer", "<name>" ] } ], "reductions": [ { "id": "cheer", "period": 250, "where": { "key": [ "cheer", "<name>" ] }, "value": [ "$sum" ], "key": [ "<name>" ] } ] } }
- POST /eventsdefs
イベントを設定する
- リクエスト JSON オブジェクト:
[key].maps[] (object) --
[key].maps[].id (string) --
[key].maps[].key[] (string) --
[key].maps[].source (string) --
[key].maps[].value (undefined) --
[key].maps[].where.key[] (string) --
[key].maps[].where.name (string) --
[key].maps[].where.type (string) --
[key].maps[].where.$in[] (undefined) --
[key].maps[].where.$search (string) --
[key].maps[].where.$searchIn[] (string) --
[key].maps[].where.$caseSensitive (boolean) --
[key].maps[].where.$eq (undefined) --
[key].maps[].where.$neq (undefined) --
[key].maps[].where.$gt (undefined) --
[key].maps[].where.$gte (undefined) --
[key].maps[].where.$lt (undefined) --
[key].maps[].where.$lte (undefined) --
[key].maps[].where.$or (undefined) --
[key].maps[].where.$and (undefined) --
[key].reductions[] (object) --
[key].reductions[].id (string) --
[key].reductions[].key[] (string) --
[key].reductions[].period (integer) --
[key].reductions[].value[] (string) --
[key].reductions[].where.key[] (string) --
[key].reductions[].where.name (string) --
[key].reductions[].where.type (string) --
[key].reductions[].where.$in[] (undefined) --
[key].reductions[].where.$search (string) --
[key].reductions[].where.$searchIn[] (string) --
[key].reductions[].where.$caseSensitive (boolean) --
[key].reductions[].where.$eq (undefined) --
[key].reductions[].where.$neq (undefined) --
[key].reductions[].where.$gt (undefined) --
[key].reductions[].where.$gte (undefined) --
[key].reductions[].where.$lt (undefined) --
[key].reductions[].where.$lte (undefined) --
[key].reductions[].where.$or (undefined) --
[key].reductions[].where.$and (undefined) --
[key].reductions[].publishers[] (string) --
- クエリパラメータ:
force -- サービス実行チェックをスキップする
クエリ例 :
{ "game": { "maps": [ { "value": 1, "id": "cheer", "where": { "type": "string", "name": "<name>", "key": [ "cheer" ] }, "source": "userinput", "key": [ "cheer", "<name>" ] } ], "reductions": [ { "id": "cheer", "period": 250, "where": { "key": [ "cheer", "<name>" ] }, "value": [ "$sum" ], "key": [ "<name>" ] } ] } }
- DELETE /eventsdefs
すべてのイベントを削除する
- DELETE /eventsdefs/{events_id}
ID を指定してイベントを削除する
- パラメータ:
events_id -- イベント ID
- GET /eventsdefs/{events_id}
ID を指定してイベントを取得する
- パラメータ:
events_id -- イベント ID
- 応答 JSON オブジェクト:
maps[] (object) --
maps[].id (string) --
maps[].key[] (string) --
maps[].source (string) --
maps[].value (undefined) --
maps[].where.key[] (string) --
maps[].where.name (string) --
maps[].where.type (string) --
maps[].where.$in[] (undefined) --
maps[].where.$search (string) --
maps[].where.$searchIn[] (string) --
maps[].where.$caseSensitive (boolean) --
maps[].where.$eq (undefined) --
maps[].where.$neq (undefined) --
maps[].where.$gt (undefined) --
maps[].where.$gte (undefined) --
maps[].where.$lt (undefined) --
maps[].where.$lte (undefined) --
maps[].where.$or (undefined) --
maps[].where.$and (undefined) --
reductions[] (object) --
reductions[].id (string) --
reductions[].key[] (string) --
reductions[].period (integer) --
reductions[].value[] (string) --
reductions[].where.key[] (string) --
reductions[].where.name (string) --
reductions[].where.type (string) --
reductions[].where.$in[] (undefined) --
reductions[].where.$search (string) --
reductions[].where.$searchIn[] (string) --
reductions[].where.$caseSensitive (boolean) --
reductions[].where.$eq (undefined) --
reductions[].where.$neq (undefined) --
reductions[].where.$gt (undefined) --
reductions[].where.$gte (undefined) --
reductions[].where.$lt (undefined) --
reductions[].where.$lte (undefined) --
reductions[].where.$or (undefined) --
reductions[].where.$and (undefined) --
reductions[].publishers[] (string) --
応答例 :
{ "maps": [ { "value": 1, "id": "cheer", "where": { "type": "string", "name": "<name>", "key": [ "cheer" ] }, "source": "userinput", "key": [ "cheer", "<name>" ] } ], "reductions": [ { "id": "cheer", "period": 250, "where": { "key": [ "cheer", "<name>" ] }, "value": [ "$sum" ], "key": [ "<name>" ] } ] }
- POST /eventsdefs/{events_id}
イベントを作成する
- リクエスト JSON オブジェクト:
maps[] (object) --
maps[].id (string) --
maps[].key[] (string) --
maps[].source (string) --
maps[].value (undefined) --
maps[].where.key[] (string) --
maps[].where.name (string) --
maps[].where.type (string) --
maps[].where.$in[] (undefined) --
maps[].where.$search (string) --
maps[].where.$searchIn[] (string) --
maps[].where.$caseSensitive (boolean) --
maps[].where.$eq (undefined) --
maps[].where.$neq (undefined) --
maps[].where.$gt (undefined) --
maps[].where.$gte (undefined) --
maps[].where.$lt (undefined) --
maps[].where.$lte (undefined) --
maps[].where.$or (undefined) --
maps[].where.$and (undefined) --
reductions[] (object) --
reductions[].id (string) --
reductions[].key[] (string) --
reductions[].period (integer) --
reductions[].value[] (string) --
reductions[].where.key[] (string) --
reductions[].where.name (string) --
reductions[].where.type (string) --
reductions[].where.$in[] (undefined) --
reductions[].where.$search (string) --
reductions[].where.$searchIn[] (string) --
reductions[].where.$caseSensitive (boolean) --
reductions[].where.$eq (undefined) --
reductions[].where.$neq (undefined) --
reductions[].where.$gt (undefined) --
reductions[].where.$gte (undefined) --
reductions[].where.$lt (undefined) --
reductions[].where.$lte (undefined) --
reductions[].where.$or (undefined) --
reductions[].where.$and (undefined) --
reductions[].publishers[] (string) --
- パラメータ:
events_id -- イベント ID
クエリ例 :
{ "maps": [ { "value": 1, "id": "cheer", "where": { "type": "string", "name": "<name>", "key": [ "cheer" ] }, "source": "userinput", "key": [ "cheer", "<name>" ] } ], "reductions": [ { "id": "cheer", "period": 250, "where": { "key": [ "cheer", "<name>" ] }, "value": [ "$sum" ], "key": [ "<name>" ] } ] }
- GET /events/results/{counter}
イベント結果のログを取得する。このリクエストは、イベントログを表示するプルリクエストです。5 秒間、リクエストがない状態が続くとログがリセットされます。
- パラメータ:
counter -- ログの位置
- 応答 JSON オブジェクト:
counter (integer) -- ログの最後の位置。
messages[] (object) -- イベントの結果メッセージのリスト。
messages[].error (string) -- エラーがある場合にエラーを表示。
messages[].value (string) -- ログ値。
応答例 :
{ "counter": 0, "messages": [ { "error": "", "value": "" } ] }
- GET /events/summaries
イベントサマリーのコレクションを取得
- 応答 JSON オブジェクト:
[] (object) -- イベントサマリーのコレクション。
[].id (string) -- イベント名。
[].results[] (object) -- イベントで定義されるキーと結果の一覧。
[].results[].key[] (string) -- キーを構成する文字列の配列です。
[].results[].value.min (number) -- すべての入力値の最小値。
[].results[].value.max (number) -- すべての入力値の最大値。
[].results[].value.count (number) -- キーの出現数。
[].results[].value.sum (number) -- すべての入力値の合計値。
[].start (string) -- イベント名の開始時間。
[].last (string) -- イベントの最終更新時。
応答例 :
[ { "id": "cheer", "results": [ { "key": [ "Porthos" ], "value": { "min": 1, "max": 1, "count": 9, "sum": 9 } }, { "key": [ "Athos" ], "value": { "min": 1, "max": 1, "count": 4, "sum": 4 } }, { "key": [ "Aramis" ], "value": { "min": 1, "max": 1, "count": 10, "sum": 10 } } ], "start": "2018-07-24T12:24:15.8949179-04:00", "last": "2018-07-24T12:32:20.3956734-04:00" }, { "id": "changeColor", "results": [ { "key": [ "Aramis", "purple" ], "value": { "min": 1, "max": 1, "count": 1, "sum": 1 } }, { "key": [ "Athos", "orange" ], "value": { "min": 1, "max": 1, "count": 1, "sum": 1 } }, { "key": [ "Porthos", "blue" ], "value": { "min": 1, "max": 1, "count": 1, "sum": 1 } } ], "start": "2018-07-24T12:24:15.8949179-04:00", "last": "2018-07-24T12:32:20.3956734-04:00" } ]
- DELETE /events/summaries
イベントのサマリーをクリアします