mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
31 lines
No EOL
595 B
Lua
31 lines
No EOL
595 B
Lua
--
|
|
-- (C) 2021 - ntop.org
|
|
--
|
|
|
|
local dirs = ntop.getDirs()
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
|
|
|
require "lua_utils"
|
|
local rest_utils = require "rest_utils"
|
|
|
|
|
|
local ifid = _GET["ifid"]
|
|
|
|
if isEmptyString(ifid) then
|
|
rest_utils.answer(rest_utils.consts.err.invalid_interface)
|
|
return
|
|
end
|
|
|
|
local networks_stats = interface.getNetworksStats()
|
|
|
|
local res = {}
|
|
for n, ns in pairs(networks_stats) do
|
|
res[#res+1] = {
|
|
id = n,
|
|
label = n,
|
|
network_id = ns.network_id
|
|
}
|
|
|
|
end
|
|
|
|
rest_utils.answer(rest_utils.consts.success.ok, res) |