Ресурс

Monitor Status

Manage monitor status in your project. Monitor Status are Operational, Degraded and Offline for example. Add custom status like Monitoring or more.

Модель Monitor Status

Свойства

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

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

    Friendly globally unique name for your object

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

    Friendly description that will help you remember

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

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

    Color of this resource in Hex (#32a852 for example)

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

    Is this monitor in operational state?

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

    Is this monitor in offline state?

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

    Order / Priority of this status. For example: Operational has priority 1, Degraded has 2, Offline has 3. Lower priority would mean bad state of the resource.

GETorPOST/api/monitor-status/get-list

Список

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

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

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

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

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

POST
/api/monitor-status/get-list?skip=0&limit=10
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "name": true,
    "projectId": true,
    "createdByUserId": true,
    "description": true,
    "color": true
  },
  "query": {
    "name": "Operational"
  },
  "sort": {
    "createdAt": -1
  }
}

Ответ

{
  "count": 10,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_id": "3775b060-28fe-11f1-b591-3fdcef396aba",
      "name": "Operational",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "description": "The monitor is running normally and all systems are operational",
      "color": "#3498db"
    },
    {
      "_id": "3775b061-28fe-11f1-b591-3fdcef396aba",
      "name": "Operational",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "description": "The monitor is running normally and all systems are operational",
      "color": "#3498db"
    },
    {
      "_id": "3775b062-28fe-11f1-b591-3fdcef396aba",
      "name": "Operational",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "description": "The monitor is running normally and all systems are operational",
      "color": "#3498db"
    }
  ]
}
GETorPOST/api/monitor-status/:id/get-item

Получить по ID

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

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

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

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

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

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

Ответ

{
  "_id": "3775b060-28fe-11f1-b591-3fdcef396aba",
  "name": "Operational",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "description": "The monitor is running normally and all systems are operational",
  "color": "#3498db"
}
POST/api/monitor-status/count

Количество

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

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

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

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

Ответ

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

Создать Monitor Status

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

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

POST
/api/monitor-status
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "name": "Operational",
    "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
    "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "description": "The monitor is running normally and all systems are operational",
    "color": "#3498db"
  }
}

Ответ

{
  "_id": "3775b060-28fe-11f1-b591-3fdcef396aba",
  "name": "Operational",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "description": "The monitor is running normally and all systems are operational",
  "color": "#3498db"
}
PUT/api/monitor-status/:id

Обновить по ID

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

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

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

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

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

PUT
/api/monitor-status/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "name": "Operational",
    "description": "The monitor is running normally and all systems are operational",
    "color": "#3498db"
  }
}

Ответ

{}
DELETE/api/monitor-status/:id

Удалить по ID

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

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

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

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

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

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

Ответ

{}

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

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

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

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

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

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

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

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

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

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

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

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

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

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