Aggregates API
The /aggregates API endpoint
The /aggregates API endpoint provides HTTP GET access to named aggregate
data.
/aggregates (GET)
EXAMPLES
The following example demonstrates a /aggregates API query which results in a
JSON Array of JSON Hashes containing named check aggregates.
$ curl -s http://127.0.0.1:3000/aggregates | jq .
[
{
"_id": "us_east1/check_web_app",
"dc": "us_east1",
"name": "check_web_app"
},
{
"_id": "us_west1/elasticsearch_health",
"dc": "us_west1",
"name": "elasticsearch_health"
}
]API specification
| /aggregates (GET) | |
|---|---|
| description | Returns the list of named aggregates by name and datacenter (dc) |
| example url | http://hostname:3000/aggregates |
| response type | Array |
| response codes |
|
| output | |
The /aggregates/:name API endpoints
The /aggregates/:name API endpoints provide HTTP GET and HTTP DELETE access
to check aggregate data for a named aggregate.
/aggregates/:name (GET)
EXAMPLES
The following example demonstrates a /aggregates/:name API query for the
check result data for the aggregate named example_aggregate.
$ curl -s http://127.0.0.1:3000/aggregates/example_aggregate | jq .
{
"clients": 15,
"checks": 2,
"results": {
"ok": 18,
"warning": 0,
"critical": 1,
"unknown": 0,
"total": 19,
"stale": 0
}
}API specification
| /aggregates/:name (GET) | |
|---|---|
| description | Returns the aggregate check result for a given aggregate. |
| example url | http://hostname:3000/aggregates/elasticsearch |
| parameters |
|
| response type | Array |
| response codes |
|
| output | |
/aggregates/:name (DELETE)
EXAMPLES
The following example demonstrates a /aggregates/:name API request to delete
aggregate data for the aggregate named example_aggregate.
$ curl -s -i -X DELETE http://127.0.0.1:3000/aggregates/example_aggregate
HTTP/1.1 202 Accepted
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
Connection: close
Server: thinAPI specification
| /aggregates/:name (DELETE) | |
|---|---|
| description | Deletes all aggregate data for a named aggregate. |
| example url | http://hostname:3000/aggregates/elasticsearch |
| parameters |
|
| response type | HTTP-header only (no output) |
| response codes |
|
| output | |