REST API definitions
The APIs in Network Performance Insight® that give access to the database data for constructing the dashboards.
Using Network Performance Insight REST API commands requires the same permissions as using the web interface. These REST APIs are available so that you can retrieve the data outside of the web interface.
Each REST resource contains information such as URLs, functions, parameters, descriptions, sample input, and output data.
Common REST API status codes
| HTTP status code | Generic description |
|---|---|
| 200 | Success |
| 400 | Failure |
curl request method
If you want to use the curl method for data retrieval with REST API calls, you
can use this information.
Use the following
curl command to log in to REST API:curl --user ${USERNAME}:${PASSWORD} --cookie-jar ./cookies.txt https://${HOSTNAME}:9443/core/login?username=${USERNAME}\&password=${PASSWORD}Where,- {HOSTNAME}
Fully Qualified Domain name of the server where the UI Service is installed.
- {USERNAME}
Username to access the server where the UI Service is installed.
- {PASSWORD}
Password to access the server where the UI Service is installed.
A few examples are stated here to use the
curl request method requests by using
REST APIs. For https request method calls, see the specific REST API definitions.curlcommand to run the REST API command to get all fields from Flow Interfaces.curl --cookie ./cookies https://${HOSTNAME}:9443/service/dataset/flow/interface/?fields=* | python -m json.tool > FlowInterfaces_allfields.txtNote: The results from the request are retrieved in to the FlowInterfaces_allfields.txt file.curlcommand to get Threshold Static Definition based onthreshold_id.curl --cookie ./cookies https://${HOSTNAME}:9443/service/dataset/threshold/definition?query=threshold_id=5 | python -m json.tool > ThresholdDefinition_query_thresholdid.txtNote: The results from the request are retrieved in to the ThresholdDefinition_query_thresholdid.txt file.curlcommand to get metrics based on specific entities and period.curl --cookie ./cookies https://${HOSTNAME}:9443/service/dataset/metrics?entities=ncim-217&time=last-hour | python -m json.tool > metrics_for_ncim-217.txtNote: The results from the request are retrieved in to the metrics_for_ncim-217.txt file.