未復旧イベント一覧¶
POST /api/v1/events/abnormal/list
概要¶
指定された時間範囲内の未復旧イベント(同じ df_monitor_checker_event_ref の直近のイベントステータスが ok ではないもの)の一覧を取得します。通常は直近6時間のデータを照会します。
Body リクエストパラメータ¶
| パラメータ名 | タイプ | 必須 | 説明 |
|---|---|---|---|
| search | string | イベントタイトルを検索 空欄許可: False |
|
| lastStatus | string | 最終ステータス 空欄許可: False 例: critical 選択可能な値: ['fatal', 'critical', 'error', 'warning', 'nodata'] |
|
| timeRange | array | Y | 時間範囲、デフォルトは直近6時間、時差は6時間以内 空欄許可: False $minLength: 2 最大長: 2 例: [1642563283250, 1642563304850] |
| timeRange[*] | integer | Y | ミリ秒単位の整数タイムスタンプ 空欄許可: False |
| filters | array | フィルター条件のリスト 空欄許可: False |
|
| offset | integer | オフセット 空欄許可: False 例: 10 $minValue: 0 |
|
| limit | integer | ページあたりの返却数 空欄許可: False 例: 10 $minValue: 1 $maxValue: 100 |
パラメータ補足説明¶
パラメータ説明:
テンプレートの基本構造は、ビュー構造(チャート構造、ビュー変数構造、チャートグループ構造を含む)で構成されます。
filters の基本構造説明
| パラメータ名 | type | 必須 | 説明 |
|---|---|---|---|
| condition | string | 前のフィルター条件との関係。選択可能な値: and, or; デフォルト値: and |
|
| filters | array | サブフィルター条件。括弧で囲まれたものと同等です。このパラメータが存在する場合、condition のみが有効となり、他のパラメータは無効になります。 |
|
| name | string | フィルター対象のフィールド名 | |
| operation | string | 演算子。選択可能な値: >, >=, <, <=, =, !=, in, wildcard, query_string, exists |
|
| value | array | 値リスト | |
| value[#] | string/int/boolean | 文字列/数値/ブール型が可能です。データ比較時は operation の特性に応じて value から特定の要素を取得して比較します。例えば、operation が = の場合、value[0] のみが演算に使用されます。 |
filters の例
[
{
"name": "A",
"condition": "and",
"operation": "between",
"value": [1577410594000, 1577410494000]
},
{
"condition": "and",
"filters": [
{
"name": "tagA",
"condition": "and",
"operation": ">",
"value": 12,
},
{
"name": "tagB",
"condition": "and",
"operation": "=",
"value": ["fff"]
}
],
},
{
"name": "tagC",
"condition": "and",
"operation": "=",
"value": ["ok"]
}
]
リクエスト例¶
curl 'https://openapi.guance.com/api/v1/events/abnormal/list' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"offset": 0, "limit": 10, "timeRange": [1642563283250, 1642563304850]}' \
--compressed
レスポンス¶
{
"code": 200,
"content": {
"data": [
{
"__docid": "E_c7jodqs24loo3v53qc50",
"alert_time_ranges": [
[
1642541760000,
null
]
],
"date": 1642563300000,
"df_dimension_tags": "{\"host\":\"10-23-190-37\"}",
"df_event_id": "event-6ea0350eda12405dad9c1cba4b28cdc3",
"df_message": "critical\ncpu\n0.010000123409284342",
"df_meta": "{\"alerts_sent\":[],\"check_targets\":[{\"alias\":\"Result\",\"dql\":\"M::`cpu`:(NON_NEGATIVE_DERIVATIVE(`usage_user`) AS `DingTalk`) { `host` = '10-23-190-37' } BY `host`\",\"range\":3600}],\"checker_opt\":{\"id\":\"rul_xxxx32\",\"interval\":60,\"message\":\"{{ df_status }}\\n{{ df_monitor_checker_name }}\\n{{ Result }}\",\"name\":\"cpu\",\"noDataInterval\":0,\"recoverInterval\":0,\"rules\":[{\"conditionLogic\":\"and\",\"conditions\":[{\"alias\":\"Result\",\"operands\":[\"0.01\"],\"operator\":\">=\"}],\"status\":\"critical\"}],\"title\":\"title1\"},\"dimension_tags\":{\"host\":\"10-23-190-37\"},\"extra_data\":{\"type\":\"simpleCheck\"},\"monitor_opt\":{\"id\":\"monitor_xxxx32\",\"name\":\"Default Group\",\"type\":\"default\"}}",
"df_monitor_checker_event_ref": "320fed7a6dd82a0bcb2a539248e6bedc",
"df_status": "critical",
"df_title": "title1"
},
{
"__docid": "E_c7jodqs24loo3v53qc4g",
"alert_time_ranges": [
[
1642541760000,
null
]
],
"date": 1642563300000,
"df_dimension_tags": "{\"host\":\"10-23-190-37\"}",
"df_event_id": "event-d2366597f7244ae099d3fbda07d8ec5f",
"df_message": "critical\ncpu\n0.010000123409284342",
"df_meta": "{\"alerts_sent\":[],\"check_targets\":[{\"alias\":\"Result\",\"dql\":\"M::`cpu`:(NON_NEGATIVE_DERIVATIVE(`usage_user`) AS `DingTalk`) { `host` = '10-23-190-37' } BY `host`\",\"range\":3600}],\"checker_opt\":{\"id\":\"rul_xxxx32\",\"interval\":60,\"message\":\"{{ df_status }}\\n{{ df_monitor_checker_name }}\\n{{ Result }}\",\"name\":\"cpu\",\"noDataInterval\":0,\"recoverInterval\":0,\"rules\":[{\"conditionLogic\":\"and\",\"conditions\":[{\"alias\":\"Result\",\"operands\":[\"0.01\"],\"operator\":\">=\"}],\"status\":\"critical\"}],\"title\":\"title1\"},\"dimension_tags\":{\"host\":\"10-23-190-37\"},\"extra_data\":{\"type\":\"simpleCheck\"},\"monitor_opt\":{\"id\":\"monitor_xxxx32\",\"name\":\"Default Group\",\"type\":\"default\"}}",
"df_monitor_checker_event_ref": "899faaa6f042871f32fc58fe53b16e46",
"df_status": "critical",
"df_title": "title1"
}
],
"limit": 20,
"offset": 0,
"total_count": 2
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-4D5773BE-88B1-4167-A2F4-603A58404184"
}