-
Notifications
You must be signed in to change notification settings - Fork 651
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51e2bea
commit 21c5f92
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-- | ||
-- (C) 2013-24 - ntop.org | ||
-- | ||
local dirs = ntop.getDirs() | ||
|
||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path | ||
|
||
local rest_utils = require("rest_utils") | ||
|
||
-- | ||
-- Return all the actively monitored ntopng interfaces along with their ids | ||
-- Example: curl -u admin:admin -H "Content-Type: application/json" http://localhost:3000/lua/rest/v2/get/ntopng/interfaces.lua | ||
-- | ||
-- NOTE: in case of invalid login, no error is returned but redirected to login | ||
-- | ||
|
||
local rc = rest_utils.consts.success.ok | ||
local res = {} | ||
|
||
local limits = ntop.getLicenseLimits() | ||
|
||
for limit, max in pairsByKeys(limits.max) do | ||
res[#res + 1] = { | ||
name = limit, | ||
values = {{ | ||
current = limits.current[limit] or 0, | ||
max = max | ||
}} | ||
} | ||
end | ||
|
||
rest_utils.answer(rc, res) |