Silenced API
The /silenced
API endpoints
The Silenced API provides HTTP POST and GET access to create, query, and clear (delete) a silencing entry.
/silenced
(GET)
The /silenced
endpoint provides HTTP GET access to silencing entry specifications.
EXAMPLES
The following example demonstrates a /silenced
API query which returns a JSON
Array of JSON Hashes containing all silencing entry specifications.
$ curl -s -X GET http://127.0.0.1:3000/silenced |jq .
[
{
"_id": "us_west1:load-balancer:check_haproxy",
"expire": 3530,
"expire_on_resolve": false,
"begin": null,
"creator": null,
"dc": "us_west1",
"reason": null,
"check": "check_haproxy",
"subscription": "load-balancer",
"id": "load-balancer:check_haproxy",
"timestamp": 1538599295
},
{
"_id": "us_west1:all:check_ntpd",
"expire": -1,
"expire_on_resolve": true,
"begin": null,
"creator": "sysop@example.com",
"dc": "us_west1",
"reason": "we ran out of time",
"check": "check_ntpd",
"subscription": "all",
"id": "all:check_ntpd",
"timestamp": 1538599297
}
]
API specification
/silenced (GET) | |
---|---|
description | Returns a list of silencing entries. |
example url | http://hostname:3000/silenced |
response type | Array |
response codes |
|
output |
|
/silenced
(POST)
The /silenced
API provides HTTP POST access to create a silencing entry.
EXAMPLE
The following example demonstrates a /silenced
query that creates a silencing
entry with an expiration of 3600 seconds for the check check_haproxy
on
clients with the load-balancer
subscription within the us_west1
datacenter.
$ curl -s -i -X POST \
-H 'Content-Type: application/json' \
-d '{ "dc": "us_west1", "subscription": "load-balancer", "check": "check_haproxy", "expire": 3600 }' \
http://127.0.0.1:3000/silenced
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Connection: close
Content-length: 0
$ curl -s -X GET http://127.0.0.1:3000/silenced | jq .
[
{
"_id": "us_west1:load-balancer:check_haproxy",
"expire": 3594,
"expire_on_resolve": false,
"begin": null,
"creator": null,
"dc": "us_west1",
"reason": null,
"check": "check_haproxy",
"subscription": "load-balancer",
"id": "load-balancer:check_haproxy",
"timestamp": 1538599295
}
]
API specification
/silenced (POST) | |
---|---|
description | Create a silencing entry. |
example URL | http://hostname:3000/silenced |
payload |
|
payload parameters |
|
response codes |
|
/silenced/clear
(POST)
The /silenced
API provides HTTP POST access to delete a silencing entry.
EXAMPLE
The following example demonstrates a /silenced
query that deletes a silencing
entry with the id load-balancer:check_haproxy
within the us_west1
datacenter.
$ curl -s -i -X POST \
-H 'Content-Type: application/json' \
-d '{ "dc": "us_west1", "id": "load-balancer:check_haproxy" }' \
http://127.0.0.1:3000/silenced/clear
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Connection: close
Content-length: 0
API specification
/silenced/clear (POST) | |
---|---|
description | Clear a silencing entry. |
example URL | http://hostname:3000/silenced/clear |
payload |
|
payload parameters |
|
response codes |
|