Implements acknowledged alerts

Implements #5600
This commit is contained in:
Simone Mainardi 2021-07-02 14:58:38 +02:00
parent 744a5e53c3
commit feb65be1ca
21 changed files with 591 additions and 62 deletions

View file

@ -14,7 +14,7 @@ local am_alert_store = require "am_alert_store".new()
--
-- Read alerts data
-- Example: curl -u admin:admin -H "Content-Type: application/json" -d '{"ifid": "1"}' http://localhost:3000/lua/rest/v1/delete/host/alerts.lua
-- Example: curl -u admin:admin -H "Content-Type: application/json" -d '{}' http://localhost:3000/lua/rest/v1/delete/am_host/alerts.lua
--
-- NOTE: in case of invalid login, no error is returned but redirected to login
--
@ -22,15 +22,7 @@ local am_alert_store = require "am_alert_store".new()
local rc = rest_utils.consts.success.ok
local res = {}
local ifid = _GET["ifid"]
if isEmptyString(ifid) then
rc = rest_utils.consts.err.invalid_interface
rest_utils.answer(rc)
return
end
interface.select(ifid)
interface.select(getSystemInterfaceId())
-- Add filters
am_alert_store:add_request_filters()

View file

@ -14,7 +14,7 @@ local mac_alert_store = require "mac_alert_store".new()
--
-- Read alerts data
-- Example: curl -u admin:admin -H "Content-Type: application/json" -d '{"ifid": "1"}' http://localhost:3000/lua/rest/v1/delete/host/alerts.lua
-- Example: curl -u admin:admin -H "Content-Type: application/json" -d '{"ifid": "1"}' http://localhost:3000/lua/rest/v1/delete/mac/alerts.lua
--
-- NOTE: in case of invalid login, no error is returned but redirected to login
--

View file

@ -14,7 +14,7 @@ local system_alert_store = require "system_alert_store".new()
--
-- Read alerts data
-- Example: curl -u admin:admin -H "Content-Type: application/json" -d '{"ifid": "1"}' http://localhost:3000/lua/rest/v1/delete/host/alerts.lua
-- Example: curl -u admin:admin -H "Content-Type: application/json" -d '{}' http://localhost:3000/lua/rest/v1/delete/system/alerts.lua
--
-- NOTE: in case of invalid login, no error is returned but redirected to login
--
@ -22,15 +22,7 @@ local system_alert_store = require "system_alert_store".new()
local rc = rest_utils.consts.success.ok
local res = {}
local ifid = _GET["ifid"]
if isEmptyString(ifid) then
rc = rest_utils.consts.err.invalid_interface
rest_utils.answer(rc)
return
end
interface.select(ifid)
interface.select(getSystemInterfaceId())
-- Add filters
system_alert_store:add_request_filters()

View file

@ -22,15 +22,7 @@ local user_alert_store = require "user_alert_store".new()
local rc = rest_utils.consts.success.ok
local res = {}
local ifid = _GET["ifid"]
if isEmptyString(ifid) then
rc = rest_utils.consts.err.invalid_interface
rest_utils.answer(rc)
return
end
interface.select(ifid)
interface.select(getSystemInterfaceId())
-- Add filters
user_alert_store:add_request_filters()