Перейти к содержанию

Получение папки контента по ID

Запрос

Тип Метод
GET /content_folders/{folder_id}

Описание: При выполнении запроса будет возвращена папка с соответствующим ID.

Если не указан параметр relations, то подгружаются все связи объекта. Если параметр указан, но не имеет значений - связи не подгружаются. Если параметр указан и содержит значения (поля модели хранящие связанные сущности), то они будут заполнены в ответе.

Пример запроса

GET
http://127.0.0.1/cruddy/v2/content_folders/{folder_id}

Path параметры запроса:

Параметр Описание
{folder_id} Идентификатор папки

Query параметры запроса:

Параметр Описание
relations Перечисление подгружаемых связей
Пример Query параметров запроса

[
  "logmule_go_rules"
]

Успешный ответ

Статус код: 200 – запрос успешно обработан.

Формат: JSON.

Тело ответа: модель папки контента.

Пример ответа

{
  "parent_id": "null",
  "name": "string",
  "logmule_go_rules": [
    {
      "name": "string",
      "frontend_data": {
        "alert": {
          "id": "uuid",
          "name": "string",
          "create_incident": true,
          "assign_to_customer": true,
          "risk_level": 5.35,
          "asset_ip": "string",
          "asset_hostname": "string",
          "asset_fqdn": "string",
          "asset_mac": "string",
          "first_and_last_logs": false,
          "trim_logs": 1,
          "template": "string",
          "mitre": "",
          "incident_group": ""
        },
        "grouper": {
          "id": "uuid",
          "name": "string",
          "grouped_by": [
            "string"
          ],
          "aggregated_by": [
            "string"
          ],
          "grouped_time_field": "string",
          "grouped_time_type": "2023-12-20T00:00:01.652259Z",
          "detection_windows": 5,
          "detection_windows_unit": "ms",
          "aggregate_count": 1,
          "aggregate_unique": true,
          "chain_pattern": [
            {
              "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
              "type": "chain-pattern-condition",
              "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43",
              "compareFn": "in",
              "expressions": [
                {
                  "type": "const-string",
                  "value": "HostName"
                },
                {
                  "type": "const-string-array",
                  "value": [
                    "str1",
                    "str2",
                    "str3"
                  ]
                },
                {
                  "type": "const-integer",
                  "value": "123"
                },
                {
                  "type": "const-boolean",
                  "value": true
                },
                {
                  "type": "const-boolean",
                  "value": false
                }
              ]
            }
          ]
        },
        "actions": [
          {
            "TTL": "string",
            "key": {
              "_default": {
                "type": "value",
                "value": "string"
              }
            },
            "type": "store-set",
            "store": "string",
            "value": "string",
            "column": "string"
          }
        ],
        "conditions": [
          {
            "type": "compare-condition",
            "id": "uuid",
            "parentId": null,
            "negation": false,
            "compareFn": "eq",
            "expressions": [
              {
                "type": "logline-get",
                "value": "string"
              }
            ]
          }
        ],
        "version": 2
      },
      "test_data": [
        {}
      ],
      "settings": {
        "function_metrics": false,
        "is_constructor": false,
        "max_alerts": 1,
        "max_alerts_per_second": 1,
        "max_rule_memory_mb": 1
      },
      "active": true,
      "reload": true,
      "finding_id": "uuid",
      "content_folder_id": "074f5590-80d1-4bf0-90cf-62eb4bdc20d9",
      "description": "string",
      "lua": "string",
      "is_retro": false,
      "is_system": true,
      "stats": {
        "result_count": 1,
        "error_count": 0
      },
      "is_error": 0,
      "running_at": "2023-12-20T00:00:01.652259Z"
    }
  ],
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "content": 0,
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
  "logmule_go_rules_count": 0,
  "slug": "string",
  "path": "string"
}

Другие возможные ответы

Код Ответ Описание
400 id is empty Не передан параметр “id”
404 not found Объект не найден
500 Internal Server Error Другие ошибки при получении объекта

Примечание: Текст ошибки не фиксированный, может изменяться в зависимости от фактического ответа получателя запроса.

Пример ответа
Код 400

{
  "error": "Bad Request",
  "error_code": 400
}

Код 404

{
  "error": "Not Found",
  "error_code": 404
}

Код 500

{
  "error": "Internal Server Error",
  "error_code": 500
}