ntopng/scripts/lua/rest/v2/get/asn/config.lua
Alfredo Cardigliano 60ac86c6d0 Cleanup as_utils
2025-07-16 10:23:15 +02:00

27 lines
692 B
Lua

--
-- (C) 2021 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
local rest_utils = require "rest_utils"
local json = require "dkjson"
local as_utils = require "as_utils"
local res = {}
-- Get data from redis: expected format, array of objects with keys:
res = {
{
key = "customer_asn",
value_description = as_utils.getCustomerASNList()
}, {
key = "sub_customer_asn",
value_description = as_utils.getSubCustomerASNList()
}, {
key = "remote_asn",
value_description = as_utils.getRemoteASNList()
}
}
rest_utils.answer(rest_utils.consts.success.ok, res)