mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 00:40:10 +00:00
parent
744a5e53c3
commit
feb65be1ca
21 changed files with 591 additions and 62 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
--
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue