Adds new REST API v2/

Addresses #5269
This commit is contained in:
Simone Mainardi 2021-07-08 09:57:46 +02:00
parent 1f24dec3e3
commit b117e8a23a
178 changed files with 6639 additions and 124 deletions

View file

@ -71,7 +71,7 @@ page_utils.print_navbar(i18n("pools.pools"), url, {
-- ************************************* ------
local ALL_POOL_GET_ENDPOINT = '/lua/rest/v1/get/pools.lua'
local ALL_POOL_GET_ENDPOINT = '/lua/rest/v2/get/pools.lua'
local pool_types = {
@ -126,10 +126,10 @@ for _, entry in ipairs(menu.entries) do
end
local rest_endpoints = {
get_all_pools = (page == "all" and ALL_POOL_GET_ENDPOINT or string.format(ntop.getHttpPrefix() .. "/lua/rest/v1/get/%s/pools.lua", pool_type)),
add_pool = string.format(ntop.getHttpPrefix() .. "/lua/rest/v1/add/%s/pool.lua", pool_type),
edit_pool = string.format(ntop.getHttpPrefix() .. "/lua/rest/v1/edit/%s/pool.lua", pool_type),
delete_pool = string.format(ntop.getHttpPrefix() .. "/lua/rest/v1/delete/%s/pool.lua", pool_type),
get_all_pools = (page == "all" and ALL_POOL_GET_ENDPOINT or string.format(ntop.getHttpPrefix() .. "/lua/rest/v2/get/%s/pools.lua", pool_type)),
add_pool = string.format(ntop.getHttpPrefix() .. "/lua/rest/v2/add/%s/pool.lua", pool_type),
edit_pool = string.format(ntop.getHttpPrefix() .. "/lua/rest/v2/edit/%s/pool.lua", pool_type),
delete_pool = string.format(ntop.getHttpPrefix() .. "/lua/rest/v2/delete/%s/pool.lua", pool_type),
}
local context = {