ceprule.get
説明
integer/array ceprule.get(object parameters)
このメソッドを使用すると、指定したパラメータに従ってCEPルールを取得できます。
このメソッドは、すべてのタイプのユーザーが使用できます。 メソッドを呼び出す権限は、ユーザーロールの設定で取り消すことができます。詳細については、ユーザーロールを参照してください。
パラメータ
(object) 目的の出力を定義するパラメータ。
このメソッドは、以下のパラメータをサポートしています。
| パラメータ | 型 | 説明 |
|---|---|---|
| cep_ruleids | ID/array | 指定したIDを持つCEPルールのみを返します。 |
| selectFilter | query | CEPルールの条件を含む filter プロパティを返します。 |
| selectOperations | query | CEPルールの操作を含む operations プロパティを返します。 |
| selectWindow | query | CEPルールの時間枠を含む [window](/manual/api/reference/ceprule/object#cep-rule-time-window) プロパティを返します。 |
| sortfield | string/array | 指定したプロパティで結果をソートします。 指定可能な値: cep_ruleid、name、stop、sortorder、status。 |
| countOutput | boolean | これらのパラメータについては、リファレンス解説で説明しています。 |
| excludeSearch | boolean | |
| filter | object | |
| limit | integer | |
| output | query | |
| preservekeys | boolean | |
| search | object | |
| searchByAny | boolean | |
| searchWildcardsEnabled | boolean | |
| sortorder | string/array | |
| startSearch | boolean |
戻り値
(integer/array) 次のいずれかを返します。
- オブジェクトの配列
countOutputパラメータが使用されている場合は、取得したオブジェクトの数
例
CEPルールの取得
有効なCEPルールを、条件、ウィンドウ、操作を含めて取得します。
{
"jsonrpc": "2.0",
"method": "ceprule.get",
"params": {
"output": "extend",
"filter": {"status": 0},
"selectFilter": "extend",
"selectWindow": "extend",
"selectOperations": "extend"
},
"id": 1
}
レスポンス:
{
"jsonrpc": "2.0",
"result": [
{
"cep_ruleid": "2",
"name": "原因別にイベントをグループ化",
"stop": "0",
"sortorder": "1",
"description": "",
"status": "0",
"window_type": "2",
"error": "",
"filter": {
"evaltype": "0",
"eval_formula": "A",
"formula": "",
"conditions": [
{
"type": "3",
"operator": "2",
"event_name": "Printer",
"tag": "",
"tag_value": "",
"severity": "0",
"host_name": "",
"host_group_name": "",
"time_period": "",
"formulaid": "A"
}
]
},
"window": {
"duration": "1d",
"capacity": "0",
"group_by_host_group": "0",
"group_by_host": "1",
"group_by_tags": "1",
"tags": [
"cause"
],
"event_count_tag": "symptoms",
"script": ""
},
"operations": []
},
{
"cep_ruleid": "10",
"name": "連続するイベントを抑制",
"stop": "1",
"sortorder": "2",
"description": "",
"status": "0",
"window_type": "3",
"error": "",
"filter": {
"evaltype": "0",
"eval_formula": "A",
"formula": "",
"conditions": [
{
"type": "3",
"operator": "2",
"event_name": "Printer",
"tag": "",
"tag_value": "",
"severity": "0",
"host_name": "",
"host_group_name": "",
"time_period": "",
"formulaid": "A"
}
]
},
"window": {
"duration": "3m",
"capacity": "0",
"group_by_host_group": "0",
"group_by_host": "1",
"group_by_tags": "1",
"tags": [
"cause"
],
"event_count_tag": "",
"script": ""
},
"operations": [
{
"sortorder": "1",
"execute_when": "1",
"type": "7",
"event_name": "",
"severity": "0",
"suppress_duration": "6m",
"tag": "",
"new_tag": "",
"tag_value": "",
"scope": "0",
"filter": {
"evaltype": "0",
"eval_formula": "A",
"formula": "",
"conditions": [
{
"type": "33",
"operator": "10",
"tag": "",
"tag_value": "",
"formulaid": "A"
}
]
},
"scope_filter": {
"evaltype": "0",
"eval_formula": "",
"formula": "",
"conditions": []
}
},
{
"sortorder": "2",
"execute_when": "2",
"type": "8",
"event_name": "",
"severity": "0",
"suppress_duration": "0",
"tag": "",
"new_tag": "",
"tag_value": "",
"scope": "0",
"filter": {
"evaltype": "0",
"eval_formula": "A",
"formula": "",
"conditions": [
{
"type": "35",
"operator": "10",
"tag": "",
"tag_value": "",
"formulaid": "A"
}
]
},
"scope_filter": {
"evaltype": "0",
"eval_formula": "",
"formula": "",
"conditions": []
}
}
]
}
],
"id": 1
}
関連項目
ソース
ui/include/classes/api/services/CCepRule.php の CCepRule::get()。