Ресурс

Monitor Secret

Monitor Secret is a secret variable that can be used in monitors. For example you can store auth tokens, passwords, etc. in Monitor Secret and use them in your monitors. Monitor Secret is encrypted and only accessible by the probe.

Модель Monitor Secret

Свойства

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

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

    Friendly description that will help you remember

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

    Secret value that you want to store in this object. This value will be encrypted and only accessible by the probe.

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

    List of monitors that can access this secret

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

GETorPOST/api/monitor-secret/get-list

Список

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

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

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

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

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

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

Ответ

{
  "count": 10,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_id": "37756240-28fe-11f1-b591-3fdcef396aba",
      "name": "API_AUTH_TOKEN",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUser": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "description": "API authentication token for third-party service integration"
    },
    {
      "_id": "37756241-28fe-11f1-b591-3fdcef396aba",
      "name": "API_AUTH_TOKEN",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUser": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "description": "API authentication token for third-party service integration"
    },
    {
      "_id": "37756242-28fe-11f1-b591-3fdcef396aba",
      "name": "API_AUTH_TOKEN",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUser": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "description": "API authentication token for third-party service integration"
    }
  ]
}
GETorPOST/api/monitor-secret/:id/get-item

Получить по ID

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

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

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

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

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

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

Ответ

{
  "_id": "37756240-28fe-11f1-b591-3fdcef396aba",
  "name": "API_AUTH_TOKEN",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "createdByUser": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "createdByUserId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "description": "API authentication token for third-party service integration"
}
POST/api/monitor-secret/count

Количество

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

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

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

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

Ответ

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

Создать Monitor Secret

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

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

POST
/api/monitor-secret
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "name": "API_AUTH_TOKEN",
    "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
    "createdByUser": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
    "createdByUserId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
    "description": "API authentication token for third-party service integration"
  }
}

Ответ

{
  "_id": "37756240-28fe-11f1-b591-3fdcef396aba",
  "name": "API_AUTH_TOKEN",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "createdByUser": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "createdByUserId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "description": "API authentication token for third-party service integration"
}
PUT/api/monitor-secret/:id

Обновить по ID

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

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

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

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

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

PUT
/api/monitor-secret/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "name": "API_AUTH_TOKEN",
    "description": "API authentication token for third-party service integration",
    "monitors": "[\"5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e\"]"
  }
}

Ответ

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

Удалить по ID

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

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

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

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

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

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

Ответ

{}

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

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

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

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

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

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

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

  • Project Owner
  • Project Admin
  • Create Monitor Secret

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

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

  • Project Owner
  • Project Admin
  • Edit Monitor Secret

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

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

  • Project Owner
  • Project Admin
  • Delete Monitor Secret