Ресурс

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.

GETorPOST/api/incident-templates/get-list

Список

Этот метод возвращает постраничный список ваших объектов «Incident Template». По умолчанию на странице до десяти записей.

Необязательные query-параметры

  • limit
    число
    Сколько объектов вернуть. По умолчанию 10, максимум 100
  • skip
    число
    Сколько объектов пропустить (для пагинации)

Необязательное тело запроса

Запрос списка

POST
/api/incident-templates/get-list?skip=0&limit=10
Заголовки
Content-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"
    }
  ]
}
GETorPOST/api/incident-templates/:id/get-item

Получить по ID

Возвращает объект «Incident Template» по идентификатору.

  • id
    строка
    ID объекта

Необязательное тело запроса

  • select
    По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.

Запрос одного объекта

POST
/api/incident-templates/:id/get-item
Заголовки
Content-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"
}
POST/api/incident-templates/count

Количество

Возвращает количество ваших объектов «Incident Template».

Необязательное тело запроса

Запрос количества

POST
/api/incident-templates/count
Заголовки
Content-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
}
POST/api/incident-templates

Создать Incident Template

Создаёт новый объект.

Запрос создания

POST
/api/incident-templates
Заголовки
Content-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"
}
PUT/api/incident-templates/:id

Обновить по ID

Обновляет объект по ID.

Альтернативные методы

Если клиент не поддерживает PUT, используйте POST или GET с теми же заголовками и телом:

POST/api/incident-templates/:id/update-item
GET/api/incident-templates/:id/update-item

Запрос обновления

PUT
/api/incident-templates/:id
Заголовки
Content-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"
  }
}

Ответ

{}
DELETE/api/incident-templates/:id

Удалить по ID

Удаляет объект по ID.

Альтернативные методы

Если клиент не поддерживает DELETE, используйте POST или GET с теми же заголовками и телом:

POST/api/incident-templates/:id/delete-item
GET/api/incident-templates/:id/delete-item

Запрос удаления

DELETE
/api/incident-templates/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY

Ответ

{}

Права доступа

Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.

Права на чтение

Нужны для чтения Incident Template

  • Project Owner
  • Project Admin
  • Project Member
  • Read Incident Template
  • Read All Project Resources

Права на создание

Нужны для создания Incident Template

  • Project Owner
  • Project Admin
  • Project Member
  • Create Incident Template

Права на обновление

Нужны для обновления Incident Template

  • Project Owner
  • Project Admin
  • Project Member
  • Edit Incident Template

Права на удаление

Нужны для удаления Incident Template

  • Project Owner
  • Project Admin
  • Project Member
  • Delete Incident Template