mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Moved hostpool endpoints
This commit is contained in:
parent
5b90645332
commit
e2f0d36d2f
3 changed files with 2 additions and 2 deletions
34
scripts/lua/rest/get/pool/config.lua
Normal file
34
scripts/lua/rest/get/pool/config.lua
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
--
|
||||
-- (C) 2019-20 - ntop.org
|
||||
--
|
||||
dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
|
||||
local info = ntop.getInfo()
|
||||
|
||||
local json = require ("dkjson")
|
||||
local page_utils = require("page_utils")
|
||||
local format_utils = require("format_utils")
|
||||
local os_utils = require "os_utils"
|
||||
local host_pools_utils = require "host_pools_utils"
|
||||
|
||||
if not haveAdminPrivileges() then
|
||||
sendHTTPContentTypeHeader('text/html')
|
||||
page_utils.print_header()
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
|
||||
print("<div class=\"alert alert-danger\"><img src=".. ntop.getHttpPrefix() .. "/img/warning.png>"..i18n("error_not_granted").."</div>")
|
||||
return
|
||||
end
|
||||
|
||||
local ifid = _GET["ifid"]
|
||||
if isEmptyString(ifid) then
|
||||
ifid = interface.name2id(ifname)
|
||||
end
|
||||
|
||||
sendHTTPContentTypeHeader('application/json', 'attachment; filename="pools_configuration.json"')
|
||||
|
||||
local conf = host_pools_utils.export(ifid)
|
||||
|
||||
print(json.encode(conf, nil))
|
||||
Loading…
Add table
Add a link
Reference in a new issue