mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
Update runTest API in all endpoint plugins. Add action=test in edit_notification_recipient.lua
This commit is contained in:
parent
8cd379bfb9
commit
e344508df1
8 changed files with 145 additions and 99 deletions
|
|
@ -15,23 +15,25 @@ local action = _POST["action"]
|
|||
sendHTTPContentTypeHeader('application/json')
|
||||
|
||||
if not haveAdminPrivileges() then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
local response = {}
|
||||
local recipient_name = _POST["recipient_name"]
|
||||
|
||||
if (action == "add") then
|
||||
local endpoint_conf_name = _POST["endpoint_conf_name"]
|
||||
response.result = notification_recipients.add_recipient(endpoint_conf_name, recipient_name, _POST)
|
||||
local endpoint_conf_name = _POST["endpoint_conf_name"]
|
||||
response.result = notification_recipients.add_recipient(endpoint_conf_name, recipient_name, _POST)
|
||||
elseif (action == "edit") then
|
||||
response.result = notification_recipients.edit_recipient(recipient_name, _POST)
|
||||
response.result = notification_recipients.edit_recipient(recipient_name, _POST)
|
||||
elseif (action == "remove") then
|
||||
response.result = notification_recipients.delete_recipient(recipient_name)
|
||||
response.result = notification_recipients.delete_recipient(recipient_name)
|
||||
elseif (action == "test") then
|
||||
response.result = notification_recipients.test_recipient(recipient_name)
|
||||
else
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, "Invalid 'action' parameter.")
|
||||
response.success = false
|
||||
response.message = "Invalid 'action' parameter."
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, "Invalid 'action' parameter.")
|
||||
response.success = false
|
||||
response.message = "Invalid 'action' parameter."
|
||||
end
|
||||
|
||||
print(json.encode(response))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue