kibana/docs/api/alerting/legacy/get.asciidoc
2021-03-31 14:36:48 -07:00

77 lines
1.8 KiB
Text

[[alerts-api-get]]
=== Legacy get alert API
++++
<titleabbrev>Legacy get alert</titleabbrev>
++++
deprecated::[7.13.0,Use <<get-rule-api>> instead.]
Retrieve an alert by ID.
[[alerts-api-get-request]]
==== Request
`GET <kibana host>:<port>/api/alerts/alert/<id>`
`GET <kibana host>:<port>/s/<space_id>/api/alerts/alert/<id>`
[[alerts-api-get-params]]
==== Path parameters
`id`::
(Required, string) The ID of the alert to retrieve.
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
[[alerts-api-get-codes]]
==== Response code
`200`::
Indicates a successful call.
[[alerts-api-get-example]]
==== Example
Retrieve the alert object with the ID `41893910-6bca-11eb-9e0d-85d233e3ee35`:
[source,sh]
--------------------------------------------------
$ curl -X GET api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35
--------------------------------------------------
// KIBANA
The API returns the following:
[source,sh]
--------------------------------------------------
{
"id": "0a037d60-6b62-11eb-9e0d-85d233e3ee35",
"notifyWhen": "onActionGroupChange",
"params": {
"aggType": "avg",
},
"consumer": "alerts",
"alertTypeId": "test.alert.type",
"schedule": {
"interval": "1m"
},
"actions": [],
"tags": [],
"name": "test alert",
"enabled": true,
"throttle": null,
"apiKeyOwner": "elastic",
"createdBy": "elastic",
"updatedBy": "elastic",
"muteAll": false,
"mutedInstanceIds": [],
"updatedAt": "2021-02-10T05:37:19.086Z",
"createdAt": "2021-02-10T05:37:19.086Z",
"scheduledTaskId": "0b092d90-6b62-11eb-9e0d-85d233e3ee35",
"executionStatus": {
"lastExecutionDate": "2021-02-10T17:55:14.262Z",
"status": "ok"
}
}
--------------------------------------------------