Ресурс

Monitor Group

Monitor Groups are a way to organize your monitors into groups. You can create as many groups as you want and add as many monitors as you want to each group.

Модель Monitor Group

Свойства

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

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

GETorPOST/api/monitor-group/get-list

Список

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

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

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

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

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

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

Ответ

{
  "count": 10,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_id": "3774c600-28fe-11f1-b591-3fdcef396aba",
      "name": "Production Servers",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "description": "All production servers and services that need 24/7 monitoring",
      "slug": "Example slug"
    },
    {
      "_id": "3774c601-28fe-11f1-b591-3fdcef396aba",
      "name": "Production Servers",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "description": "All production servers and services that need 24/7 monitoring",
      "slug": "Example slug"
    },
    {
      "_id": "3774c602-28fe-11f1-b591-3fdcef396aba",
      "name": "Production Servers",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "description": "All production servers and services that need 24/7 monitoring",
      "slug": "Example slug"
    }
  ]
}
GETorPOST/api/monitor-group/:id/get-item

Получить по ID

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

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

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

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

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

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

Ответ

{
  "_id": "3774c600-28fe-11f1-b591-3fdcef396aba",
  "name": "Production Servers",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "description": "All production servers and services that need 24/7 monitoring",
  "slug": "Example slug"
}
POST/api/monitor-group/count

Количество

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

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

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

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

Ответ

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

Создать Monitor Group

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

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

POST
/api/monitor-group
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "name": "Production Servers",
    "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
    "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "description": "All production servers and services that need 24/7 monitoring",
    "createdByUser": "Example created by user"
  }
}

Ответ

{
  "_id": "3774c600-28fe-11f1-b591-3fdcef396aba",
  "name": "Production Servers",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "description": "All production servers and services that need 24/7 monitoring",
  "slug": "Example slug"
}
PUT/api/monitor-group/:id

Обновить по ID

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

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

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

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

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

PUT
/api/monitor-group/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "name": "Production Servers",
    "description": "All production servers and services that need 24/7 monitoring",
    "labels": []
  }
}

Ответ

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

Удалить по ID

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

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

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

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

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

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

Ответ

{}

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

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

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

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

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

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

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

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

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

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

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

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

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

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