mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Implements REST endpoint to check host pool members before bind
Implements #4138
This commit is contained in:
parent
1405107c13
commit
31715e65d2
2 changed files with 38 additions and 0 deletions
|
|
@ -206,4 +206,30 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
-- @brief Get one or all pools
|
||||
function pools_rest_utils.get_pool_by_member(pools)
|
||||
local member = _POST["member"]
|
||||
|
||||
sendHTTPHeader('application/json')
|
||||
|
||||
if not member then
|
||||
print(rest_utils.rc(rest_utils.consts_invalid_args))
|
||||
return
|
||||
end
|
||||
|
||||
local res = {}
|
||||
|
||||
-- Create the instance
|
||||
local s = pools:create()
|
||||
local cur_pool = s:get_pool_by_member(member)
|
||||
if cur_pool then
|
||||
res = cur_pool
|
||||
end
|
||||
|
||||
local rc = rest_utils.consts_ok
|
||||
print(rest_utils.rc(rc, res))
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
return pools_rest_utils
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue