mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Filter rest/v1/get/alert/data.lua based on epoch_begin/epoch_end/alert_type/alert_severity (#3952)
This commit is contained in:
parent
02c0607088
commit
3e5eca0ee5
1 changed files with 11 additions and 1 deletions
|
|
@ -27,6 +27,10 @@ local res = {}
|
|||
|
||||
local ifid = _GET["ifid"]
|
||||
local what = _GET["status"]
|
||||
local epoch_begin = _GET["epoch_begin"]
|
||||
local epoch_end = _GET["epoch_end"]
|
||||
local alert_type = _GET["alert_type"]
|
||||
local alert_severity = _GET["alert_severity"]
|
||||
|
||||
if isEmptyString(ifid) then
|
||||
rc = rest_utils.consts_invalid_interface
|
||||
|
|
@ -47,7 +51,13 @@ if what == "engaged" then
|
|||
engaged = true
|
||||
end
|
||||
|
||||
local alert_options = _GET
|
||||
local alert_options = {
|
||||
epoch_begin = epoch_begin,
|
||||
epoch_end = epoch_end,
|
||||
alert_type = alert_type,
|
||||
alert_severity = alert_severity,
|
||||
}
|
||||
|
||||
local alerts = alert_utils.getAlerts(what, alert_options)
|
||||
|
||||
if alerts == nil then alerts = {} end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue