Alert
Manage alerts for your project
Модель Alert
Свойства
- Имя
_id- Тип
- Object ID
- Описание
ID of this object
- Имя
createdAt- Тип
- Date
- Описание
Date and Time when the object was created.
- Имя
updatedAt- Тип
- Date
- Описание
Date and Time when the object was updated.
- Имя
project- Тип
- Project
- Описание
Relation to Project Resource in which this object belongs
- Имя
projectId- Тип
- Object IDОбязательно
- Описание
ID of your Project in which this object belongs
- Имя
title- Тип
- Long TextОбязательно
- Описание
Title of this alert
- Имя
description- Тип
- Markdown
- Описание
Short description of this alert. This will be visible on the status page. This is in markdown.
- Имя
createdByUser- Тип
- User
- Описание
Relation to User who created this object (if this object was created by a User)
- Имя
createdByUserId- Тип
- Object ID
- Описание
User ID who created this object (if this object was created by a User)
- Имя
monitor- Тип
- Monitor
- Описание
Relation to monitor this alert belongs to
- Имя
monitorId- Тип
- Object ID
- Описание
ID of the monitor this alert belongs to
- Имя
onCallDutyPolicies- Тип
- On-Call Policy
- Описание
List of on-call duty policies affected by this alert.
- Имя
labels- Тип
- Label
- Описание
Relation to Labels Array where this object is categorized in.
- Имя
currentAlertState- Тип
- Alert State
- Описание
Current state of this alert. Is the alert acknowledged? or resolved?. This is related to Alert State
- Имя
currentAlertStateId- Тип
- Object IDОбязательно
- Описание
Current Alert State ID
- Имя
alertSeverity- Тип
- Alert Severity
- Описание
How severe is this alert. Is it critical? or a minor alert?. This is related to Alert Severity.
- Имя
alertSeverityId- Тип
- Object IDОбязательно
- Описание
Alert Severity ID
- Имя
monitorStatusWhenThisAlertWasCreated- Тип
- Monitor Status
- Описание
Monitor status when this alert was created
- Имя
monitorStatusWhenThisAlertWasCreatedId- Тип
- Object ID
- Описание
Monitor Status ID when this alert was created
- Имя
customFields- Тип
- JSON
- Описание
Custom Fields on this resource.
- Имя
rootCause- Тип
- Markdown
- Описание
What is the root cause of this alert?
- Имя
createdStateLog- Тип
- JSON
- Описание
- Имя
createdCriteriaId- Тип
- Long Text
- Описание
If this alert was created by a Probe, this is the ID of the criteria that created it.
- Имя
createdByProbe- Тип
- Probe
- Описание
If this alert was created by a Probe, this is the probe that created it.
- Имя
createdByProbeId- Тип
- Object ID
- Описание
If this alert was created by a Probe, this is the ID of the probe that created it.
- Имя
isCreatedAutomatically- Тип
- Boolean
- Описание
Is this alert created by Probe or Workers automatically (and not created manually by a user)?
- Имя
remediationNotes- Тип
- Markdown
- Описание
Notes on how to remediate this alert. This is in markdown.
- Имя
telemetryQuery- Тип
- JSON
- Описание
Telemetry query for this alert
- Имя
alertNumber- Тип
- Number
- Описание
Alert Number
- Имя
alertNumberWithPrefix- Тип
- Text
- Описание
Alert number with prefix (e.g., 'ALT-42' or '#42')
- Имя
alertEpisode- Тип
- Alert Episode
- Описание
The episode this alert belongs to (if grouped)
- Имя
alertEpisodeId- Тип
- Object ID
- Описание
The ID of the episode this alert belongs to (if grouped)
/api/alert/get-listСписок
Этот метод возвращает постраничный список ваших объектов «Alert». По умолчанию на странице до десяти записей.
Необязательные query-параметры
limit- число
- Сколько объектов вернуть. По умолчанию 10, максимум 100
skip- число
- Сколько объектов пропустить (для пагинации)
Необязательное тело запроса
query- Чтобы фильтровать Alert, укажите запрос здесь. Подробнее: написание запросов.
select- По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.
sort- По умолчанию сортировка по дате создания. Порядок можно изменить — см. раздел «Сортировка» в типах данных.
Запрос списка
POST/api/alert/get-list?skip=0&limit=10Content-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"alertSeverityId": true,
"currentAlertStateId": true,
"projectId": true,
"title": true,
"alertNumber": true
},
"query": {
"title": "High CPU usage detected on production server"
},
"sort": {
"createdAt": -1
}
}Ответ
{
"count": 10,
"limit": 10,
"skip": 0,
"data": [
{
"_id": "376ab3e0-28fe-11f1-b591-3fdcef396aba",
"alertSeverityId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"currentAlertStateId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"title": "High CPU usage detected on production server",
"alertNumber": 42
},
{
"_id": "376ab3e1-28fe-11f1-b591-3fdcef396aba",
"alertSeverityId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"currentAlertStateId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"title": "High CPU usage detected on production server",
"alertNumber": 42
},
{
"_id": "376ab3e2-28fe-11f1-b591-3fdcef396aba",
"alertSeverityId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"currentAlertStateId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"title": "High CPU usage detected on production server",
"alertNumber": 42
}
]
}/api/alert/:id/get-itemПолучить по ID
Возвращает объект «Alert» по идентификатору.
id- строка
- ID объекта
Необязательное тело запроса
select- По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.
Запрос одного объекта
POST/api/alert/:id/get-itemContent-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"alertSeverityId": true,
"currentAlertStateId": true,
"projectId": true,
"title": true,
"alertNumber": true
}
}Ответ
{
"_id": "376ab3e0-28fe-11f1-b591-3fdcef396aba",
"alertSeverityId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"currentAlertStateId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"title": "High CPU usage detected on production server",
"alertNumber": 42
}/api/alert/countКоличество
Возвращает количество ваших объектов «Alert».
Необязательное тело запроса
query- Чтобы фильтровать Alert, укажите запрос здесь. Подробнее: написание запросов.
Запрос количества
POST/api/alert/countContent-Type: application/json ApiKey: YOUR_API_KEY
{
"query": {
"title": "High CPU usage detected on production server"
}
}Ответ
{
"count": 107
}/api/alertСоздать Alert
Создаёт новый объект.
Запрос создания
POST/api/alertContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"alertSeverityId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"currentAlertStateId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"title": "High CPU usage detected on production server",
"description": "CPU usage has exceeded 90% threshold for the past 5 minutes. Immediate investigation required."
}
}Ответ
{
"_id": "376ab3e0-28fe-11f1-b591-3fdcef396aba",
"alertSeverityId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"currentAlertStateId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"title": "High CPU usage detected on production server",
"alertNumber": 42
}/api/alert/:idОбновить по ID
Обновляет объект по ID.
Альтернативные методы
Если клиент не поддерживает PUT, используйте POST или GET с теми же заголовками и телом:
Запрос обновления
PUT/api/alert/:idContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"alertSeverityId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"currentAlertStateId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"title": "High CPU usage detected on production server"
}
}Ответ
{}/api/alert/:idУдалить по ID
Удаляет объект по ID.
Альтернативные методы
Если клиент не поддерживает DELETE, используйте POST или GET с теми же заголовками и телом:
Запрос удаления
DELETE/api/alert/:idContent-Type: application/json ApiKey: YOUR_API_KEY
Ответ
{}Права доступа
Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.
Права на чтение
Нужны для чтения Alert
Project OwnerProject AdminProject MemberRead AlertRead All Project Resources
Права на создание
Нужны для создания Alert
Project OwnerProject AdminProject MemberCreate Alert
Права на обновление
Нужны для обновления Alert
Project OwnerProject AdminProject MemberEdit Alert
Права на удаление
Нужны для удаления Alert
Project OwnerProject AdminProject MemberDelete Alert