mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
refactor for endpoints and recipients (#4707)
This commit is contained in:
parent
06161556ac
commit
15772bd0fe
24 changed files with 129 additions and 117 deletions
29
scripts/lua/get_endpoint_configs.lua
Normal file
29
scripts/lua/get_endpoint_configs.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
--
|
||||
-- (C) 2020 - ntop.org
|
||||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
|
||||
local plugins_utils = require("plugins_utils")
|
||||
local endpoints = require("endpoints")
|
||||
local json = require "dkjson"
|
||||
local rest_utils = require "rest_utils"
|
||||
local auth = require "auth"
|
||||
|
||||
-- ################################################
|
||||
|
||||
if not auth.has_capability(auth.capabilities.notifications) then
|
||||
rest_utils.answer(rest_utils.consts.err.not_granted)
|
||||
return
|
||||
end
|
||||
|
||||
-- ################################################
|
||||
|
||||
sendHTTPContentTypeHeader('application/json')
|
||||
|
||||
local endpoint_configs = endpoints.get_configs_with_recipients(true)
|
||||
|
||||
print(json.encode(endpoint_configs))
|
||||
Loading…
Add table
Add a link
Reference in a new issue