Сервис PUDS API 1.7.0
Методы API для работы с разделом «Сервис PUDS».
Базовый путь: https://{IP_контроллера}/api/v1.
Версия описания API: 1.7.0.
Примеры используют placeholder-значения для паролей, token, UUID, адресов и секретов. Перед выполнением запроса замените их на значения вашего контроллера.
Методы раздела
GET /puds_service
Раздел: Сервис PUDS.
Возвращает список всех настроенных PUDS сервисов
Назначение | URL запроса |
Возвращает список всех настроенных PUDS сервисов | https://{IP_контроллера}/api/v1/puds_service |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
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}$ | Уникальный идентификатор PUDS сервиса |
name* | string | example: PUDS Сервис | Название PUDS сервиса |
host* | string | example: puds-mpl-stage.mos.ru | Хост PUDS сервера |
clientId* | string | example: client-id | Идентификатор клиента |
clientSecret* | string | example: client-secret | Секретное значение клиента |
catalogPersonId* | number | example: 12345 | Идентификатор каталога персональных данных |
catalogObjectId* | number | example: 12345 | Идентификатор каталога объектов строительства |
catalogDeviceId* | number | example: 12345 | Идентификатор каталога оборудования СКУД |
catalogOrganizationId* | number | example: 12345 | Идентификатор каталога организаций трудоустройства |
kafkaTopic* | string | example: events-topic | Kafka топик для событий |
basePath* | string | example: /api/v1 | Базовый путь для API |
authBasePath* | string | example: /auth | Базовый путь для аутентификации |
controller* | string | Контроллер сервиса | |
namespace | string | example: puds-rb | Пространство имен для PUDS API |
active* | boolean | Активен ли сервис |
Пример:
[
{
"uuid": "string",
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"controller": "string",
"namespace": "puds-rb",
"active": true
}
]
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"summary": "Получить список PUDS сервисов",
"description": "Возвращает список всех настроенных PUDS сервисов",
"responses": {
"200": {
"description": "Список PUDS сервисов",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"uuid",
"name",
"host",
"clientId",
"clientSecret",
"catalogPersonId",
"catalogObjectId",
"catalogDeviceId",
"catalogOrganizationId",
"kafkaTopic",
"basePath",
"authBasePath",
"controller",
"active"
],
"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": "Уникальный идентификатор PUDS сервиса"
},
"name": {
"type": "string",
"description": "Название PUDS сервиса",
"example": "PUDS Сервис"
},
"host": {
"type": "string",
"description": "Хост PUDS сервера",
"example": "puds-mpl-stage.mos.ru"
},
"clientId": {
"type": "string",
"description": "Идентификатор клиента",
"example": "client-id"
},
"clientSecret": {
"type": "string",
"description": "Секрет клиента",
"example": "client-secret"
},
"catalogPersonId": {
"type": "number",
"description": "Идентификатор каталога персональных данных",
"example": 12345
},
"catalogObjectId": {
"type": "number",
"description": "Идентификатор каталога объектов строительства",
"example": 12346
},
"catalogDeviceId": {
"type": "number",
"description": "Идентификатор каталога оборудования СКУД",
"example": 12347
},
"catalogOrganizationId": {
"type": "number",
"description": "Идентификатор каталога организаций трудоустройства",
"example": 12348
},
"kafkaTopic": {
"type": "string",
"description": "Kafka топик для событий",
"example": "events-topic"
},
"basePath": {
"type": "string",
"description": "Базовый путь для API",
"example": "/api/v1"
},
"authBasePath": {
"type": "string",
"description": "Базовый путь для аутентификации",
"example": "/auth"
},
"controller": {
"type": "string",
"description": "Контроллер сервиса"
},
"namespace": {
"type": "string",
"description": "Namespace для PUDS API",
"example": "puds-rb"
},
"active": {
"type": "boolean",
"description": "Активен ли сервис"
}
}
}
}
}
}
},
"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/puds_service" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"uuid": "string",
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"controller": "string",
"namespace": "puds-rb",
"active": true
}
]
POST /puds_service
Раздел: Сервис PUDS.
Создает новый PUDS сервис
Назначение | URL запроса |
Создает новый PUDS сервис | https://{IP_контроллера}/api/v1/puds_service |
Параметры запроса:
Название | Тип | Описание | |
puds_service* | object(body) | Тело запроса | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
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}$ | Уникальный идентификатор PUDS сервиса |
name* | string | example: PUDS Сервис | Название PUDS сервиса |
host* | string | example: puds-mpl-stage.mos.ru | Хост PUDS сервера |
clientId* | string | example: client-id | Идентификатор клиента |
clientSecret* | string | example: client-secret | Секретное значение клиента |
catalogPersonId* | number | example: 12345 | Идентификатор каталога персональных данных |
catalogObjectId* | number | example: 12345 | Идентификатор каталога объектов строительства |
catalogDeviceId* | number | example: 12345 | Идентификатор каталога оборудования СКУД |
catalogOrganizationId* | number | example: 12345 | Идентификатор каталога организаций трудоустройства |
kafkaTopic* | string | example: events-topic | Kafka топик для событий |
basePath* | string | example: /api/v1 | Базовый путь для API |
authBasePath* | string | example: /auth | Базовый путь для аутентификации |
controller* | string | Контроллер сервиса | |
namespace | string | example: puds-rb | Пространство имен для PUDS API |
active* | boolean | Активен ли сервис | |
Пример:
URL запроса: POST
https://{IP_контроллера}/api/v1/puds_service
Body
{
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"uuid": "12345678-1234-1234-1234-123456789012",
"controller": "string",
"namespace": "puds-rb",
"active": true
}
Варианты ответа:
Code 201 (Successfully) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"summary": "Создать PUDS сервис",
"description": "Создает новый PUDS сервис",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"name",
"host",
"clientId",
"clientSecret",
"catalogPersonId",
"catalogObjectId",
"catalogDeviceId",
"catalogOrganizationId",
"kafkaTopic",
"basePath",
"authBasePath",
"uuid",
"controller",
"active"
],
"properties": {
"name": {
"type": "string",
"description": "Название PUDS сервиса",
"example": "PUDS Сервис"
},
"host": {
"type": "string",
"description": "Хост PUDS сервера",
"example": "puds-mpl-stage.mos.ru"
},
"clientId": {
"type": "string",
"description": "Идентификатор клиента",
"example": "client-id"
},
"clientSecret": {
"type": "string",
"description": "Секрет клиента",
"example": "client-secret"
},
"catalogPersonId": {
"type": "number",
"description": "Идентификатор каталога персональных данных",
"example": 12345
},
"catalogObjectId": {
"type": "number",
"description": "Идентификатор каталога объектов строительства",
"example": 12346
},
"catalogDeviceId": {
"type": "number",
"description": "Идентификатор каталога оборудования СКУД",
"example": 12347
},
"catalogOrganizationId": {
"type": "number",
"description": "Идентификатор каталога организаций трудоустройства",
"example": 12348
},
"kafkaTopic": {
"type": "string",
"description": "Kafka топик для событий",
"example": "events-topic"
},
"basePath": {
"type": "string",
"description": "Базовый путь для API",
"example": "/api/v1"
},
"authBasePath": {
"type": "string",
"description": "Базовый путь для аутентификации",
"example": "/auth"
},
"uuid": {
"type": "string",
"description": "UUID сервиса",
"example": "12345678-1234-1234-1234-123456789012"
},
"controller": {
"type": "string",
"description": "Контроллер сервиса"
},
"namespace": {
"type": "string",
"description": "Namespace для PUDS API",
"example": "puds-rb"
},
"active": {
"type": "boolean",
"description": "Активен ли сервис"
}
}
}
}
}
},
"responses": {
"201": {
"description": "PUDS сервис создан успешно",
"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 POST "https://{IP_контроллера}/api/v1/puds_service" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"uuid": "12345678-1234-1234-1234-123456789012",
"controller": "string",
"namespace": "puds-rb",
"active": true
}'
Пример тела запроса
{
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"uuid": "12345678-1234-1234-1234-123456789012",
"controller": "string",
"namespace": "puds-rb",
"active": true
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /puds_service/access_point
Раздел: Сервис PUDS.
Возвращает список точек доступа PUDS
Назначение | URL запроса |
Возвращает список точек доступа PUDS | https://{IP_контроллера}/api/v1/puds_service/access_point |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
uuid* | string | Уникальный идентификатор точки прохода | |
name* | string | Название точки прохода | |
access_points* | string | Список UUID точек прохода | |
service_uuid* | string | Уникальный идентификатор сервиса PUDS | |
uin* | string | Учетный идентификационный номер (УИН) объекта строительства | |
objName* | string | Наименование объекта строительства | |
ad* | string | Адрес объекта строительства | |
orgInn* | integer | ИНН организации | |
kpp* | integer | КПП организации | |
date_s* | integer | Дата начала строительства (timestamp) | |
date_device_start* | integer | Дата начала работы устройства (timestamp) | |
controller* | string | Контроллер сервиса | |
mac_adr* | string | pattern: ^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$|^([0-9A-Fa-f]{4}\.){2}[0-9A-Fa-f]{4}$|^[0-9A-Fa-f]{12}$ | MAC-адрес устройства |
Пример:
[
{
"uuid": "string",
"name": "string",
"access_points": [
"string"
],
"service_uuid": "string",
"uin": "string",
"objName": "string",
"ad": "string",
"orgInn": 0,
"kpp": 0,
"date_s": 0,
"date_device_start": 0,
"controller": "string",
"mac_adr": "string"
}
]
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Возвращает список точек доступа PUDS",
"responses": {
"200": {
"description": "Список точек доступа успешно возвращен",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": [
"access_points",
"name",
"uuid",
"service_uuid",
"uin",
"objName",
"ad",
"orgInn",
"kpp",
"date_s",
"date_device_start",
"controller",
"mac_adr"
],
"properties": {
"uuid": {
"type": "string",
"description": "Уникальный идентификатор точки прохода."
},
"name": {
"type": "string",
"description": "Название точки прохода."
},
"access_points": {
"type": "array",
"items": {
"type": "string"
},
"description": "Список UUID точек прохода."
},
"service_uuid": {
"type": "string",
"description": "Уникальный идентификатор сервиса PUDS."
},
"uin": {
"type": "string",
"description": "Учетный идентификационный номер (УИН) объекта строительства."
},
"objName": {
"type": "string",
"description": "Наименование объекта строительства."
},
"ad": {
"type": "string",
"description": "Адрес объекта строительства."
},
"orgInn": {
"type": "integer",
"description": "ИНН организации."
},
"kpp": {
"type": "integer",
"description": "КПП организации."
},
"date_s": {
"type": "integer",
"description": "Дата начала строительства (timestamp)."
},
"date_device_start": {
"type": "integer",
"description": "Дата начала работы устройства (timestamp)."
},
"controller": {
"type": "string",
"description": "Контроллер сервиса."
},
"mac_adr": {
"type": "string",
"description": "MAC адрес устройства.",
"pattern": "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$|^([0-9A-Fa-f]{4}\\.){2}[0-9A-Fa-f]{4}$|^[0-9A-Fa-f]{12}$"
}
}
}
}
}
}
},
"400": {
"description": "Неверный запрос",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Что-то пошло не так. Похоже, на сервере ошибка",
"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/puds_service/access_point" \
-H "Authorization: Bearer <token>"
Пример ответа
[
{
"uuid": "string",
"name": "string",
"access_points": [
"string"
],
"service_uuid": "string",
"uin": "string",
"objName": "string",
"ad": "string",
"orgInn": 1,
"kpp": 1,
"date_s": 1,
"date_device_start": 1,
"controller": "string",
"mac_adr": "string"
}
]
POST /puds_service/access_point
Раздел: Сервис PUDS.
Создает новую точку доступа PUDS
Назначение | URL запроса |
Создает новую точку доступа PUDS | https://{IP_контроллера}/api/v1/puds_service/access_point |
Параметры запроса:
Название | Тип | Описание | |
access_point* | object(body) | Тело запроса | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid* | string | Уникальный идентификатор точки прохода | |
name* | string | Название точки прохода | |
access_points* | string | Список UUID точек прохода | |
service_uuid* | string | Уникальный идентификатор сервиса PUDS | |
uin* | string | Учетный идентификационный номер (УИН) объекта строительства | |
objName* | string | Наименование объекта строительства | |
ad* | string | Адрес объекта строительства | |
orgInn* | integer | ИНН организации | |
kpp* | integer | КПП организации | |
date_s* | integer | Дата начала строительства (timestamp) | |
date_device_start* | integer | Дата начала работы устройства (timestamp) | |
controller* | string | Контроллер сервиса | |
mac_adr* | string | pattern: ^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$|^([0-9A-Fa-f]{4}\.){2}[0-9A-Fa-f]{4}$|^[0-9A-Fa-f]{12}$ | MAC-адрес устройства |
Пример:
URL запроса: POST
https://{IP_контроллера}/api/v1/puds_service/access_point
Body
Пример с исправленным синтаксисом JSON
Добавлена закрывающая фигурная скобка; поля и типы не менялись.
{
"uuid": "string",
"name": "string",
"access_points": [
"string"
],
"service_uuid": "string",
"uin": "string",
"objName": "string",
"ad": "string",
"orgInn": 0,
"kpp": 0,
"date_s": 0,
"date_device_start": 0,
"controller": "string",
"mac_adr": "string"
}
Исходный пример Teamly
Пример из Teamly сохранён дословно, но не является корректным JSON.
{
"uuid": "string",
"name": "string",
"access_points": [
"string"
],
"service_uuid": "string",
"uin": "string",
"objName": "string",
"ad": "string",
"orgInn": 0,
"kpp": 0,
"date_s": 0,
"date_device_start": 0,
"controller": "string",
"mac_adr": "string"
Варианты ответа:
Code 201 (Successfully) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 409 (Access point with specified uuid already exists) - запрос не выполнен, точка доступа с таким именем уже добавлена
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Создает новую точку доступа PUDS",
"requestBody": {
"description": "Настройка новой точки доступа PUDS в базе данных",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"access_points",
"name",
"uuid",
"service_uuid",
"uin",
"objName",
"ad",
"orgInn",
"kpp",
"date_s",
"date_device_start",
"controller",
"mac_adr"
],
"properties": {
"uuid": {
"type": "string",
"description": "Уникальный идентификатор точки прохода."
},
"name": {
"type": "string",
"description": "Название точки прохода."
},
"access_points": {
"type": "array",
"items": {
"type": "string"
},
"description": "Список UUID точек прохода."
},
"service_uuid": {
"type": "string",
"description": "Уникальный идентификатор сервиса PUDS."
},
"uin": {
"type": "string",
"description": "Учетный идентификационный номер (УИН) объекта строительства."
},
"objName": {
"type": "string",
"description": "Наименование объекта строительства."
},
"ad": {
"type": "string",
"description": "Адрес объекта строительства."
},
"orgInn": {
"type": "integer",
"description": "ИНН организации."
},
"kpp": {
"type": "integer",
"description": "КПП организации."
},
"date_s": {
"type": "integer",
"description": "Дата начала строительства (timestamp)."
},
"date_device_start": {
"type": "integer",
"description": "Дата начала работы устройства (timestamp)."
},
"controller": {
"type": "string",
"description": "Контроллер сервиса."
},
"mac_adr": {
"type": "string",
"description": "MAC адрес устройства.",
"pattern": "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$|^([0-9A-Fa-f]{4}\\.){2}[0-9A-Fa-f]{4}$|^[0-9A-Fa-f]{12}$"
}
}
}
}
}
},
"responses": {
"201": {
"description": "Точка доступа успешно добавлена",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Неверный запрос",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"409": {
"description": "Точка доступа уже существует",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Что-то пошло не так. Похоже, на сервере ошибка",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X POST "https://{IP_контроллера}/api/v1/puds_service/access_point" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"name": "string",
"access_points": [
"string"
],
"service_uuid": "string",
"uin": "string",
"objName": "string",
"ad": "string",
"orgInn": 1,
"kpp": 1,
"date_s": 1,
"date_device_start": 1,
"controller": "string",
"mac_adr": "string"
}'
Пример тела запроса
{
"uuid": "string",
"name": "string",
"access_points": [
"string"
],
"service_uuid": "string",
"uin": "string",
"objName": "string",
"ad": "string",
"orgInn": 1,
"kpp": 1,
"date_s": 1,
"date_device_start": 1,
"controller": "string",
"mac_adr": "string"
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
PUT /puds_service/access_point/{uuid}
Раздел: Сервис PUDS.
Обновляет точку доступа PUDS
Назначение | URL запроса |
Обновляет точку доступа PUDS | https://{IP_контроллера}/api/v1/puds_service/access_point/{uuid} |
Параметры запроса:
Название | Тип | Описание | |
uuid* | string($uuid)(path) | UUID точки прохода | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
uuid* | string | Уникальный идентификатор точки прохода | |
name* | string | Название точки прохода | |
access_points* | string | Список UUID точек прохода | |
service_uuid* | string | Уникальный идентификатор сервиса PUDS | |
uin* | string | Учетный идентификационный номер (УИН) объекта строительства | |
objName* | string | Наименование объекта строительства | |
ad* | string | Адрес объекта строительства | |
orgInn* | integer | ИНН организации | |
kpp* | integer | КПП организации | |
date_s* | integer | Дата начала строительства (timestamp) | |
date_device_start* | integer | Дата начала работы устройства (timestamp) | |
controller* | string | Контроллер сервиса | |
mac_adr* | string | pattern: ^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$|^([0-9A-Fa-f]{4}\.){2}[0-9A-Fa-f]{4}$|^[0-9A-Fa-f]{12}$ | MAC-адрес устройства |
Пример:
URL запроса: PUT
https://{IP_контроллера}/api/v1/puds_service/access_point/{uuid}
Body
{
"uuid": "string",
"name": "string",
"access_points": [
"string"
],
"service_uuid": "string",
"uin": "string",
"objName": "string",
"ad": "string",
"orgInn": 0,
"kpp": 0,
"date_s": 0,
"date_device_start": 0,
"controller": "string",
"mac_adr": "string"
}
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Specified access point does not exist) - запрос не выполнен, указанная точка доступа не существует
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Обновить точку доступа PUDS",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"description": "Обновление точки доступа PUDS в базе данных",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"access_points",
"name",
"uuid",
"service_uuid",
"uin",
"objName",
"ad",
"orgInn",
"kpp",
"date_s",
"date_device_start",
"controller",
"mac_adr"
],
"properties": {
"uuid": {
"type": "string",
"description": "Уникальный идентификатор точки прохода."
},
"name": {
"type": "string",
"description": "Название точки прохода."
},
"access_points": {
"type": "array",
"items": {
"type": "string"
},
"description": "Список UUID точек прохода."
},
"service_uuid": {
"type": "string",
"description": "Уникальный идентификатор сервиса PUDS."
},
"uin": {
"type": "string",
"description": "Учетный идентификационный номер (УИН) объекта строительства."
},
"objName": {
"type": "string",
"description": "Наименование объекта строительства."
},
"ad": {
"type": "string",
"description": "Адрес объекта строительства."
},
"orgInn": {
"type": "integer",
"description": "ИНН организации."
},
"kpp": {
"type": "integer",
"description": "КПП организации."
},
"date_s": {
"type": "integer",
"description": "Дата начала строительства (timestamp)."
},
"date_device_start": {
"type": "integer",
"description": "Дата начала работы устройства (timestamp)."
},
"controller": {
"type": "string",
"description": "Контроллер сервиса."
},
"mac_adr": {
"type": "string",
"description": "MAC адрес устройства.",
"pattern": "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$|^([0-9A-Fa-f]{4}\\.){2}[0-9A-Fa-f]{4}$|^[0-9A-Fa-f]{12}$"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Точка доступа успешно обновлена",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Неверный запрос",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Точка доступа не существует",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Что-то пошло не так. Похоже, на сервере ошибка",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X PUT "https://{IP_контроллера}/api/v1/puds_service/access_point/{uuid}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"uuid": "string",
"name": "string",
"access_points": [
"string"
],
"service_uuid": "string",
"uin": "string",
"objName": "string",
"ad": "string",
"orgInn": 1,
"kpp": 1,
"date_s": 1,
"date_device_start": 1,
"controller": "string",
"mac_adr": "string"
}'
Пример тела запроса
{
"uuid": "string",
"name": "string",
"access_points": [
"string"
],
"service_uuid": "string",
"uin": "string",
"objName": "string",
"ad": "string",
"orgInn": 1,
"kpp": 1,
"date_s": 1,
"date_device_start": 1,
"controller": "string",
"mac_adr": "string"
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
DELETE /puds_service/access_point/{uuid}
Раздел: Сервис PUDS.
Удаляет точку доступа PUDS
Назначение | URL запроса |
Удаляет точку доступа PUDS | https://{IP_контроллера}/api/v1/puds_service/access_point/{uuid} |
Параметры запроса:
Наименование, * - обязательный | Описание |
uuid* string($uuid) (path) | UUID точки доступа |
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 404 (Access pointr with specified uuid was not found) - запрос не выполнен, точка доступа, указанная в {uuid} не найдена
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"description": "Удалить точку доступа PUDS",
"parameters": [
{
"in": "path",
"name": "uuid",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Точка доступа успешно удалена",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Неверный запрос",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"404": {
"description": "Точка доступа не существует",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Что-то пошло не так. Похоже, на сервере ошибка",
"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/puds_service/access_point/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
GET /puds_service/queue-stats
Раздел: Сервис PUDS.
Возвращает статистику очереди событий КПП для отправки в реестр строителей
Назначение | URL запроса |
Возвращает статистику очереди событий КПП для отправки в реестр строителей | https://{IP_контроллера}/api/v1/puds_service/queue-stats |
Параметры запроса:
Отсутствуют
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
success | boolean | Успех выполнения запроса | |
message | string | Информационное сообщение | |
stats | { | Статистика | |
initialized | boolean | Инициализирован ли обработчик событий | |
queueLength | integer | Количество событий в очереди | |
mappedAccessPoints | integer | Количество точек прохода с PUDS маппингом | |
periodicSendingActive | boolean | Активна ли периодическая отправка | |
} |
Пример:
{
"success": true,
"message": "",
"stats": {
"initialized": true,
"queueLength": 42,
"mappedAccessPoints": 5,
"periodicSendingActive": true
}
}
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"summary": "Получить статистику очереди событий PUDS",
"description": "Возвращает статистику очереди событий КПП для отправки в реестр строителей",
"responses": {
"200": {
"description": "Статистика очереди событий PUDS",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": true
},
"message": {
"type": "string",
"example": ""
},
"stats": {
"type": "object",
"properties": {
"initialized": {
"type": "boolean",
"description": "Инициализирован ли обработчик событий",
"example": true
},
"queueLength": {
"type": "integer",
"description": "Количество событий в очереди",
"example": 42
},
"mappedAccessPoints": {
"type": "integer",
"description": "Количество точек прохода с PUDS маппингом",
"example": 5
},
"periodicSendingActive": {
"type": "boolean",
"description": "Активна ли периодическая отправка",
"example": true
}
}
}
}
}
}
}
},
"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/puds_service/queue-stats" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": true,
"message": "",
"stats": {
"initialized": true,
"queueLength": 42,
"mappedAccessPoints": 5,
"periodicSendingActive": true
}
}
POST /puds_service/send-queue
Раздел: Сервис PUDS.
Принудительно запускает отправку событий КПП из Redis очереди в реестр строителей (для тестирования)
Назначение | URL запроса |
Принудительно запускает отправку событий КПП из Redis очереди в реестр строителей (для тестирования) | https://{IP_контроллера}/api/v1/puds_service/send-queue |
Параметры запроса:
Отсутствуют
Пример:
URL запроса: POST
https://{IP_контроллера}/api/v1/puds_service/send-queue
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
{
"success": true,
"message": "Events sending triggered successfully"
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"summary": "Принудительно отправить события из очереди",
"description": "Принудительно запускает отправку событий КПП из Redis очереди в реестр строителей (для тестирования)",
"responses": {
"200": {
"description": "Отправка событий запущена успешно",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": true
},
"message": {
"type": "string",
"example": "Events sending triggered successfully"
}
}
}
}
}
},
"400": {
"description": "Обработчик событий не инициализирован",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string",
"example": "PUDS events handler not initialized"
}
}
}
}
}
},
"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 POST "https://{IP_контроллера}/api/v1/puds_service/send-queue" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": true,
"message": "Events sending triggered successfully"
}
POST /puds_service/upload-data
Раздел: Сервис PUDS.
Выполняет полную синхронизацию всех справочников реестра строителей
Назначение | URL запроса |
Выполняет полную синхронизацию всех справочников реестра строителей | https://{IP_контроллера}/api/v1/puds_service/upload-data |
Параметры запроса:
Отсутствуют
Пример:
URL запроса: POST
https://{IP_контроллера}/api/v1/puds_service/upload-data
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
Название, * - обязательный | Тип | Формат | Назначение |
success | boolean | Успех выполнения запроса | |
synchronized | boolean | Флаг полной синхронизации справочников | |
deleted | integer | Количество записей по типам, помеченных как удаленные | |
uploaded | integer | Количество успешно загруженных записей | |
validation | integer | Детальная информация о валидации данных | |
summary | integer | Общая сводка по операции |
{
"success": true,
"synchronized": true,
"deleted": {
"deletedPersonData": 10,
"deletedOrganizationData": 2,
"deletedConstructionObjectData": 3,
"deletedEquipmentData": 5
},
"uploaded": {
"uploadedPersonData": 15,
"uploadedOrganizationData": 3,
"uploadedConstructionObjectData": 5,
"uploadedEquipmentData": 8
},
"validation": {
"totalRecordsProcessed": 35,
"totalValidRecords": 31,
"totalInvalidRecords": 4,
"totalStructureErrors": 0,
"totalValueErrors": 4,
"typeBreakdown": {
"personData": {
"total": 20,
"valid": 18,
"invalid": 2,
"structureErrors": 0,
"valueErrors": 2,
"canSend": true,
"errorDetails": [
{
"type": "value",
"field": "uin",
"fieldNameRu": "УИН объекта строительства",
"message": "Required field 'uin' is empty or invalid",
"messageRu": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")",
"recordIndex": 5,
"uuid": "abc-123-def-456",
"entityType": "Сотрудник"
}
]
},
"organizationData": {
"total": 20,
"valid": 18,
"invalid": 2,
"structureErrors": 0,
"valueErrors": 2,
"canSend": true,
"errorDetails": [
{
"type": "value",
"field": "uin",
"fieldNameRu": "УИН объекта строительства",
"message": "Required field 'uin' is empty or invalid",
"messageRu": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")",
"recordIndex": 5,
"uuid": "abc-123-def-456",
"entityType": "Сотрудник"
}
]
},
"constructionObjectData": {
"total": 20,
"valid": 18,
"invalid": 2,
"structureErrors": 0,
"valueErrors": 2,
"canSend": true,
"errorDetails": [
{
"type": "value",
"field": "uin",
"fieldNameRu": "УИН объекта строительства",
"message": "Required field 'uin' is empty or invalid",
"messageRu": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")",
"recordIndex": 5,
"uuid": "abc-123-def-456",
"entityType": "Сотрудник"
}
]
},
"equipmentData": {
"total": 20,
"valid": 18,
"invalid": 2,
"structureErrors": 0,
"valueErrors": 2,
"canSend": true,
"errorDetails": [
{
"type": "value",
"field": "uin",
"fieldNameRu": "УИН объекта строительства",
"message": "Required field 'uin' is empty or invalid",
"messageRu": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")",
"recordIndex": 5,
"uuid": "abc-123-def-456",
"entityType": "Сотрудник"
}
]
}
}
},
"summary": {
"totalDeleted": 20,
"totalUploaded": 31,
"validationSuccess": true,
"recordsSkipped": 4
}
}
Code 400 (Bad request parameters) - запрос не выполнен, неверно указаны параметры запроса
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"summary": "Загрузить все данные в реестр строителей",
"description": "Выполняет полную синхронизацию всех справочников реестра строителей:\n- Собирает данные сотрудников, организаций, объектов строительства и оборудования\n- Валидирует данные на соответствие требованиям PUDS API\n- Помечает существующие записи как удаленные\n- Загружает только валидные новые записи\n- Возвращает детальную информацию о процессе валидации и загрузки\n",
"responses": {
"200": {
"description": "Операция синхронизации выполнена успешно",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "Статус выполнения операции",
"example": true
},
"synchronized": {
"type": "boolean",
"description": "Флаг полной синхронизации справочников",
"example": true
},
"deleted": {
"type": "object",
"description": "Количество записей, помеченных как удаленные",
"properties": {
"deletedPersonData": {
"type": "integer",
"description": "Удаленных записей персональных данных",
"example": 10
},
"deletedOrganizationData": {
"type": "integer",
"description": "Удаленных записей организаций",
"example": 2
},
"deletedConstructionObjectData": {
"type": "integer",
"description": "Удаленных записей объектов строительства",
"example": 3
},
"deletedEquipmentData": {
"type": "integer",
"description": "Удаленных записей оборудования",
"example": 5
}
}
},
"uploaded": {
"type": "object",
"description": "Количество успешно загруженных записей",
"properties": {
"uploadedPersonData": {
"type": "integer",
"description": "Загружено записей персональных данных",
"example": 15
},
"uploadedOrganizationData": {
"type": "integer",
"description": "Загружено записей организаций",
"example": 3
},
"uploadedConstructionObjectData": {
"type": "integer",
"description": "Загружено записей объектов строительства",
"example": 5
},
"uploadedEquipmentData": {
"type": "integer",
"description": "Загружено записей оборудования",
"example": 8
}
}
},
"validation": {
"type": "object",
"description": "Детальная информация о валидации данных",
"properties": {
"totalRecordsProcessed": {
"type": "integer",
"description": "Общее количество обработанных записей",
"example": 35
},
"totalValidRecords": {
"type": "integer",
"description": "Общее количество валидных записей",
"example": 31
},
"totalInvalidRecords": {
"type": "integer",
"description": "Общее количество невалидных записей",
"example": 4
},
"totalStructureErrors": {
"type": "integer",
"description": "Количество критических ошибок структуры (останавливают загрузку)",
"example": 0
},
"totalValueErrors": {
"type": "integer",
"description": "Количество ошибок значений (записи пропускаются)",
"example": 4
},
"typeBreakdown": {
"type": "object",
"description": "Детальная разбивка валидации по типам данных",
"properties": {
"personData": {
"type": "object",
"description": "Детали валидации для конкретного типа данных",
"properties": {
"total": {
"type": "integer",
"description": "Всего записей данного типа",
"example": 20
},
"valid": {
"type": "integer",
"description": "Валидных записей",
"example": 18
},
"invalid": {
"type": "integer",
"description": "Невалидных записей",
"example": 2
},
"structureErrors": {
"type": "integer",
"description": "Ошибок структуры",
"example": 0
},
"valueErrors": {
"type": "integer",
"description": "Ошибок значений",
"example": 2
},
"canSend": {
"type": "boolean",
"description": "Можно ли отправлять данные (нет критических ошибок)",
"example": true
},
"errorDetails": {
"type": "array",
"description": "Детальный список ошибок",
"items": {
"type": "object",
"description": "Информация об ошибке валидации",
"properties": {
"type": {
"type": "string",
"description": "Тип ошибки (structure/value)",
"enum": [
"structure",
"value"
],
"example": "value"
},
"field": {
"type": "string",
"description": "Название поля с ошибкой",
"example": "uin"
},
"fieldNameRu": {
"type": "string",
"description": "Русское название поля",
"example": "УИН объекта строительства"
},
"message": {
"type": "string",
"description": "Английское сообщение об ошибке",
"example": "Required field 'uin' is empty or invalid"
},
"messageRu": {
"type": "string",
"description": "Русское сообщение об ошибке",
"example": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")"
},
"recordIndex": {
"type": "integer",
"description": "Индекс записи с ошибкой",
"example": 5
},
"uuid": {
"type": "string",
"description": "UUID сотрудника/записи с ошибкой",
"example": "abc-123-def-456"
},
"entityType": {
"type": "string",
"description": "Тип сущности на русском языке",
"example": "Сотрудник"
}
}
}
}
}
},
"organizationData": {
"type": "object",
"description": "Детали валидации для конкретного типа данных",
"properties": {
"total": {
"type": "integer",
"description": "Всего записей данного типа",
"example": 20
},
"valid": {
"type": "integer",
"description": "Валидных записей",
"example": 18
},
"invalid": {
"type": "integer",
"description": "Невалидных записей",
"example": 2
},
"structureErrors": {
"type": "integer",
"description": "Ошибок структуры",
"example": 0
},
"valueErrors": {
"type": "integer",
"description": "Ошибок значений",
"example": 2
},
"canSend": {
"type": "boolean",
"description": "Можно ли отправлять данные (нет критических ошибок)",
"example": true
},
"errorDetails": {
"type": "array",
"description": "Детальный список ошибок",
"items": {
"type": "object",
"description": "Информация об ошибке валидации",
"properties": {
"type": {
"type": "string",
"description": "Тип ошибки (structure/value)",
"enum": [
"structure",
"value"
],
"example": "value"
},
"field": {
"type": "string",
"description": "Название поля с ошибкой",
"example": "uin"
},
"fieldNameRu": {
"type": "string",
"description": "Русское название поля",
"example": "УИН объекта строительства"
},
"message": {
"type": "string",
"description": "Английское сообщение об ошибке",
"example": "Required field 'uin' is empty or invalid"
},
"messageRu": {
"type": "string",
"description": "Русское сообщение об ошибке",
"example": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")"
},
"recordIndex": {
"type": "integer",
"description": "Индекс записи с ошибкой",
"example": 5
},
"uuid": {
"type": "string",
"description": "UUID сотрудника/записи с ошибкой",
"example": "abc-123-def-456"
},
"entityType": {
"type": "string",
"description": "Тип сущности на русском языке",
"example": "Сотрудник"
}
}
}
}
}
},
"constructionObjectData": {
"type": "object",
"description": "Детали валидации для конкретного типа данных",
"properties": {
"total": {
"type": "integer",
"description": "Всего записей данного типа",
"example": 20
},
"valid": {
"type": "integer",
"description": "Валидных записей",
"example": 18
},
"invalid": {
"type": "integer",
"description": "Невалидных записей",
"example": 2
},
"structureErrors": {
"type": "integer",
"description": "Ошибок структуры",
"example": 0
},
"valueErrors": {
"type": "integer",
"description": "Ошибок значений",
"example": 2
},
"canSend": {
"type": "boolean",
"description": "Можно ли отправлять данные (нет критических ошибок)",
"example": true
},
"errorDetails": {
"type": "array",
"description": "Детальный список ошибок",
"items": {
"type": "object",
"description": "Информация об ошибке валидации",
"properties": {
"type": {
"type": "string",
"description": "Тип ошибки (structure/value)",
"enum": [
"structure",
"value"
],
"example": "value"
},
"field": {
"type": "string",
"description": "Название поля с ошибкой",
"example": "uin"
},
"fieldNameRu": {
"type": "string",
"description": "Русское название поля",
"example": "УИН объекта строительства"
},
"message": {
"type": "string",
"description": "Английское сообщение об ошибке",
"example": "Required field 'uin' is empty or invalid"
},
"messageRu": {
"type": "string",
"description": "Русское сообщение об ошибке",
"example": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")"
},
"recordIndex": {
"type": "integer",
"description": "Индекс записи с ошибкой",
"example": 5
},
"uuid": {
"type": "string",
"description": "UUID сотрудника/записи с ошибкой",
"example": "abc-123-def-456"
},
"entityType": {
"type": "string",
"description": "Тип сущности на русском языке",
"example": "Сотрудник"
}
}
}
}
}
},
"equipmentData": {
"type": "object",
"description": "Детали валидации для конкретного типа данных",
"properties": {
"total": {
"type": "integer",
"description": "Всего записей данного типа",
"example": 20
},
"valid": {
"type": "integer",
"description": "Валидных записей",
"example": 18
},
"invalid": {
"type": "integer",
"description": "Невалидных записей",
"example": 2
},
"structureErrors": {
"type": "integer",
"description": "Ошибок структуры",
"example": 0
},
"valueErrors": {
"type": "integer",
"description": "Ошибок значений",
"example": 2
},
"canSend": {
"type": "boolean",
"description": "Можно ли отправлять данные (нет критических ошибок)",
"example": true
},
"errorDetails": {
"type": "array",
"description": "Детальный список ошибок",
"items": {
"type": "object",
"description": "Информация об ошибке валидации",
"properties": {
"type": {
"type": "string",
"description": "Тип ошибки (structure/value)",
"enum": [
"structure",
"value"
],
"example": "value"
},
"field": {
"type": "string",
"description": "Название поля с ошибкой",
"example": "uin"
},
"fieldNameRu": {
"type": "string",
"description": "Русское название поля",
"example": "УИН объекта строительства"
},
"message": {
"type": "string",
"description": "Английское сообщение об ошибке",
"example": "Required field 'uin' is empty or invalid"
},
"messageRu": {
"type": "string",
"description": "Русское сообщение об ошибке",
"example": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")"
},
"recordIndex": {
"type": "integer",
"description": "Индекс записи с ошибкой",
"example": 5
},
"uuid": {
"type": "string",
"description": "UUID сотрудника/записи с ошибкой",
"example": "abc-123-def-456"
},
"entityType": {
"type": "string",
"description": "Тип сущности на русском языке",
"example": "Сотрудник"
}
}
}
}
}
}
}
}
}
},
"summary": {
"type": "object",
"description": "Общая сводка по операции",
"properties": {
"totalDeleted": {
"type": "integer",
"description": "Всего удалено записей",
"example": 20
},
"totalUploaded": {
"type": "integer",
"description": "Всего загружено записей",
"example": 31
},
"validationSuccess": {
"type": "boolean",
"description": "Успешность валидации (нет критических ошибок)",
"example": true
},
"recordsSkipped": {
"type": "integer",
"description": "Количество пропущенных записей из-за ошибок",
"example": 4
}
}
}
}
}
}
}
},
"400": {
"description": "PUDS сервис не настроен или неактивен",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Ошибка валидации или загрузки данных",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
},
"validation": {
"type": "object",
"description": "Краткая сводка по валидации",
"properties": {
"total": {
"type": "integer",
"description": "Всего записей",
"example": 20
},
"valid": {
"type": "integer",
"description": "Валидных записей",
"example": 15
},
"invalid": {
"type": "integer",
"description": "Невалидных записей",
"example": 5
},
"structureErrors": {
"type": "integer",
"description": "Критических ошибок структуры",
"example": 2
},
"valueErrors": {
"type": "integer",
"description": "Ошибок значений",
"example": 3
},
"canSend": {
"type": "boolean",
"description": "Возможность отправки данных",
"example": false
},
"errorDetails": {
"type": "array",
"items": {
"type": "object",
"description": "Информация об ошибке валидации",
"properties": {
"type": {
"type": "string",
"description": "Тип ошибки (structure/value)",
"enum": [
"structure",
"value"
],
"example": "value"
},
"field": {
"type": "string",
"description": "Название поля с ошибкой",
"example": "uin"
},
"fieldNameRu": {
"type": "string",
"description": "Русское название поля",
"example": "УИН объекта строительства"
},
"message": {
"type": "string",
"description": "Английское сообщение об ошибке",
"example": "Required field 'uin' is empty or invalid"
},
"messageRu": {
"type": "string",
"description": "Русское сообщение об ошибке",
"example": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")"
},
"recordIndex": {
"type": "integer",
"description": "Индекс записи с ошибкой",
"example": 5
},
"uuid": {
"type": "string",
"description": "UUID сотрудника/записи с ошибкой",
"example": "abc-123-def-456"
},
"entityType": {
"type": "string",
"description": "Тип сущности на русском языке",
"example": "Сотрудник"
}
}
}
}
}
}
}
}
}
}
}
}
}
Примеры по OpenAPI
Сформированы по схеме контроллера; значения полей необходимо заменить.
Пример запроса
curl -k -X POST "https://{IP_контроллера}/api/v1/puds_service/upload-data" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": true,
"synchronized": true,
"deleted": {
"deletedPersonData": 10,
"deletedOrganizationData": 2,
"deletedConstructionObjectData": 3,
"deletedEquipmentData": 5
},
"uploaded": {
"uploadedPersonData": 15,
"uploadedOrganizationData": 3,
"uploadedConstructionObjectData": 5,
"uploadedEquipmentData": 8
},
"validation": {
"totalRecordsProcessed": 35,
"totalValidRecords": 31,
"totalInvalidRecords": 4,
"totalStructureErrors": 0,
"totalValueErrors": 4,
"typeBreakdown": {
"personData": {
"total": 20,
"valid": 18,
"invalid": 2,
"structureErrors": 0,
"valueErrors": 2,
"canSend": true,
"errorDetails": [
{
"type": "value",
"field": "uin",
"fieldNameRu": "УИН объекта строительства",
"message": "Required field 'uin' is empty or invalid",
"messageRu": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")",
"recordIndex": 5,
"uuid": "abc-123-def-456",
"entityType": "Сотрудник"
}
]
},
"organizationData": {
"total": 20,
"valid": 18,
"invalid": 2,
"structureErrors": 0,
"valueErrors": 2,
"canSend": true,
"errorDetails": [
{
"type": "value",
"field": "uin",
"fieldNameRu": "УИН объекта строительства",
"message": "Required field 'uin' is empty or invalid",
"messageRu": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")",
"recordIndex": 5,
"uuid": "abc-123-def-456",
"entityType": "Сотрудник"
}
]
},
"constructionObjectData": {
"total": 20,
"valid": 18,
"invalid": 2,
"structureErrors": 0,
"valueErrors": 2,
"canSend": true,
"errorDetails": [
{
"type": "value",
"field": "uin",
"fieldNameRu": "УИН объекта строительства",
"message": "Required field 'uin' is empty or invalid",
"messageRu": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")",
"recordIndex": 5,
"uuid": "abc-123-def-456",
"entityType": "Сотрудник"
}
]
},
"equipmentData": {
"total": 20,
"valid": 18,
"invalid": 2,
"structureErrors": 0,
"valueErrors": 2,
"canSend": true,
"errorDetails": [
{
"type": "value",
"field": "uin",
"fieldNameRu": "УИН объекта строительства",
"message": "Required field 'uin' is empty or invalid",
"messageRu": "Сотрудник (UUID: abc-123): не заполнен УИН объекта строительства (поле \"uin\")",
"recordIndex": 5,
"uuid": "abc-123-def-456",
"entityType": "Сотрудник"
}
]
}
}
},
"summary": {
"totalDeleted": 20,
"totalUploaded": 31,
"validationSuccess": true,
"recordsSkipped": 4
}
}
PUT /puds_service/{uuid}
Раздел: Сервис PUDS.
Обновляет конфигурацию PUDS сервиса
Назначение | URL запроса |
Обновляет конфигурацию PUDS сервиса | https://{IP_контроллера}/api/v1/puds_service/{uuid} |
Параметры запроса:
Название | Тип | Описание | |
uuid* | string (path) | UUID PUDS сервиса | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
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}$ | Уникальный идентификатор PUDS сервиса |
name* | string | example: PUDS Сервис | Название PUDS сервиса |
host* | string | example: puds-mpl-stage.mos.ru | Хост PUDS сервера |
clientId* | string | example: client-id | Идентификатор клиента |
clientSecret* | string | example: client-secret | Секретное значение клиента |
catalogPersonId* | number | example: 12345 | Идентификатор каталога персональных данных |
catalogObjectId* | number | example: 12345 | Идентификатор каталога объектов строительства |
catalogDeviceId* | number | example: 12345 | Идентификатор каталога оборудования СКУД |
catalogOrganizationId* | number | example: 12345 | Идентификатор каталога организаций трудоустройства |
kafkaTopic* | string | example: events-topic | Kafka топик для событий |
basePath* | string | example: /api/v1 | Базовый путь для API |
authBasePath* | string | example: /auth | Базовый путь для аутентификации |
controller* | string | Контроллер сервиса | |
namespace | string | example: puds-rb | Пространство имен для PUDS API |
active* | boolean | Активен ли сервис | |
Пример:
URL запроса: PUT
https://{IP_контроллера}/api/v1/puds_service/{uuid}
Body
{
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"uuid": "12345678-1234-1234-1234-123456789012",
"controller": "string",
"namespace": "puds-rb",
"active": true
}
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 500 (Unexpected server error) - запрос не выполнен, получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"summary": "Обновить PUDS сервис",
"description": "Обновляет конфигурацию PUDS сервиса",
"parameters": [
{
"name": "uuid",
"in": "path",
"required": true,
"description": "UUID PUDS сервиса",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Название PUDS сервиса",
"example": "PUDS Сервис"
},
"host": {
"type": "string",
"description": "Хост PUDS сервера",
"example": "puds-mpl-stage.mos.ru"
},
"clientId": {
"type": "string",
"description": "Идентификатор клиента",
"example": "client-id"
},
"clientSecret": {
"type": "string",
"description": "Секрет клиента",
"example": "client-secret"
},
"catalogPersonId": {
"type": "number",
"description": "Идентификатор каталога персональных данных",
"example": 12345
},
"catalogObjectId": {
"type": "number",
"description": "Идентификатор каталога объектов строительства",
"example": 12346
},
"catalogDeviceId": {
"type": "number",
"description": "Идентификатор каталога оборудования СКУД",
"example": 12347
},
"catalogOrganizationId": {
"type": "number",
"description": "Идентификатор каталога организаций трудоустройства",
"example": 12348
},
"kafkaTopic": {
"type": "string",
"description": "Kafka топик для событий",
"example": "events-topic"
},
"basePath": {
"type": "string",
"description": "Базовый путь для API",
"example": "/api/v1"
},
"authBasePath": {
"type": "string",
"description": "Базовый путь для аутентификации",
"example": "/auth"
},
"uuid": {
"type": "string",
"description": "UUID сервиса",
"example": "12345678-1234-1234-1234-123456789012"
},
"controller": {
"type": "string",
"description": "Контроллер сервиса"
},
"namespace": {
"type": "string",
"description": "Namespace для PUDS API",
"example": "puds-rb"
},
"active": {
"type": "boolean",
"description": "Активен ли сервис"
}
}
}
}
}
},
"responses": {
"200": {
"description": "PUDS сервис обновлен успешно",
"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 PUT "https://{IP_контроллера}/api/v1/puds_service/{uuid}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"uuid": "12345678-1234-1234-1234-123456789012",
"controller": "string",
"namespace": "puds-rb",
"active": true
}'
Пример тела запроса
{
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"uuid": "12345678-1234-1234-1234-123456789012",
"controller": "string",
"namespace": "puds-rb",
"active": true
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
PATCH /puds_service/{uuid}
Раздел: Сервис PUDS.
Частично обновляет конфигурацию PUDS сервиса
Назначение | URL запроса |
Частично обновляет конфигурацию PUDS сервиса | https://{IP_контроллера}/api/v1/puds_service/{uuid} |
Параметры запроса:
Название | Тип | Описание | |
uuid* | string (path) | UUID PUDS сервиса | |
BODY | |||
Название * - обязательный | Тип | Формат | Назначение |
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}$ | Уникальный идентификатор PUDS сервиса |
name* | string | example: PUDS Сервис | Название PUDS сервиса |
host* | string | example: puds-mpl-stage.mos.ru | Хост PUDS сервера |
clientId* | string | example: client-id | Идентификатор клиента |
clientSecret* | string | example: client-secret | Секретное значение клиента |
catalogPersonId* | number | example: 12345 | Идентификатор каталога персональных данных |
catalogObjectId* | number | example: 12345 | Идентификатор каталога объектов строительства |
catalogDeviceId* | number | example: 12345 | Идентификатор каталога оборудования СКУД |
catalogOrganizationId* | number | example: 12345 | Идентификатор каталога организаций трудоустройства |
kafkaTopic* | string | example: events-topic | Kafka топик для событий |
basePath* | string | example: /api/v1 | Базовый путь для API |
authBasePath* | string | example: /auth | Базовый путь для аутентификации |
controller* | string | Контроллер сервиса | |
namespace | string | example: puds-rb | Пространство имен для PUDS API |
active* | boolean | Активен ли сервис | |
Пример:
URL запроса: POST
https://{IP_контроллера}/api/v1/puds_service/{uuid}
Body
{
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"uuid": "12345678-1234-1234-1234-123456789012",
"controller": "string",
"namespace": "puds-rb",
"active": true
}
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
Пример с исправленным синтаксисом JSON
Добавлена закрывающая фигурная скобка.
{
"success": false,
"message": "string",
"data": {}
}
Исходный пример Teamly
Пример из Teamly сохранён дословно, но не является корректным JSON.
{
"success": false,
"message": "string",
"data": {}
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"summary": "Частично обновить PUDS сервис",
"description": "Частично обновляет конфигурацию PUDS сервиса",
"parameters": [
{
"name": "uuid",
"in": "path",
"required": true,
"description": "UUID PUDS сервиса",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Название PUDS сервиса",
"example": "PUDS Сервис"
},
"host": {
"type": "string",
"description": "Хост PUDS сервера",
"example": "puds-mpl-stage.mos.ru"
},
"clientId": {
"type": "string",
"description": "Идентификатор клиента",
"example": "client-id"
},
"clientSecret": {
"type": "string",
"description": "Секрет клиента",
"example": "client-secret"
},
"catalogPersonId": {
"type": "number",
"description": "Идентификатор каталога персональных данных",
"example": 12345
},
"catalogObjectId": {
"type": "number",
"description": "Идентификатор каталога объектов строительства",
"example": 12346
},
"catalogDeviceId": {
"type": "number",
"description": "Идентификатор каталога оборудования СКУД",
"example": 12347
},
"catalogOrganizationId": {
"type": "number",
"description": "Идентификатор каталога организаций трудоустройства",
"example": 12348
},
"kafkaTopic": {
"type": "string",
"description": "Kafka топик для событий",
"example": "events-topic"
},
"basePath": {
"type": "string",
"description": "Базовый путь для API",
"example": "/api/v1"
},
"authBasePath": {
"type": "string",
"description": "Базовый путь для аутентификации",
"example": "/auth"
},
"uuid": {
"type": "string",
"description": "UUID сервиса",
"example": "12345678-1234-1234-1234-123456789012"
},
"controller": {
"type": "string",
"description": "Контроллер сервиса"
},
"namespace": {
"type": "string",
"description": "Namespace для PUDS API",
"example": "puds-rb"
},
"active": {
"type": "boolean",
"description": "Активен ли сервис"
}
}
}
}
}
},
"responses": {
"200": {
"description": "PUDS сервис обновлен успешно",
"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 PATCH "https://{IP_контроллера}/api/v1/puds_service/{uuid}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-raw '{
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"uuid": "12345678-1234-1234-1234-123456789012",
"controller": "string",
"namespace": "puds-rb",
"active": true
}'
Пример тела запроса
{
"name": "PUDS Сервис",
"host": "puds-mpl-stage.mos.ru",
"clientId": "client-id",
"clientSecret": "client-secret",
"catalogPersonId": 12345,
"catalogObjectId": 12346,
"catalogDeviceId": 12347,
"catalogOrganizationId": 12348,
"kafkaTopic": "events-topic",
"basePath": "/api/v1",
"authBasePath": "/auth",
"uuid": "12345678-1234-1234-1234-123456789012",
"controller": "string",
"namespace": "puds-rb",
"active": true
}
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}
DELETE /puds_service/{uuid}
Раздел: Сервис PUDS.
Удаляет PUDS сервис
Назначение | URL запроса |
Удаляет PUDS сервис | https://{IP_контроллера}/api/v1/puds_service/{uuid} |
Параметры запроса:
Наименование, * - обязательный | Описание |
uuid* string (path) | UUID PUDS сервиса |
Варианты ответа:
Code 200 (Successfully) - удачное выполнение запроса
{
"success": false,
"message": "string",
"data": {}
}
Code 500 (Unexpected server error) - запрос не выполнен получено сообщение об ошибке
Параметры и ответы по OpenAPI
{
"summary": "Удалить PUDS сервис",
"description": "Удаляет PUDS сервис",
"parameters": [
{
"name": "uuid",
"in": "path",
"required": true,
"description": "UUID PUDS сервиса",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "PUDS сервис удален успешно",
"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/puds_service/{uuid}" \
-H "Authorization: Bearer <token>"
Пример ответа
{
"success": false,
"message": "string",
"data": {}
}