mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 08:50:12 +00:00
add federation REST API, only stubs (#4056)
This commit is contained in:
parent
5634e27474
commit
f0aefa7737
7 changed files with 169 additions and 0 deletions
30
scripts/lua/rest/v1/get/federation/data.lua
Normal file
30
scripts/lua/rest/v1/get/federation/data.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
--
|
||||
-- (C) 2020 - ntop.org
|
||||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
local json = require("dkjson")
|
||||
local rest_utils = require("rest_utils")
|
||||
local tracker = require("tracker")
|
||||
|
||||
local rc = rest_utils.consts.success.ok
|
||||
local res = {}
|
||||
|
||||
if not haveAdminPrivileges() then
|
||||
rest_utils.answer(rest_utils.consts.err.not_granted, res)
|
||||
return
|
||||
end
|
||||
|
||||
-- TODO: collect real statistics about the running ntopng instance
|
||||
res = {
|
||||
total_traffic = {up = 100, down = 100},
|
||||
host_number = 10,
|
||||
flow_number = 20,
|
||||
alert_number = 300,
|
||||
version = "v1"
|
||||
}
|
||||
|
||||
rest_utils.answer(rc, res)
|
||||
Loading…
Add table
Add a link
Reference in a new issue