Alert#
List alerts and acknowledge alert. Acknowledge is done on the parent alert.
You need to provide authentication parameters for all queries. To learn more, see API Introduction.
Find out more about the alerts
List Alerts#
Code samples
curl -X GET {server}/alerts/api/alerts \
-H 'Accept: application/json' \
-H 'Authorization: Basic {access-token}'
GET /alerts/api/alerts
List of alerts
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
from | query | integer | false | Unix timestamp, in millis |
to | query | integer | false | Unix timestamp, in millis |
Example responses
200 Response
{
"range": {
"from": "1598283340",
"to": "1598283340"
},
"alerts": [
{
"id": "string",
"alertname": "string",
"category": "string",
"clearedat": 0,
"duration": 0,
"eventname": "string",
"eventtext": "string",
"eventtype": "string",
"event_expiration": "string",
"event_clear_on_ack": null,
"event_state": "string",
"host": "string",
"measurement": "string",
"message": "string",
"openedat": "string",
"resource": "string",
"resource_address": "string",
"resource_component": "string",
"resource_component_type": "string",
"resource_parent": "string",
"resource_parent_type": "string",
"resource_type": "string",
"root_cause": "string",
"technology": "string",
"triggerType": "string",
"unit": "%",
"updatedat": 0,
"url": "string",
"value": null,
"severity": "WARNING",
"ack": {
"user": "string",
"time": 1598288637746,
"value": true
},
"metadata": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Received a list of alerts | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» range | object | false | none | none |
»» from | string | false | none | none |
»» to | string | false | none | none |
» alerts | [object] | false | none | none |
»» id | string | false | none | none |
»» alertname | string | false | none | none |
»» category | string | false | none | none |
»» clearedat | integer | false | none | none |
»» duration | integer | false | none | none |
»» eventname | string | false | none | none |
»» eventtext | string | false | none | none |
»» eventtype | string | false | none | none |
»» event_expiration | string | false | none | none |
»» event_clear_on_ack | bool pointer | false | none | none |
»» event_state | string | false | none | none |
»» host | string | false | none | none |
»» measurement | string | false | none | none |
»» message | string | false | none | none |
»» openedat | string | false | none | none |
»» resource | string | false | none | none |
»» resource_address | string | false | none | none |
»» resource_component | string | false | none | none |
»» resource_component_type | string | false | none | none |
»» resource_parent | string | false | none | none |
»» resource_parent_type | string | false | none | none |
»» resource_type | string | false | none | none |
»» root_cause | string | false | none | none |
»» technology | string | false | none | none |
»» triggerType | string | false | none | none |
»» unit | string | false | none | none |
»» updatedat | integer | false | none | none |
»» url | string | false | none | none |
»» value | float | false | none | none |
»» severity | string | false | none | Severity of the alerts |
»» ack | object | false | none | none |
»»» user | string | false | none | none |
»»» time | integer(int64) | false | none | unix timestamp |
»»» value | boolean | false | none | none |
»» metadata | map | false | none | none |
Enumerated Values#
Property | Value |
---|---|
severity | WARNING |
severity | INFO |
severity | CRITICAL |
Acknowledge an alert#
Code samples
curl -X POST {server}/alerts/api/ack \
-H 'Content-Type: application/json' \
-H 'Accept: application\json' \
-H 'Authorization: Basic {access-token}'
POST /alerts/api/ack
Acknowledge an alert.
Body parameter
{
"ack": true,
"alert": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» ack | body | boolean | false | none |
» alert | body | string | false | ID of the alert list |
Example responses
200 Response
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Received acknowlegement on a given alert. If the alert is not correct (wrong id) the API will return 200 with null | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» user | string | false | none | none |
» time | integer(int64) | false | none | unix timestamp |
» value | boolean | false | none | none |
Clear an alert#
Code samples
curl -X POST {server}/api/v1/clear \
-H 'Content-Type: application/json' \
-H 'Accept: application\json' \
-H 'Authorization: Basic {access-token}'
POST /api/v1/clear
Clear an alert.
Body parameter
{
"alert": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» alert | body | string | false | ID of the alert |
Example responses
200 Response
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Alert that has been cleared. | Inline |
404 | Not Found | Alert not found from given ID. | None |
409 | Conflict | Alert has already been cleared. | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» id | string | false | none | none |
» alertname | string | false | none | none |
» category | string | false | none | none |
» clearedat | integer | false | none | none |
» duration | integer | false | none | none |
» eventname | string | false | none | none |
» eventtext | string | false | none | none |
» eventtype | string | false | none | none |
» event_expiration | string | false | none | none |
» event_clear_on_ack | bool pointer | false | none | none |
» event_state | string | false | none | none |
» host | string | false | none | none |
» measurement | string | false | none | none |
» message | string | false | none | none |
» openedat | string | false | none | none |
» resource | string | false | none | none |
» resource_address | string | false | none | none |
» resource_component | string | false | none | none |
» resource_component_type | string | false | none | none |
» resource_parent | string | false | none | none |
» resource_parent_type | string | false | none | none |
» resource_type | string | false | none | none |
» root_cause | string | false | none | none |
» technology | string | false | none | none |
» triggerType | string | false | none | none |
» unit | string | false | none | none |
» updatedat | integer | false | none | none |
» url | string | false | none | none |
» value | float | false | none | none |
» severity | string | false | none | Severity of the alerts |
» ack | object | false | none | none |
»» user | string | false | none | none |
»» time | integer(int64) | false | none | unix timestamp |
»» value | boolean | false | none | none |
» metadata | map | false | none | none |
Enumerated Values#
Property | Value |
---|---|
severity | WARNING |
severity | INFO |
severity | CRITICAL |