Incident Template
Manage incident templates for your project
Модель Incident Template
Свойства
- Имя
_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 incident
- Имя
templateName- Тип
- TextОбязательно
- Описание
Name of the Incident Template
- Имя
templateDescription- Тип
- Long TextОбязательно
- Описание
Description of the Incident Template
- Имя
description- Тип
- Markdown
- Описание
Short description of this incident. This is in markdown and will be visible on the status page.
- Имя
slug- Тип
- SlugОбязательно
- Описание
Friendly globally unique name for your object
- Имя
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)
- Имя
monitors- Тип
- Monitor
- Описание
List of monitors affected by this incident
- Имя
onCallDutyPolicies- Тип
- On-Call Policy
- Описание
List of on-call duty policies affected by this incident template.
- Имя
labels- Тип
- Label
- Описание
Relation to Labels Array where this object is categorized in.
- Имя
incidentSeverity- Тип
- Incident Severity
- Описание
How severe is this incident. Is it critical? or a minor incident?. This is related to Incident Severity.
- Имя
incidentSeverityId- Тип
- Object ID
- Описание
Incident Severity ID
- Имя
changeMonitorStatusTo- Тип
- Incident State
- Описание
Relation to Monitor Status Object. All monitors connected to this incident will be changed to this status when the incident is created.
- Имя
changeMonitorStatusToId- Тип
- Object ID
- Описание
Relation to Monitor Status Object ID. All monitors connected to this incident will be changed to this status when the incident is created.
- Имя
initialIncidentState- Тип
- Incident State
- Описание
Relation to Incident State Object. Incidents created from this template will start in this state.
- Имя
initialIncidentStateId- Тип
- Object ID
- Описание
Relation to Incident State Object ID. Incidents created from this template will start in this state.
- Имя
customFields- Тип
- JSON
- Описание
Custom Fields on this resource.
/api/incident-templates/get-listСписок
Этот метод возвращает постраничный список ваших объектов «Incident Template». По умолчанию на странице до десяти записей.
Необязательные query-параметры
limit- число
- Сколько объектов вернуть. По умолчанию 10, максимум 100
skip- число
- Сколько объектов пропустить (для пагинации)
Необязательное тело запроса
query- Чтобы фильтровать Incident Template, укажите запрос здесь. Подробнее: написание запросов.
select- По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.
sort- По умолчанию сортировка по дате создания. Порядок можно изменить — см. раздел «Сортировка» в типах данных.
Запрос списка
POST/api/incident-templates/get-list?skip=0&limit=10Content-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"projectId": true,
"slug": true,
"templateDescription": true,
"templateName": true,
"title": true
},
"query": {
"templateDescription": "Use this template when experiencing server outages due to database connectivity issues. Includes automated notifications to on-call engineers and status page updates."
},
"sort": {
"createdAt": -1
}
}Ответ
{
"count": 10,
"limit": 10,
"skip": 0,
"data": [
{
"_id": "3772a320-28fe-11f1-b591-3fdcef396aba",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"slug": "server-outage-template",
"templateDescription": "Use this template when experiencing server outages due to database connectivity issues. Includes automated notifications to on-call engineers and status page updates.",
"templateName": "Server Outage Template",
"title": "Production Server Outage - Database Connection Issue"
},
{
"_id": "3772a321-28fe-11f1-b591-3fdcef396aba",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"slug": "server-outage-template",
"templateDescription": "Use this template when experiencing server outages due to database connectivity issues. Includes automated notifications to on-call engineers and status page updates.",
"templateName": "Server Outage Template",
"title": "Production Server Outage - Database Connection Issue"
},
{
"_id": "3772a322-28fe-11f1-b591-3fdcef396aba",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"slug": "server-outage-template",
"templateDescription": "Use this template when experiencing server outages due to database connectivity issues. Includes automated notifications to on-call engineers and status page updates.",
"templateName": "Server Outage Template",
"title": "Production Server Outage - Database Connection Issue"
}
]
}/api/incident-templates/:id/get-itemПолучить по ID
Возвращает объект «Incident Template» по идентификатору.
id- строка
- ID объекта
Необязательное тело запроса
select- По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.
Запрос одного объекта
POST/api/incident-templates/:id/get-itemContent-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"projectId": true,
"slug": true,
"templateDescription": true,
"templateName": true,
"title": true
}
}Ответ
{
"_id": "3772a320-28fe-11f1-b591-3fdcef396aba",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"slug": "server-outage-template",
"templateDescription": "Use this template when experiencing server outages due to database connectivity issues. Includes automated notifications to on-call engineers and status page updates.",
"templateName": "Server Outage Template",
"title": "Production Server Outage - Database Connection Issue"
}/api/incident-templates/countКоличество
Возвращает количество ваших объектов «Incident Template».
Необязательное тело запроса
query- Чтобы фильтровать Incident Template, укажите запрос здесь. Подробнее: написание запросов.
Запрос количества
POST/api/incident-templates/countContent-Type: application/json ApiKey: YOUR_API_KEY
{
"query": {
"templateDescription": "Use this template when experiencing server outages due to database connectivity issues. Includes automated notifications to on-call engineers and status page updates."
}
}Ответ
{
"count": 107
}/api/incident-templatesСоздать Incident Template
Создаёт новый объект.
Запрос создания
POST/api/incident-templatesContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"templateDescription": "Use this template when experiencing server outages due to database connectivity issues. Includes automated notifications to on-call engineers and status page updates.",
"templateName": "Server Outage Template",
"title": "Production Server Outage - Database Connection Issue",
"changeMonitorStatusToId": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a"
}
}Ответ
{
"_id": "3772a320-28fe-11f1-b591-3fdcef396aba",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"slug": "server-outage-template",
"templateDescription": "Use this template when experiencing server outages due to database connectivity issues. Includes automated notifications to on-call engineers and status page updates.",
"templateName": "Server Outage Template",
"title": "Production Server Outage - Database Connection Issue"
}/api/incident-templates/:idОбновить по ID
Обновляет объект по ID.
Альтернативные методы
Если клиент не поддерживает PUT, используйте POST или GET с теми же заголовками и телом:
Запрос обновления
PUT/api/incident-templates/:idContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"templateDescription": "Use this template when experiencing server outages due to database connectivity issues. Includes automated notifications to on-call engineers and status page updates.",
"templateName": "Server Outage Template",
"title": "Production Server Outage - Database Connection Issue"
}
}Ответ
{}/api/incident-templates/:idУдалить по ID
Удаляет объект по ID.
Альтернативные методы
Если клиент не поддерживает DELETE, используйте POST или GET с теми же заголовками и телом:
Запрос удаления
DELETE/api/incident-templates/:idContent-Type: application/json ApiKey: YOUR_API_KEY
Ответ
{}Права доступа
Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.
Права на чтение
Нужны для чтения Incident Template
Project OwnerProject AdminProject MemberRead Incident TemplateRead All Project Resources
Права на создание
Нужны для создания Incident Template
Project OwnerProject AdminProject MemberCreate Incident Template
Права на обновление
Нужны для обновления Incident Template
Project OwnerProject AdminProject MemberEdit Incident Template
Права на удаление
Нужны для удаления Incident Template
Project OwnerProject AdminProject MemberDelete Incident Template