getServiceSituationStats

A GET request that returns the number of active Situations impacting a service in the specified time range.

Back to Stats API.

Request arguments

Endpoint getServiceSituationStats takes the following request arguments.

Response

Endpoint getServiceSituationStats returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

target

String

Service name(s).

datapoints

Number Array

An array of data points. Each data point is an array in the format [data point, timestamp]:

  1. Data point: Number of Situations impacting services.

Examples

The following examples demonstrate typical use of endpoint getServiceSituationStats :

Request example

A cURL request to retrieve the number of Situations impacting the Commerce/Compute service between 12pm and 6pm on Friday, August 10th 2018:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getServiceSituationStats" --data-urlencode 'services=[1,2]' --data-urlencode 'from=1533902400' --data-urlencode 'to=1533924000' --data-urlencode 'aggregation=sum'

Response example

A successful response returns six data points for each hour during the six hour time range:

[{
        "datapoints": [
                [95.0,1533902400000],
                [85.0,1533906000000],
                [47.0,1533909600000],
                [7.0,1533913200000],
                [33.0,1533916800000],
                [66.0,1533920400000]
        ],
        "target":"Commerce/Compute"
}]