ceprule.update
Description
object ceprule.update(object/array CEP rules)
This method allows you to update existing CEP rules.
This method is only available to Super admin user type. Permissions to call the method can be revoked in user role settings. See User roles for more information.
Parameters
(object/array) CEP rule properties to be updated.
The cep_ruleid property must be defined for each CEP rule, all
other properties are optional. Only the passed properties will be
updated, all others will remain unchanged.
Additionally to the standard CEP rule properties, the method accepts the following parameters.
| Parameter | Type | Description |
|---|---|---|
| filter | object | CEP rule filter object to replace the current filter. |
| window | array | CEP rule window to be updated. Property behavior: - required if window_type is changed to "Cause and symptom grouping" and "group_by_host_group", "group_by_host", "group_by_tags" are all set to NO;- required if window_type is changed to "Event pattern match";- supported if window_type is "Simple (multiple)" or "Simple (once)" |
| operations | array | CEP rule operations to replace existing operations. Property behavior: - required if window_type is changed to "None" (0), "Simple (multiple)" (1), "Simple (once)" (3) or "Event pattern match" (4). |
Return values
(object) Returns an object containing the IDs of the updated CEP rules under the cep_ruleids property.
Examples
Disable CEP rule
{
"jsonrpc": "2.0",
"method": "ceprule.update",
"params": {
"cep_ruleid": "1",
"status": "1"
},
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"cep_ruleids": [
"1"
]
},
"id": 1
}
Replace condition
{
"jsonrpc": "2.0",
"method": "ceprule.update",
"params": {
"cep_ruleid": "3",
"filter": {
"evaltype": "0",
"formula": "",
"conditions": [
{
"type": "3",
"operator": "2",
"event_name": "Inaccessible port",
"severity": "0"
}
]
}
},
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"cep_ruleids": [
"1"
]
},
"id": 1
}
See also
Source
CCepRule::update() in ui/include/classes/api/services/CCepRule.php.