List an application's alerts
import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/alerts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/alerts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/applications/{application_id}/alerts \
--header 'Authorization: Bearer <token>'{
"alerts": [
{
"alert_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"own": true,
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"says": "<string>",
"condition": {
"condition_type": "app_metric",
"metric": "failed_share_pct",
"threshold": 1,
"hold_minutes": 30,
"route": null,
"operator": "gt"
},
"severity": "<string>",
"send_to": [
{
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"label": "<string>"
}
],
"enabled": true,
"last_firing": {
"trigger_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"triggered_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"acknowledged_by": {
"user_id": "<string>",
"name": "<string>"
},
"acknowledged_after_seconds": 1,
"resolved_by": "itself",
"resolution_note": "<string>"
},
"evaluated_at": "2023-11-07T05:31:56Z",
"evaluation": "ok",
"unknown_reason": "<string>"
}
],
"truncated": true,
"limit": 123,
"covered_by_organisation_rules": true
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Alerts
List an application's alerts
Lists one application’s alerts, own alerts first and oldest first, at most 100; truncated says when there were more. With environment_id it lists the alerts on that environment and the organisation alert rules that watch a cluster the environment runs on, and covered_by_organisation_rules says whether any does; without it, the application’s alerts on every environment, and covered_by_organisation_rules is null. Requires alerts.read where the application is; an application outside a confined caller’s project answers 404.
GET
/
api
/
v1
/
org
/
applications
/
{application_id}
/
alerts
List an application's alerts
import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/alerts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/alerts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/applications/{application_id}/alerts \
--header 'Authorization: Bearer <token>'{
"alerts": [
{
"alert_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"own": true,
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"says": "<string>",
"condition": {
"condition_type": "app_metric",
"metric": "failed_share_pct",
"threshold": 1,
"hold_minutes": 30,
"route": null,
"operator": "gt"
},
"severity": "<string>",
"send_to": [
{
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"label": "<string>"
}
],
"enabled": true,
"last_firing": {
"trigger_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"triggered_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"acknowledged_by": {
"user_id": "<string>",
"name": "<string>"
},
"acknowledged_after_seconds": 1,
"resolved_by": "itself",
"resolution_note": "<string>"
},
"evaluated_at": "2023-11-07T05:31:56Z",
"evaluation": "ok",
"unknown_reason": "<string>"
}
],
"truncated": true,
"limit": 123,
"covered_by_organisation_rules": true
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Query Parameters
Response
The application's alerts
An application's alerts, own alerts first and oldest first.