You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is to request the creation of documentation on REST APIs that can be found in: https://github.com/ntop/ntopng/tree/dev/scripts/lua/rest/v2/get
Documentation is required so that we know how to call a specific endpoint and get a response.
below is an example that can be found in some lua scripts.
We need documentation in this format:
endpoint path: for example: https://github.com/ntop/ntopng/blob/dev/scripts/lua/rest/v2/get/asn/get_as_data.lua in ntopng becomes: http://{NTOPNG_HOST_IP}:{NTOPNG_HOST_PORT}/lua/rest/v2/get/asn/get_as_data.lua -> in the documentation put as endpoint: /lua/rest/v2/get/asn/get_as_data.lua
enumerate all the parameters and how to use them, for example how to sort by timestamp or name etc and which value to pass to sort by decreasing timestamp for example. Also add (required) if the parameter is required
write a short description on what the endpoint returns
Put a sample of returned data
NOTE
Skip the alerts endpoint as this data is not relevant for our use case
EXAMPLE
REST: https://github.com/ntop/ntopng/blob/dev/scripts/lua/rest/v2/get/alert/alert_from_map.lua
Path: /lua/rest/v2/get/alert/alert_from_map.lua
Description: This endpoint enables to convert an alert bitmap and alert type to the corresponding alert description. Alert bitmap and alert type are required parameters.
Parameters:
alert_map: string (required) -> Alert bitmap which uniquely identifies the main and sub alerts
alert_type: int (required) -> Alert id of the alert provided
Returns: {"rsp":{"additional_alerts":["TCP Connection Refused ","TCP No Data Exchanged ","Periodic Flow ","TCP Flow Reset "],"alerts_by_score":[]},"rc_str":"OK","rc":0,"rc_str_hr":"Success"}
This example can be found in REST lua scripts, if missing, add it a the top of the script to document how to call the endpoint
-- Given alerts bitmap and alert_id return all the alerts relevant for the provided values
-- Example: curl -u admin:admin -H "Content-Type: application/json" -d '{"alert_map": "10050000000100000000100000", "alert_type": "90"}' http://localhost:3000/lua/rest/v2/get/alert/alert_from_map.lua
-- Returns: {"rsp":{"additional_alerts":["TCP Connection Refused ","TCP No Data Exchanged ","Periodic Flow ","TCP Flow Reset "],"alerts_by_score":[]},"rc_str":"OK","rc":0,"rc_str_hr":"Success"}
The text was updated successfully, but these errors were encountered:
This is to request the creation of documentation on REST APIs that can be found in:
https://github.com/ntop/ntopng/tree/dev/scripts/lua/rest/v2/get
Documentation is required so that we know how to call a specific endpoint and get a response.
below is an example that can be found in some lua scripts.
We need documentation in this format:
https://github.com/ntop/ntopng/blob/dev/scripts/lua/rest/v2/get/asn/get_as_data.lua
in ntopng becomes:http://{NTOPNG_HOST_IP}:{NTOPNG_HOST_PORT}/lua/rest/v2/get/asn/get_as_data.lua
-> in the documentation put as endpoint:/lua/rest/v2/get/asn/get_as_data.lua
enumerate all the parameters
and how to use them, for example how to sort by timestamp or name etc and which value to pass to sort by decreasing timestamp for example. Also add(required)
if the parameter is requiredNOTE
Skip the alerts endpoint as this data is not relevant for our use case
EXAMPLE
REST:
https://github.com/ntop/ntopng/blob/dev/scripts/lua/rest/v2/get/alert/alert_from_map.lua
/lua/rest/v2/get/alert/alert_from_map.lua
This example can be found in REST lua scripts, if missing, add it a the top of the script to document how to call the endpoint
-- Given alerts bitmap and alert_id return all the alerts relevant for the provided values
-- Example: curl -u admin:admin -H "Content-Type: application/json" -d '{"alert_map": "10050000000100000000100000", "alert_type": "90"}' http://localhost:3000/lua/rest/v2/get/alert/alert_from_map.lua
-- Returns: {"rsp":{"additional_alerts":["TCP Connection Refused ","TCP No Data Exchanged ","Periodic Flow ","TCP Flow Reset "],"alerts_by_score":[]},"rc_str":"OK","rc":0,"rc_str_hr":"Success"}
The text was updated successfully, but these errors were encountered: