Ресурс

Incident

Manage incidents for your project

Модель Incident

Свойства

  • Имя
    _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

  • Имя
    description
    Тип
    Markdown
    Описание

    Short description of this incident. This is in markdown and will be visible on the status page.

  • Имя
    declaredAt
    Тип
    DateОбязательно
    Описание

    Date and time when this incident was declared.

  • Имя
    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.

  • Имя
    labels
    Тип
    Label
    Описание

    Relation to Labels Array where this object is categorized in.

  • Имя
    currentIncidentState
    Тип
    Incident State
    Описание

    Current state of this incident. Is the incident acknowledged? or resolved?. This is related to Incident State

  • Имя
    currentIncidentStateId
    Тип
    Object IDОбязательно
    Описание

    Current Incident State ID

  • Имя
    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.

  • Имя
    subscriberNotificationStatusMessage
    Тип
    Very Long Text
    Описание

    Status message for subscriber notifications - includes success messages, failure reasons, or skip reasons

  • Имя
    subscriberNotificationStatusMessageOnPostmortemPublished
    Тип
    Very Long Text
    Описание

    Status message for subscriber notifications on postmortem published - includes success messages, failure reasons, or skip reasons

  • Имя
    shouldStatusPageSubscribersBeNotifiedOnIncidentCreated
    Тип
    Boolean
    Описание

    Should subscribers be notified about this incident?

  • Имя
    customFields
    Тип
    JSON
    Описание

    Custom Fields on this resource.

  • Имя
    rootCause
    Тип
    Markdown
    Описание

    What is the root cause of this incident?

  • Имя
    postmortemNote
    Тип
    Markdown
    Описание

    Document the postmortem summary for this incident.

  • Имя
    showPostmortemOnStatusPage
    Тип
    Boolean
    Описание

    Should the postmortem note and attachments be visible on the status page once published?

  • Имя
    notifySubscribersOnPostmortemPublished
    Тип
    Boolean
    Описание

    Should subscribers be notified when the postmortem is published?

  • Имя
    postmortemPostedAt
    Тип
    Date
    Описание

    Timestamp that will be shown alongside the published postmortem on the status page.

  • Имя
    postmortemAttachments
    Тип
    File
    Описание

    Files that accompany the postmortem note and can be shared publicly when enabled.

  • Имя
    createdStateLog
    Тип
    JSON
    Описание

  • Имя
    createdCriteriaId
    Тип
    Long Text
    Описание

    If this incident was created by a Probe, this is the ID of the criteria that created it.

  • Имя
    createdIncidentTemplateId
    Тип
    Long Text
    Описание

    If this incident was created by a Probe, this is the ID of the incident template that was used for creation.

  • Имя
    createdByProbe
    Тип
    Probe
    Описание

    If this incident was created by a Probe, this is the probe that created it.

  • Имя
    createdByProbeId
    Тип
    Object ID
    Описание

    If this incident was created by a Probe, this is the ID of the probe that created it.

  • Имя
    isCreatedAutomatically
    Тип
    Boolean
    Описание

    Is this incident created by Probe or Workers automatically (and not created manually by a user)?

  • Имя
    remediationNotes
    Тип
    Markdown
    Описание

    Notes on how to remediate this incident. This is in markdown.

  • Имя
    telemetryQuery
    Тип
    JSON
    Описание

    Telemetry query for this incident

  • Имя
    incidentNumber
    Тип
    Number
    Описание

    Incident Number

  • Имя
    incidentNumberWithPrefix
    Тип
    Text
    Описание

    Incident number with prefix (e.g., 'INC-42' or '#42')

  • Имя
    isVisibleOnStatusPage
    Тип
    Boolean
    Описание

    Should this incident be visible on the status page?

  • Имя
    incidentEpisode
    Тип
    Incident Episode
    Описание

    Relation to Incident Episode this incident belongs to

  • Имя
    incidentEpisodeId
    Тип
    Object ID
    Описание

    ID of the Incident Episode this incident belongs to

