Overview
Quality data can be retrieved from the API by issuing a GET request to the following resource.
GET /api/v1/reports/quality.json
Usage
The following parameters are passed to this resource as a query string.
filter: Specify a URL encoded filter. The filter parameter should be used as described in the Filtering Sinefa Reports article (optional).
e.g. &filter=instance+%3d+London
metric: The quality metric to retrieve for time-series data. Must be one of delay, jitter, loss, availability or nqs (required).
e.g. &metric=delay
start: A time-stamp representing the start of the range to query in milliseconds since epoch (required).
end: A time-stamp representing the end of the range to query in milliseconds since epoch (required).
e.g. &start=1365487800000&end=1365491400000
Return Data
The following JSON structure is returned.
{ nqs: <average nqs over the period, 1-5>, availability: <average availability over the period, 0-1>, delay: <average delay over the period, in msec>, jitter: <average jitter over the period, in msec>, loss: <average loss over the period, in %>, hub: { name: <name of the hub>, location: <location of the hub>, uuid: <uuid of the hub> }, summary: [ { name1: <name of link endpoint>, name2: <name of link endpoint>, uuid1: <uuid of link endpoint>, uuid2: <uuid of link endpoint>, nqs: <nqs over the period, 1-5>, availability: <availability over the period, 0-1>, delay: <delay over the period, in msec>, jitter: <jitter over the period, in msec>, loss: <loss over the period, in %> } ], timeseries: { delay: { data: [ { timestamp: <timestamp of sample>, 0: <value of 1st series>, 1: <value of 2nd series>, 2: <value of 3rd series>, 3: <value of 4th series>, 4: <value of 5th series> } ], series: [ <name of series> ] } } }
Example
This example fetches all the delay data for the 15th April 2013.
Request
curl -u <username>:<password> -H 'Content-Type: application/json' \ 'https://app.sinefa.com/api/v1/reports/quality.json?filter=&metric=delay&start=1365948000000&end=1366034399000'
Response
{ "nqs" : 4.11420378503569, "availability" : 1, "delay" : 188.1118213884, "jitter" : 8.62130288242314, "loss" : 0, "hub" : { "location" : "San Francisco, USA", "name" : "San Francisco - DC", "uuid" : "3e7f974a-bb1e-497a-8bfb-9588ea395660" }, "summary" : [ { "name2" : "Jakarta", "name1" : "San Francisco - DC", "delay" : 299.585795611781, "uuid2" : "51474889-dd88-442b-8331-36412e7aefee", "uuid1" : "3e7f974a-bb1e-497a-8bfb-9588ea395660", "availability" : 1, "nqs" : 3.74348583679115, "jitter" : 12.5210957607406, "loss" : 0 }, ... ], "timeseries" : { "delay" : { "data" : [ { "4" : 200.195, "1" : 239.674, "timestamp" : "2013-04-14T14:01:00.000Z", "3" : 220.455, "0" : 301.887, "2" : 246.221 }, ... ], "series" : [ "Jakarta", "Kuala Lumpur", "Shanghai", "Sydney", "London" ] } } }
See Also
API Overview
Reporting (v2)
Events: Active
How to generate date specific reports using API queries
Comments
0 comments
Article is closed for comments.