Ресурс

Monitor

Monitor is anything that monitors your API, Websites, IP, Network or more. You can also create static monitor that does not monitor anything.

Модель Monitor

Свойства

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

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

    Any friendly name for this monitor

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

    Friendly description that will help you remember

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

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

    Relation to Labels Array where this object is categorized in.

  • Имя
    monitorType
    Тип
    Monitor TypeОбязательно
    Описание

    What is the type of this monitor? Website? API? etc.

  • Имя
    currentMonitorStatus
    Тип
    Monitor Status
    Описание

    Whats the current status of this monitor?

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

    Whats the current status ID of this monitor?

  • Имя
    monitorSteps
    Тип
    Monitor Steps
    Описание

    What would you like to monitor and what is the criteria?

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

    How often would you like to monitor this resource?

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

    Custom Fields on this resource.

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

    Disable active monitoring for this resource?

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

    This field is for Incoming Request monitor only. When was the last time we checked the heartbeat?

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

    This field is for Telemetry Monitor only. When is the next time we should monitor?

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

    This field is for Telemetry Monitor only. When was the last time we monitored?

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

    Disable Monitoring because of Ongoing Scheduled Maintenance Event

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

    Disable Monitoring because of Incident which is creeated manually by user.

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

    This field is for Server Monitor only. When was the last time we received a request?

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

    This field is for Server Monitor only. Secret Key to authenticate the request.

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

    This field is for Incoming Request Monitor only. Secret Key to authenticate the request.

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

    Incoming Monitor Request for Incoming Request Monitor

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

    This field is for Incoming Email Monitor only. Secret Key used to generate unique email address.

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

    This field is for Incoming Email Monitor only. When was the last email received?

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

    This field is for Incoming Email Monitor only. Last email data received.

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

    This field is for Incoming Email monitor only. When was the last time we checked the heartbeat?

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

    Server Monitor Response for Server Monitor

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

    All Probes Disconnected From This Monitor. Is this monitor not being monitored?

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

    No Probe Enabled On This Monitor. Is this monitor not being monitored?

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

    Minimum number of probes that must agree on a status before the monitor status changes. If null, all enabled and connected probes must agree.

GETorPOST/api/monitor/get-list

Список

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

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

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

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

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

POST
/api/monitor/get-list?skip=0&limit=10
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "currentMonitorStatusId": true,
    "disableActiveMonitoring": true,
    "monitorType": true,
    "name": true,
    "projectId": true
  },
  "query": {
    "name": "Production API Server"
  },
  "sort": {
    "createdAt": -1
  }
}

Ответ

{
  "count": 10,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_id": "377477e0-28fe-11f1-b591-3fdcef396aba",
      "currentMonitorStatusId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
      "disableActiveMonitoring": false,
      "monitorType": "API",
      "name": "Production API Server",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e"
    },
    {
      "_id": "377477e1-28fe-11f1-b591-3fdcef396aba",
      "currentMonitorStatusId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
      "disableActiveMonitoring": false,
      "monitorType": "API",
      "name": "Production API Server",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e"
    },
    {
      "_id": "377477e2-28fe-11f1-b591-3fdcef396aba",
      "currentMonitorStatusId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
      "disableActiveMonitoring": false,
      "monitorType": "API",
      "name": "Production API Server",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e"
    }
  ]
}
GETorPOST/api/monitor/:id/get-item

Получить по ID

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

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

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

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

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

POST
/api/monitor/:id/get-item
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "currentMonitorStatusId": true,
    "disableActiveMonitoring": true,
    "monitorType": true,
    "name": true,
    "projectId": true
  }
}

Ответ

{
  "_id": "377477e0-28fe-11f1-b591-3fdcef396aba",
  "currentMonitorStatusId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
  "disableActiveMonitoring": false,
  "monitorType": "API",
  "name": "Production API Server",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e"
}
POST/api/monitor/count

Количество

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

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

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

POST
/api/monitor/count
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "query": {
    "name": "Production API Server"
  }
}

Ответ

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

Создать Monitor

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

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

POST
/api/monitor
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "currentMonitorStatusId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "disableActiveMonitoring": false,
    "monitorType": "API",
    "name": "Production API Server",
    "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e"
  }
}

Ответ

{
  "_id": "377477e0-28fe-11f1-b591-3fdcef396aba",
  "currentMonitorStatusId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
  "disableActiveMonitoring": false,
  "monitorType": "API",
  "name": "Production API Server",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e"
}
PUT/api/monitor/:id

Обновить по ID

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

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

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

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

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

PUT
/api/monitor/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "currentMonitorStatusId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
    "disableActiveMonitoring": false,
    "name": "Production API Server"
  }
}

Ответ

{}
DELETE/api/monitor/:id

Удалить по ID

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

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

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

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

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

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

Ответ

{}

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

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

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

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

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

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

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

  • Project Owner
  • Project Admin
  • Project Member
  • Create Monitor

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

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

  • Project Owner
  • Project Admin
  • Project Member
  • Edit Monitor

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

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

  • Project Owner
  • Project Admin
  • Project Member
  • Delete Monitor