REST API description: Difference between revisions

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?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" | jq '.interval[1] + .interval[3]'
{
7539471845
  "interfaces" : [
      0
  ],
  "firstRecentActivity" : 1588067610,
  "l7RetransBytesRx" : 97,
  "l7RealBytesTx" : 6363134,
  "continentName" : "--",
  "tcpContinuousResponseTimes" : {
      "avg" : 25.183,
      "count" : 1412450,
      "min" : 0.001,
      "stddev" : 911.777,
      "history" : {
        "dataAge" : 1589178163112,
        "intervalAMM" : {
            "min" : 1,
            "count" : 60348,
            "avg" : 5158,
            "max" : 48060
        },
        "data" : [
            1589120000000,
            0,
            0,
            0,
            0,
            1589121024000,
            0,
            0,
...
</pre>
</pre>


==== Time interval selection ====
==== Time interval selection ====
By default, the API


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)" | json_pp | head -n 30
$ 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
  "interfaces" : [
      0
  ],
  "firstRecentActivity" : 1588067610,
  "l7RetransBytesRx" : 97,
  "l7RealBytesTx" : 6363134,
  "continentName" : "--",
  "tcpContinuousResponseTimes" : {
      "avg" : 25.183,
      "count" : 1412450,
      "min" : 0.001,
      "stddev" : 911.777,
      "history" : {
        "dataAge" : 1589178163112,
        "intervalAMM" : {
            "min" : 1,
            "count" : 60348,
            "avg" : 5158,
            "max" : 48060
        },
        "data" : [
            1589120000000,
            0,
            0,
            0,
            0,
            1589121024000,
            0,
            0,
...
</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 ==
404

edits