GETorPOST/api/incident/get-list

Список

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

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

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

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

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

POST
/api/incident/get-list?skip=0&limit=10
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "currentIncidentStateId": true,
    "declaredAt": true,
    "incidentSeverityId": true,
    "projectId": true,
    "slug": true
  },
  "query": {
    "title": "Database connection failure in production"
  },
  "sort": {
    "createdAt": -1
  }
}

Ответ

{
  "count": 10,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_id": "376ed290-28fe-11f1-b591-3fdcef396aba",
      "currentIncidentStateId": "d4e5f6a7-b8c9-0123-defg-456789012345",
      "declaredAt": "2024-01-15T09:30:00.000Z",
      "incidentSeverityId": "e5f6a7b8-c9d0-1234-efgh-567890123456",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "slug": "database-connection-failure-in-production"
    },
    {
      "_id": "376ed291-28fe-11f1-b591-3fdcef396aba",
      "currentIncidentStateId": "d4e5f6a7-b8c9-0123-defg-456789012345",
      "declaredAt": "2024-01-15T09:30:00.000Z",
      "incidentSeverityId": "e5f6a7b8-c9d0-1234-efgh-567890123456",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "slug": "database-connection-failure-in-production"
    },
    {
      "_id": "376ed292-28fe-11f1-b591-3fdcef396aba",
      "currentIncidentStateId": "d4e5f6a7-b8c9-0123-defg-456789012345",
      "declaredAt": "2024-01-15T09:30:00.000Z",
      "incidentSeverityId": "e5f6a7b8-c9d0-1234-efgh-567890123456",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "slug": "database-connection-failure-in-production"
    }
  ]
}
GETorPOST/api/incident/:id/get-item

Получить по ID

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

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

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

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

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

POST
/api/incident/:id/get-item
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "currentIncidentStateId": true,
    "declaredAt": true,
    "incidentSeverityId": true,
    "projectId": true,
    "slug": true
  }
}

Ответ

{
  "_id": "376ed290-28fe-11f1-b591-3fdcef396aba",
  "currentIncidentStateId": "d4e5f6a7-b8c9-0123-defg-456789012345",
  "declaredAt": "2024-01-15T09:30:00.000Z",
  "incidentSeverityId": "e5f6a7b8-c9d0-1234-efgh-567890123456",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "slug": "database-connection-failure-in-production"
}
POST/api/incident/count

Количество

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

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

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

POST
/api/incident/count
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "query": {
    "title": "Database connection failure in production"
  }
}

Ответ

{
  "count": 107
}
POST/api/incident

Создать Incident

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

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

POST
/api/incident
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "currentIncidentStateId": "d4e5f6a7-b8c9-0123-defg-456789012345",
    "declaredAt": "2024-01-15T09:30:00.000Z",
    "incidentSeverityId": "e5f6a7b8-c9d0-1234-efgh-567890123456",
    "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
    "title": "Database connection failure in production"
  }
}

Ответ

{
  "_id": "376ed290-28fe-11f1-b591-3fdcef396aba",
  "currentIncidentStateId": "d4e5f6a7-b8c9-0123-defg-456789012345",
  "declaredAt": "2024-01-15T09:30:00.000Z",
  "incidentSeverityId": "e5f6a7b8-c9d0-1234-efgh-567890123456",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "slug": "database-connection-failure-in-production"
}
PUT/api/incident/:id

Обновить по ID

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

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

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

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

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

PUT
/api/incident/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "currentIncidentStateId": "d4e5f6a7-b8c9-0123-defg-456789012345",
    "declaredAt": "2024-01-15T09:30:00.000Z",
    "incidentSeverityId": "e5f6a7b8-c9d0-1234-efgh-567890123456"
  }
}

Ответ

{}
DELETE/api/incident/:id

Удалить по ID

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

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

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

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

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

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

Ответ

{}

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

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

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

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

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

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

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

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

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

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

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

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

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

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