mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Updated some REST documentation (#9013)
This commit is contained in:
parent
d884c9bc14
commit
4c1026f54d
7 changed files with 28 additions and 19 deletions
|
|
@ -1,5 +1,5 @@
|
|||
--
|
||||
-- (C) 2019-24 - ntop.org
|
||||
-- (C) 2019-25 - ntop.org
|
||||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
|
|
@ -8,18 +8,19 @@ package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
|||
require "lua_utils"
|
||||
local json = require("dkjson")
|
||||
local syslog_utils = require "syslog_utils"
|
||||
|
||||
sendHTTPContentTypeHeader('application/json')
|
||||
local rest_utils = require("rest_utils")
|
||||
|
||||
local res = {}
|
||||
|
||||
local ifid = interface.getId()
|
||||
if tonumber(_GET["ifid"]) ~= nil then
|
||||
ifid = _GET["ifid"]
|
||||
local ifid = tonumber(_GET["ifid"])
|
||||
local rc = rest_utils.consts.success.ok
|
||||
|
||||
if ifid == nil then
|
||||
rest_utils.answer(rest_utils.consts.err.missing_parameters, {"Interface id (ifid) required"})
|
||||
end
|
||||
|
||||
if ifid ~= nil then
|
||||
res = syslog_utils.getProducers(ifid)
|
||||
end
|
||||
|
||||
print(json.encode(res))
|
||||
tprint(res)
|
||||
rest_utils.answer(rc, res)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue