getSeveritySituationStats
A GET request that returns the number of Situations by severity in the specified time range.
Back to Stats API.
Request arguments
Endpoint getSeveritySituationStats
takes the following request arguments.
Response
Endpoint getSeveritySituationStats
returns the following response:
Successful requests return a JSON object containing the following:
Name | Type | Description |
---|---|---|
| String | The name of the status. |
| Number Array | An array of data points. Each data point is an array in the format [data point, timestamp]:
|
Examples
The following examples demonstrate typical use of endpoint getSeveritySituationStats
:
Request example
A cURL request to retrieve the sum of the major and critical Situations between 12pm on Thursday, August 9th and 12pm on Friday, August 10th 2018:
curl -G -u graze:graze -k -v "https://daffy.moogsoft.com/graze/v1/getSeveritySituationStats" --data-urlencode 'from=1533816000' --data-urlencode 'to=1533902400' --data-urlencode 'severity=[5, 4]' --data-urlencode 'aggregation=sum'
Response example
A successful response returns 24 data points, one for each hour over the 24 hour range:
[{ "datapoints":[ [51.0,1533816000000], [44.0,1533819600000], [88.0,1533823200000], [84.0,1533826800000], [25.0,1533830400000], [34.0,1533834000000], [82.0,1533837600000], [58.0,1533841200000], [61.0,1533844800000], [52.0,1533848400000], [15.0,1533852000000], [50.0,1533855600000], [54.0,1533859200000], [50.0,1533862800000], [81.0,1533866400000], [78.0,1533870000000], [84.0,1533873600000], [28.0,1533877200000], [54.0,1533880800000], [36.0,1533884400000], [44.0,1533888000000], [47.0,1533891600000], [60.0,1533895200000], [54.0,1533898800000]], "target":"Critical/Major" }]