search #
Searches for alert rules.
Query Syntax #
Javascript #
kuzzle.query({
controller: 'alert-rules',
action: 'search',
body: {
query: {},
sort: {},
},
index: '<index>',
});
Arguments #
Arguments | Type | Description |
---|---|---|
index | string | Tenant index |
Body Properties #
Property | Type | Description |
---|---|---|
query | object | Query object (Optional) |
sort | object | Sort object (Optional) |
Response #
Returns the alert rules.
{
"status": 200,
"action": "search",
"controller": "alert-rules",
"error": null,
"headers": {},
"index": "<index>",
"node": "<node-id>",
"requestId": "<request-id>",
"result": {
"hits": [
{
"_id": "<alert-rule-id>",
"_score": null,
"_source": {
"type": "alert-rules",
"alert-rules": {
"name": "Temperature Alert",
"description": "Alert triggered when temperature exceeds threshold",
"linkedNotificationRules": [],
"scope": {
"collection": "measures",
"filters": [
{
"model": "Device",
"references": ["device-1"],
"measureSlots": ["temperature"]
}
]
},
"plannings": {
"days": {
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": true,
"sat": true,
"sun": true
},
"range": {
"allDay": true,
"start": "00:00",
"end": "23:59"
},
"timezone": "UTC"
},
"rule": {
"type": "threshold",
"threshold": {
"field": "values.temperature",
"operator": "gt",
"value": 25,
"debounce": {
"down": 5,
"levels": [
{
"delay": 1,
"severity": "warning"
}
]
}
}
}
},
"_kuzzle_info": {
"author": "<author>",
"createdAt": 1234567890123,
"updatedAt": null,
"updater": null
}
},
"collection": "config",
"index": "<index>"
}
],
"fetched": 1,
"total": 1
}
}
Edit this page on Github(opens new window)