Тревоги API 1.7.0
Методы API для работы с разделом «Тревоги».
Базовый путь: https://{IP_контроллера}/api/v1.
Версия описания API: 1.7.0.
Примеры используют placeholder-значения для паролей, token, UUID, адресов и секретов. Перед выполнением запроса замените их на значения вашего контроллера.
Методы раздела
DELETE /alerts/access_points/{uuid}
Раздел: Тревоги.
Удаляет тревожное событие точки прохода
Назначение | URL запроса |
Удаляет тревожное событие точки прохода | https://{IP_контроллера}/api/v1/alerts/access_points/{uuid} |
Параметры запроса:
Название | Тип | Описание | |
uuid* | string (path) | UUID точки прохода | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
access_point_uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID точки прохода |
comment | string | Коментарий | |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"success": true,
"message": [
"string"
]
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Delete alerts of access point",
"parameters": [
{
"in": "path",
"name": "uuid",
"description": "uuid access point",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
}
}
],
"requestBody": {
"description": "Alert data",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"access_point_uuid"
],
"properties": {
"access_point_uuid": {
"type": "string",
"format": "uuid",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"comment": {
"type": "string"
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully deleted alerts of access point",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
}
}
}
}
}
}
},
"400": {
"description": "Bad request parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X DELETE "https://{IP_контроллера}/api/v1/alerts/access_points/{uuid}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"data": {
"access_point_uuid": "00000000-0000-4000-8000-000000000000",
"comment": "string"
}
}'
Пример тела запроса
{
"data": {
"access_point_uuid": "00000000-0000-4000-8000-000000000000",
"comment": "string"
}
}
Пример ответа
{
"success": true,
"message": [
"string"
]
}
GET /alerts/access_points/{uuid}/count
Раздел: Тревоги.
Возвращает количество тревог на точке прохода
Назначение | URL запроса |
Возвращает количество тревог на точке прохода | https://{IP_контроллера}/api/v1/alerts/access_points/{uuid}/count |
Параметры запроса:
Наименование | Описание |
uuid*string (path) | UUID точки прохода |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"count": 0
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns alerts count of access point",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Successfully returned alerts count of access point",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"count": {
"type": "integer"
}
}
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/alerts/access_points/{uuid}/count" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"count": 1
}
GET /alerts/audit-alert
Раздел: Тревоги.
Возвращает отсортированные оповещения о тревогах на события аудит по UUID точек прохода
Назначение | URL запроса |
Возвращает отсортированные оповещения о тревогах на события аудит по UUID точек прохода | https://{IP_контроллера}/api/v1/alerts/audit-alert |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Пример из Teamly сохранён дословно, но не является корректным JSON.
{
description:
Alerts list
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns alerts",
"responses": {
"200": {
"description": "Successfully returned sorted alerts by access points uuids",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Alerts list"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/alerts/audit-alert" \
-H "Authorization: Bearer <token>"
Пример ответа
{}
GET /alerts/notification-alert
Раздел: Тревоги.
Возвращает отсортированные оповещения о тревогах на события оповещения по UUID точек прохода
Назначение | URL запроса |
Возвращает отсортированные оповещения о тревогах на события оповещения по UUID точек прохода | https://{IP_контроллера}/api/v1/alerts/notification-alert |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Пример из Teamly сохранён дословно, но не является корректным JSON.
{
description:
Alerts list
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns alerts",
"responses": {
"200": {
"description": "Successfully returned sorted alerts by access points uuids",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Alerts list"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/alerts/notification-alert" \
-H "Authorization: Bearer <token>"
Пример ответа
{}
GET /alerts/sortByAccessPoint
Раздел: Тревоги.
Возвращает тревогу с отсортированными по UUID точками прохода
Назначение | URL запроса |
Возвращает тревогу с отсортированными по UUID точками прохода | https://{IP_контроллера}/api/v1/alerts/sortByAccessPoint |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid | string | pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ | UUID тревоги |
reason | string | Описание причины тревоги | |
access_point_uuid | string | pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ | UUID точки прохода |
access_point_name | string | Имя точки прохода | |
last | integer | UNIX временная метка последнего события | |
first | integer | UNIX временная метка первого нарушения | |
type | string | [BREAK, HOLD, UNBLOCK] | Тип события тревоги |
count | integer | Количество случаев нарушения |
{
"additionalProp1": [
{
"uuid": "string",
"C": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"last": 0,
"first": 0,
"type": "string",
"count": 0
}
],
"additionalProp2": [
{
"uuid": "string",
"reason": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"last": 0,
"first": 0,
"type": "string",
"count": 0
}
],
"additionalProp3": [
{
"uuid": "string",
"reason": "string",
"access_point_uuid": "string",
"access_point_name": "string",
"last": 0,
"first": 0,
"type": "string",
"count": 0
}
]
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns object with sorted alerts by access point uuids",
"responses": {
"200": {
"description": "Successfully returned sorted alerts by access points uuids",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "Alerts list grouped by access point UUID",
"additionalProperties": {
"type": "array",
"items": {
"type": "object",
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"reason": {
"type": "string"
},
"access_point_uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"access_point_name": {
"type": "string"
},
"last": {
"type": "integer",
"description": "Last violation event timestamp"
},
"first": {
"type": "integer",
"description": "First violation event timestamp"
},
"type": {
"type": "string"
},
"count": {
"description": "Count of violation events",
"type": "integer"
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/alerts/sortByAccessPoint" \
-H "Authorization: Bearer <token>"
Пример ответа
{}
GET /alerts/violations
Раздел: Тревоги.
Возвращает количество тревог на точке прохода с параметрами
Назначение | URL запроса |
Возвращает количество тревог на точке прохода с параметрами | https://{IP_контроллера}/api/v1/alerts/violations |
Параметры запроса:
Наименование | Описание |
type* string (query) uuid* string (query) cursor string (query) page_size string (query) | Тип события тревоги [BREAK, HOLD, UNBLOCK] UUID точки прохода Номер строки следующего поиска Количество записей на одной странице |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запрос
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ | UUID тревоги |
name | string | example: ACCESS_MODE_CHANGED | Имя события |
timestamp* | string | ($int64) | Временная метка события UNIX в миллисекундах |
type* | string | [ INFO, WARN, ALERT, EVENT ] | Тип события |
reason* | string | Описание причины события | |
controller* | string | Серийный номер контроллера, где настроена ТП | |
source_type* | string | [ HARDWARE, NETWORK, SERVICE, SECURITY, STAFF ] | Тип источника события |
source* | string | ID источника события | |
error_code | integer | Код ошибки |
{
"events": [
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 0
}
],
"count": 0
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns violations",
"parameters": [
{
"in": "query",
"name": "type",
"description": "Имя события",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "uuid",
"description": "Access point uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
}
},
{
"in": "query",
"name": "cursor",
"description": "Searching cursor",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "page_size",
"description": "Page size of violation events",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successfully returned violations",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"events": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"timestamp",
"type",
"reason",
"controller",
"source_type",
"source"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"description": "Event UUID"
},
"name": {
"type": "string",
"example": "ACCESS_MODE_CHANGED",
"description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
},
"timestamp": {
"type": "number",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n *`INFO` - Информационное сообщение\n *`WARN` - Предупреждение\n *`ALERT` - Тревога\n",
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT",
"EVENT"
]
},
"reason": {
"description": "Event description",
"type": "string"
},
"controller": {
"description": "Event producer",
"type": "string"
},
"source_type": {
"description": "Event source type",
"type": "string",
"enum": [
"HARDWARE",
"NETWORK",
"SERVICE",
"SECURITY",
"STAFF"
]
},
"source": {
"type": "string",
"description": "Source id"
},
"error_code": {
"type": "integer",
"description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
}
}
}
},
"count": {
"type": "integer"
}
}
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/alerts/violations?type=<type>&uuid=<uuid>" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"events": [
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 1.0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 1
}
],
"count": 1
}
GET /alerts/violations/by/point
Раздел: Тревоги.
Возвращает количество тревог на ТП, с параметрами, по UUID ТП
Назначение | URL запроса |
Возвращает количество тревог на ТП, с параметрами, по UUID ТП | https://{IP_контроллера}/api/v1/alerts/violations/by/point |
Параметры запроса:
Наименование | Описание |
type* string (query) uuid* string (query) page_size* string (query) cursor string (query) | Тип события тревоги [BREAK, HOLD, UNBLOCK] UUID точки прохода Количество записей на одной странице Номер строки следующего поиска |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ | UUID тревоги |
name | string | example: ACCESS_MODE_CHANGED | Имя события |
timestamp* | string | ($int64) | Временная метка события UNIX в миллисекундах |
type* | string | [ INFO, WARN, ALERT, EVENT ] | Тип события |
reason* | string | Описание причины события | |
controller* | string | Серийный номер контроллера, где настроена ТП | |
source_type* | string | [ HARDWARE, NETWORK, SERVICE, SECURITY, STAFF ] | Тип источника события |
source* | string | ID источника события | |
error_code | integer | Код ошибки |
Пример:
{
"events": [
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 0
}
],
"count": 0
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Новый метод возвращения тревожных событий связанных с тревожными уведомлениями",
"parameters": [
{
"in": "query",
"name": "type",
"description": "Имя события",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "uuid",
"description": "Access point uuid",
"required": true,
"schema": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
}
},
{
"in": "query",
"name": "page_size",
"description": "Page size of violation events",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "cursor",
"description": "Searching cursor",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successfully returned violations",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"events": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"timestamp",
"type",
"reason",
"controller",
"source_type",
"source"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"description": "Event UUID"
},
"name": {
"type": "string",
"example": "ACCESS_MODE_CHANGED",
"description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
},
"timestamp": {
"type": "number",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n *`INFO` - Информационное сообщение\n *`WARN` - Предупреждение\n *`ALERT` - Тревога\n",
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT",
"EVENT"
]
},
"reason": {
"description": "Event description",
"type": "string"
},
"controller": {
"description": "Event producer",
"type": "string"
},
"source_type": {
"description": "Event source type",
"type": "string",
"enum": [
"HARDWARE",
"NETWORK",
"SERVICE",
"SECURITY",
"STAFF"
]
},
"source": {
"type": "string",
"description": "Source id"
},
"error_code": {
"type": "integer",
"description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
}
}
}
},
"count": {
"type": "integer"
}
}
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/alerts/violations/by/point?type=<type>&uuid=<uuid>&page_size=<page_size>" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"events": [
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 1.0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 1
}
],
"count": 1
}
GET /alerts/violations/{name}
Раздел: Тревоги.
Возвращает количество тревог с параметрами по имени события
Назначение | URL запроса |
Возвращает количество тревог с параметрами по имени события | https://{IP_контроллера}/api/v1/alerts/violations/{name} |
Параметры запроса:
Наименование, * - обязательный | Описание |
name* string (path) cursor string (query) page_size* string (query) | Имя события Номер строки следующего поиска Количество записей на одной странице |
Варианты ответа:
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ | UUID тревоги |
name | string | example: ACCESS_MODE_CHANGED | Имя события |
timestamp* | string | ($int64) | Временная метка события UNIX в миллисекундах |
type* | string | [ INFO, WARN, ALERT, EVENT ] | Тип события |
reason* | string | Описание причины события | |
controller* | string | Серийный номер контроллера, где настроена ТП | |
source_type* | string | [ HARDWARE, NETWORK, SERVICE, SECURITY, STAFF ] | Тип источника события |
source* | string | ID источника события | |
error_code | integer | Код ошибки |
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"count": 0,
"events": [
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 0
}
]
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Returns violations",
"parameters": [
{
"in": "path",
"name": "name",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "cursor",
"description": "Searching cursor",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "page_size",
"description": "Page size of violation events",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successfully returned violations",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"events": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"timestamp",
"type",
"reason",
"controller",
"source_type",
"source"
],
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"description": "Event UUID"
},
"name": {
"type": "string",
"example": "ACCESS_MODE_CHANGED",
"description": "Имя события (полный список имен доступен по get запросу /notification_events/types)"
},
"timestamp": {
"type": "number",
"format": "int64",
"description": "Event UNIX timestamp in milliseconds"
},
"type": {
"description": "Тип события (полный список типов и причин доступен по get запросу /notification_events/types):\n *`INFO` - Информационное сообщение\n *`WARN` - Предупреждение\n *`ALERT` - Тревога\n",
"type": "string",
"enum": [
"INFO",
"WARN",
"ALERT",
"EVENT"
]
},
"reason": {
"description": "Event description",
"type": "string"
},
"controller": {
"description": "Event producer",
"type": "string"
},
"source_type": {
"description": "Event source type",
"type": "string",
"enum": [
"HARDWARE",
"NETWORK",
"SERVICE",
"SECURITY",
"STAFF"
]
},
"source": {
"type": "string",
"description": "Source id"
},
"error_code": {
"type": "integer",
"description": "Error code. For ALERT or WARN means which error occured. For INFO means which error corrected"
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X GET "https://{IP_контроллера}/api/v1/alerts/violations/{name}?page_size=<page_size>" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"count": 1,
"events": [
{
"uuid": "string",
"name": "ACCESS_MODE_CHANGED",
"timestamp": 1.0,
"type": "INFO",
"reason": "string",
"controller": "string",
"source_type": "HARDWARE",
"source": "string",
"error_code": 1
}
]
}
DELETE /alerts/{type}/{name}
Раздел: Тревоги.
Удаляет тревогу по типу и имени события
Назначение | URL запроса |
Удаляет тревогу по типу и имени события | https://{IP_контроллера}/api/v1/alerts/{type}/{name} |
Параметры запроса:
Название | Тип | Описание | |
type* name* | string (path) string (path) | Тип события Имя события | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
access_point_uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID точки прохода |
reason | string | Причина события | |
comment | string | Коментарий | |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Delete alert by type and name",
"parameters": [
{
"in": "path",
"name": "type",
"description": "Alert event types",
"required": true,
"schema": {
"type": "string",
"enum": [
"audit-alert",
"notification-alert"
]
}
},
{
"in": "path",
"name": "name",
"description": "Еvent name",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "Alert data",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"reason": {
"type": "string"
},
"comment": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "All alert have been successfully deleted",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X DELETE "https://{IP_контроллера}/api/v1/alerts/{type}/{name}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"reason": "string",
"comment": "string"
}'
Пример тела запроса
{
"uuid": "string",
"reason": "string",
"comment": "string"
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
DELETE /alerts/{uuid}
Раздел: Тревоги.
Удаляет тревожное событие по uuid
Назначение | URL запроса |
Удаляет тревожное событие по uuid | https://{IP_контроллера}/api/v1/alerts/{uuid} |
Параметры запроса:
Название | Тип | Описание | |
uuid* | string (path) | UUID события | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
access_point_uuid* | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID точки прохода |
type* | string | [INFO, WARN, ALERT ] | Тип события |
uuid | string | pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i | UUID события |
comment | string | Коментарий | |
Варианты ответа:
Code 200 (Successfully returned staff page) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Принятие тревоги связанной с точкой прохода",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"description": "Uuid оставлен для обратной совместимости. Не используется.",
"schema": {
"type": "string"
},
"example": "5c7d61c0-e01d-40d7-b247-0a865bd508f5"
}
],
"requestBody": {
"required": true,
"description": "Alert data",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"alert"
],
"properties": {
"alert": {
"type": "object",
"required": [
"access_point_uuid",
"type"
],
"properties": {
"access_point_uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"type": {
"type": "string"
},
"uuid": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
},
"comment": {
"type": "string"
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "All alert have been successfully deleted",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X DELETE "https://{IP_контроллера}/api/v1/alerts/{uuid}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"alert": {
"access_point_uuid": "string",
"type": "string",
"uuid": "string",
"comment": "string"
}
}'
Пример тела запроса
{
"alert": {
"access_point_uuid": "string",
"type": "string",
"uuid": "string",
"comment": "string"
}
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}