grafana/pkg/services/ngalert/api/test-data/am-grafana-recipient.http
gotjosh f7ed35336d
Alerting: Implement /status for the notification system (#33227)
* Alerting: Implement /status for the notification system

Implements the necessary plumbing to have a /status endpoint on the
notification system.

* Add API examples

* Update API specs

* Update prometheus/common dependency

Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
2021-06-15 19:14:02 +03:00

117 lines
2.8 KiB
HTTP

@grafana = grafana
###
# create AM configuration
POST http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/config/api/v1/alerts
content-type: application/json
< ./post-user-config.json
###
# get latest AM configuration
GET http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/config/api/v1/alerts
content-type: application/json
###
# delete AM configuration
DELETE http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/config/api/v1/alerts
###
# create AM alerts
POST http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/alerts
content-type: application/json
###
# get AM alerts
GET http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/alerts
###
# get AM status
GET http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/status
###
# get silences - no silences
GET http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/silences?Filter=foo="bar"&Filter=bar="foo"
###
# create silence
POST http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/silences
content-type: application/json
{
"comment": "string",
"createdBy": "string",
"endsAt": "2023-03-31T14:17:04.419Z",
"matchers": [
{
"isRegex": true,
"name": "string",
"value": "string"
}
],
"startsAt": "2021-03-31T13:17:04.419Z"
}
###
# update silence - does not exist
POST http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/silences
content-type: application/json
{
"id": "something",
"comment": "string",
"createdBy": "string",
"endsAt": "2023-03-31T14:17:04.419Z",
"matchers": [
{
"isRegex": true,
"name": "string",
"value": "string"
}
],
"startsAt": "2021-03-31T13:17:04.419Z"
}
###
# create silence - bad paylaad - start time must be before end time
POST http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/silences
content-type: application/json
{
"comment": "string",
"createdBy": "string",
"endsAt": "2019-03-31T14:17:04.419Z",
"matchers": [
{
"isRegex": true,
"name": "string",
"value": "string"
}
],
"startsAt": "2021-03-31T13:17:04.419Z"
}
###
# get silences
# @name getSilences
GET http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/silences
###
@silenceID = {{getSilences.response.body.$.[0].id}}
###
# get silence
GET http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/silence/{{silenceID}}
###
# get silence - unknown
GET http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/silence/unknown
###
# delete silence
DELETE http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/silence/{{silenceID}}
###
# delete silence - unknown
DELETE http://admin:admin@localhost:3000/api/alertmanager/{{grafana}}/api/v2/silence/unknown