404
edits
No edit summary |
|||
Line 185: | Line 185: | ||
The Allegro REST API has a number of query parameters that can be added to modify the request. By default, the API will display the real time counters since the last restart of the processing unit. | The Allegro REST API has a number of query parameters that can be added to modify the request. By default, the API will display the real time counters since the last restart of the processing unit. | ||
The example here is based on the interval counters. Please note that many counter array have 4 values | |||
<pre> | <pre> | ||
$ curl --silent -k -u 'admin:allegro' "https://allegro-mm/API/stats/modules/ip/ips/10.54.0.254 | $ curl --silent -k -u 'admin:allegro' "https://allegro-mm/API/stats/modules/ip/ips/10.54.0.254" | jq '.interval[1] + .interval[3]' | ||
7539471845 | |||
</pre> | </pre> | ||
==== Time interval selection ==== | ==== Time interval selection ==== | ||
Requests can be given a time interval. The following GET parameters are necessary: | Requests can be given a time interval. The following GET parameters are necessary: | ||
Line 230: | Line 200: | ||
<pre> | <pre> | ||
$ curl --silent -k -u 'admin:allegro' "https://allegro-mm/API/stats/modules/ip/ips/10.54.0.254?starttime=$(date --date="1 day ago" +%s)&endtime=$(date +%s)" | | $ curl --silent -k -u 'admin:allegro' "https://allegro-mm/API/stats/modules/ip/ips/10.54.0.254?starttime=$(date --date="1 day ago" +%s)&endtime=$(date +%s)" | ./jq.exe '.interval[1] + .interval[3]' | ||
216087873 | |||
</pre> | </pre> | ||
Line 277: | Line 216: | ||
<code>curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/ip/ips/10.1.2.3?timespan=3600&starttime=1528700400&endtime=1528704000' | jq '.interval[1] + .interval[3]'</code> | <code>curl --silent -k -u USER:PASSWORD 'https://allegro-mm-XXXX/API/stats/modules/ip/ips/10.1.2.3?timespan=3600&starttime=1528700400&endtime=1528704000' | jq '.interval[1] + .interval[3]'</code> | ||
== Examples == | == Examples == |
edits