old_console/finalschemaAPI.yaml
2024-11-02 14:12:45 +03:00

2082 lines
57 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

openapi: 3.0.3
info:
title: ARMA Management Console API
version: 1.4.0
description: ARMA Management Console API
externalDocs:
description: Дополнительные соглашения используемые при разработке спецификации
url: https://iwarma.atlassian.net/wiki/spaces/ARMA/pages/25362443/ARMA+AMC+API
servers:
- url: http://localhost:9090/
security:
- token_auth: []
tags:
- name: assets
description: "All for assets"
paths:
/api/incidents/:
get:
description: |-
Показать список инцидентов
Требуемое права: `can_view_incidents_list`
tags:
- incident
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
- $ref: "#/components/parameters/assets"
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/Incident"
403:
$ref: "#/components/responses/403"
/api/incidents/{uuid}:
parameters:
- $ref: "#/components/parameters/uuidParam"
get:
description: |-
Подробная информация о инциденте
Требуемые права: `can_view_incidents`
tags:
- incident
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/Incident"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
patch:
description: |-
Обновление данных инцидента
Требуемые права: `can_view_incidents`
tags:
- incident
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/IncidentEdit"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/Incident"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/incidents/csv_export/:
get:
description: |-
Экспорт данных инцидентов в CSV формате
Требуемые права: `can_export_incidents_list`
tags:
- incident
responses:
200:
$ref: "#/components/responses/200_celery"
403:
$ref: "#/components/responses/403"
/api/incident/category/:
get:
description: |-
Получить список категорий инцидентов
Требуемые права: `can_view_incidents_list`
tags:
- incident
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/NameDescriptionModel"
403:
$ref: "#/components/responses/403"
/en/api/incident/effects/:
get:
description: |-
Показать список эффектов инцидента
tags:
- incident
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/NameDescriptionModel"
403:
$ref: "#/components/responses/403"
post:
description: Добавить эффект для инцидента
tags:
- incident
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
/en/api/incident/effects/{id}:
get:
description: "Получить эффект для инцидента по его ID"
tags:
- incident
parameters:
- $ref: '#/components/parameters/idParam'
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
403:
description: Forbidden
content:
application/json:
schema:
properties:
detail:
type: string
example:
detail: "Учетные данные не были предоставлены."
404:
$ref: "#/components/responses/404"
patch:
description: Редактировать эффект инцидента
tags:
- incident
parameters:
- $ref: "#/components/parameters/idParam"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
delete:
description: Удалить эффект инцидента
tags:
- incident
parameters:
- $ref: "#/components/parameters/idParam"
responses:
200:
description: "Успешное удаление"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/en/api/incident/recommendations/:
get:
description: "Получить список рекоммендаций для инцидентов"
tags:
- incident
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/IncidentRecommendations"
403:
description: Forbidden
content:
application/json:
schema:
properties:
detail:
type: string
example:
detail: "Учетные данные не были предоставлены."
post:
description: Добавить рекоммендацию для инцидента
tags:
- incident
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
/en/api/incident/recommendations/{id}:
get:
description: "Получить рекоммендацию для инцидента по его ID"
tags:
- incident
parameters:
- $ref: '#/components/parameters/idParam'
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
403:
description: Forbidden
content:
application/json:
schema:
properties:
detail:
type: string
example:
detail: "Учетные данные не были предоставлены."
404:
$ref: "#/components/responses/404"
patch:
description: Редактировать рекоммендацию инцидента
tags:
- incident
parameters:
- $ref: "#/components/parameters/idParam"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
delete:
description: Удалить рекоммендацию инцидента
tags:
- incident
parameters:
- $ref: "#/components/parameters/idParam"
responses:
200:
description: "Успешное удаление"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/assets/groups:
get:
description: Получить список групп ассетов
tags:
- asset groups
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/AssetGroup"
403:
$ref: "#/components/responses/403"
405:
$ref: "#/components/responses/405"
400:
description: ""
content:
application/json:
examples:
invalid_page:
$ref: "#/components/examples/invalid_page"
invalid_query_parameter:
$ref: "#/components/examples/invalid_query_parameter"
post:
description: Добавить производителя
tags:
- asset groups
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AssetGroup"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/AssetGroup"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/assets/groups/{id}/:
get:
description: Получить производителя по его ID
tags:
- asset groups
parameters:
- $ref: "#/components/parameters/idParam"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/AssetGroup"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
patch:
description: Редактировать производителя по его ID
tags:
- asset groups
parameters:
- $ref: "#/components/parameters/idParam"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AssetGroup"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/AssetGroup"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
delete:
description: Удалить производителя по его ID
tags:
- asset groups
parameters:
- $ref: "#/components/parameters/idParam"
responses:
200:
description: ""
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/assets/manufacturers:
get:
description: Получить список доступных производителей
tags:
- asset manufacturer
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/NameDescriptionModel"
403:
$ref: "#/components/responses/403"
405:
$ref: "#/components/responses/405"
400:
description: ""
content:
application/json:
examples:
invalid_page:
$ref: "#/components/examples/invalid_page"
invalid_query_parameter:
$ref: "#/components/examples/invalid_query_parameter"
post:
description: Доавить производителя
tags:
- asset manufacturer
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/assets/manufacturer/{id}/:
get:
description: Получить производителя по его ID
tags:
- asset manufacturer
parameters:
- $ref: "#/components/parameters/idParam"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
patch:
description: Редактировать производителя по его ID
tags:
- asset manufacturer
parameters:
- $ref: "#/components/parameters/idParam"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
delete:
description: Удалить производителя по его ID
tags:
- asset manufacturer
parameters:
- $ref: "#/components/parameters/idParam"
responses:
200:
description: ""
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/assets/os:
get:
description: Получить список доступных операционных систем
tags:
- os
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/NameDescriptionModel"
403:
$ref: "#/components/responses/403"
405:
$ref: "#/components/responses/405"
400:
description: ""
content:
application/json:
examples:
invalid_page:
$ref: "#/components/examples/invalid_page"
invalid_query_parameter:
$ref: "#/components/examples/invalid_query_parameter"
post:
description: Доавить ОС
tags:
- os
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/assets/os/{id}/:
get:
description: Получить Операционную систему по ее ID
tags:
- os
parameters:
- $ref: "#/components/parameters/idParam"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
patch:
description: Редактировать ОС по ее ID
tags:
- os
parameters:
- $ref: "#/components/parameters/idParam"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/NameDescriptionModel"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
delete:
description: Удалить ОС по ее ID
tags:
- os
parameters:
- $ref: "#/components/parameters/idParam"
responses:
200:
description: ""
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/assets/elements/:
get:
description: |-
Show Active List.
Permisions requred:
- "Can view list active";
tags:
- assets
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
- $ref: "#/components/parameters/incidents"
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/AssetList"
403:
$ref: "#/components/responses/403"
405:
$ref: "#/components/responses/405"
400:
description: ""
content:
application/json:
examples:
invalid_page:
$ref: "#/components/examples/invalid_page"
invalid_query_parameter:
$ref: "#/components/examples/invalid_query_parameter"
/api/assets/elements/{id}/:
get:
description: |-
Получение полной информации о запрашиваемом активе. В том числе:
- Связные инциденты
Связные модели возвращаются ввиде полной информации об объекте
Permisions requred:
- 'Can view active'
parameters:
- $ref: "#/components/parameters/idParam"
tags:
- assets
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/AssetDetail"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
patch:
description: |-
Patch Asset.
Permisions requred:
- 'Can view active'
parameters:
- $ref: "#/components/parameters/idParam"
tags:
- assets
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AssetPatch"
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/AssetBase"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
delete:
description: |-
Delete Asset.
Permisions requred:
- 'Can delete active'
parameters:
- $ref: "#/components/parameters/idParam"
tags:
- assets
responses:
200:
$ref: "#/components/responses/200_no_content"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/assets/elements/authorize_assets/:
post:
tags:
- assets
requestBody:
content:
application/json:
schema:
properties:
selected_assets:
type: array
items:
type: integer
minimum: 1
responses:
200:
description: ""
content:
application/json:
example:
status: ok
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
/api/users/:
get:
description: "Получить список не удаленных пользователей (пользователей, у которых в имени не присутсвует префикс deleted_*"
tags:
- users
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/UserInfo"
403:
$ref: "#/components/responses/403"
405:
$ref: "#/components/responses/405"
400:
description: ""
content:
application/json:
examples:
invalid_page:
$ref: "#/components/examples/invalid_page"
invalid_query_parameter:
$ref: "#/components/examples/invalid_query_parameter"
post:
description: "Создание нового пользователя"
tags:
- users
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserInfo'
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/UserInfo"
403:
$ref: "#/components/responses/403"
405:
$ref: "#/components/responses/405"
400:
description: ""
content:
application/json:
examples:
invalid_page:
$ref: "#/components/examples/invalid_page"
invalid_query_parameter:
$ref: "#/components/examples/invalid_query_parameter"
/api/users/{id}:
get:
description: "Получение информации о пользователе по его ID"
parameters:
- $ref: "#/components/parameters/idParam"
tags:
- users
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/UserInfo"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
patch:
description: "Редактирование информации о пользователе по его ID"
parameters:
- $ref: "#/components/parameters/idParam"
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserInfo'
tags:
- users
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/UserInfo"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
400:
description: ""
content:
application/json:
examples:
invalid_body:
$ref: "#/components/examples/invalid_body"
delete:
description: "Удалить пользователя (Переименовывание логина пользователя + изменение состояния is_active -> False) по его ID."
parameters:
- $ref: "#/components/parameters/idParam"
tags:
- users
responses:
200:
$ref: "#/components/responses/200_no_content"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/store/:
get:
description: "Список файлов в хранилище"
tags:
- store
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
responses:
200:
description: ""
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: "#/components/schemas/StorageList"
403:
$ref: "#/components/responses/403"
400:
description: ""
content:
application/json:
examples:
invalid_page:
$ref: "#/components/examples/invalid_page"
invalid_query_parameter:
$ref: "#/components/examples/invalid_query_parameter"
/api/store/{id}/:
get:
description: |-
Получения полной информации об одном файле
Требуемые права:
- 'Can view storage'
parameters:
- $ref: "#/components/parameters/idParam"
tags:
- store
responses:
200:
description: ""
content:
application/json:
schema:
$ref: "#/components/schemas/Storage"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
delete:
description: 'Удаления файла'
parameters:
- $ref: "#/components/parameters/idParam"
tags:
- store
responses:
200:
$ref: "#/components/responses/200_no_content"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/api/store/{id}/download/:
get:
description: 'Скачивание файла'
parameters:
- $ref: "#/components/parameters/idParam"
tags:
- store
responses:
200:
description: Возвращает файл
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
/en/api/settings/events/set/:
post:
operationId: api_settings_events_set_create
description: |
Permisions requred:
- can_change_rotation_settings
parameters:
- in: query
name: format
schema:
type: string
enum:
- datatables
- json
tags:
- settings
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RotationSettings'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/RotationSettings'
multipart/form-data:
schema:
$ref: '#/components/schemas/RotationSettings'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RotationSettings'
description: ''
/en/api/settings/incidents/set/:
post:
operationId: api_settings_incidents_set_create
description: |
Permisions requred:
- can_change_rotation_settings
parameters:
- in: query
name: format
schema:
type: string
enum:
- datatables
- json
tags:
- settings
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RotationSettings'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/RotationSettings'
multipart/form-data:
schema:
$ref: '#/components/schemas/RotationSettings'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RotationSettings'
description: ''
/api/incident_export/receivers/opcua/:
get:
tags:
- export
description: Список получателей (по протоколу OPCUA) сообщений об инцидентах
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
responses:
200:
description: ''
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: '#/components/schemas/OPCUAReceiver'
403:
$ref: '#/components/responses/403'
post:
tags:
- export
description: Создание получателя событий об инцидентах по протоколу OPCUA
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OPCUAReceiver'
responses:
201:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/OPCUAReceiver'
/api/incident_export/receivers/opcua/{id}/:
parameters:
- $ref: '#/components/parameters/idParam'
get:
tags:
- export
responses:
200:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/OPCUAReceiver'
404:
$ref: '#/components/responses/404'
403:
$ref: '#/components/responses/403'
patch:
tags:
- export
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OPCUAReceiver'
responses:
200:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/OPCUAReceiver'
404:
$ref: '#/components/responses/404'
403:
$ref: '#/components/responses/403'
delete:
tags:
- export
responses:
404:
$ref: '#/components/responses/404'
403:
$ref: '#/components/responses/403'
/api/incident_export/receivers/syslog/:
get:
tags:
- export
description: Список получателей (по протоколу syslog) сообщений об инцидентах
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/page_size"
responses:
200:
description: ''
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/Pagination"
- properties:
results:
items:
$ref: '#/components/schemas/SyslogReceiver'
post:
tags:
- export
description: Создание получателя событий об инцидентах по протоколу syslog
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SyslogReceiver'
responses:
201:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/SyslogReceiver'
403:
$ref: '#/components/responses/403'
/api/incident_export/receivers/syslog/{id}/:
parameters:
- $ref: '#/components/parameters/idParam'
get:
tags:
- export
responses:
200:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/SyslogReceiver'
404:
$ref: '#/components/responses/404'
patch:
tags:
- export
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SyslogReceiver'
responses:
200:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/SyslogReceiver'
404:
$ref: '#/components/responses/404'
403:
$ref: '#/components/responses/403'
delete:
tags:
- export
responses:
404:
$ref: '#/components/responses/404'
403:
$ref: '#/components/responses/403'
components:
securitySchemes:
token_auth:
type: apiKey
in: header
name: Authorization
description: Для использования API необходимо в header запроса положить токен авторизации пользователя в виде "Token ХХХХХХХ"
responses:
200_celery:
description: Задача celery успешно запущена
content:
application/json:
schema:
$ref: "#/components/schemas/Celery"
200_no_content:
description: No content
403:
description: Forbidden
content:
application/json:
schema:
properties:
detail:
type: string
example:
detail: "Учетные данные не были предоставлены."
404:
description: Not found
content:
application/json:
schema:
properties:
detail:
type: string
example:
detail: "Не найдено."
405:
description: Method not allowed
content:
application/json:
schema:
properties:
detail:
type: string
example:
detail: "Метод 'PATCH' не разрешен."
examples:
invalid_page:
summary: Ошибка при указании номера страницы
value:
detail: "Неправильная страница"
invalid_query_parameter:
description: Ключ в ответе обозначает параметр, в котором допущена ошибка. Значение это список строк описывающих ошибки
summary: Ошибка при указании query параметра
value:
incidents:
- "Введите правильный UUID."
invalid_body:
description: Каждый ключ в ответе обозначает поле, в котором допущена ошибка. Значение ключа это список строк описывающих ошибки
summary: Ошибка при валидации данных
value:
field:
- "Недопустимый первичный ключ - объект не существует."
parameters:
idParam:
name: id
in: path
description: 'Идентификатор "Primary key" инстанса модели. >= 1'
required: true
schema:
type: integer
minimum: 1
example: 17654
uuidParam:
name: uuid
in: path
description: "Instance uuid Primary Key"
required: true
schema:
type: string
page:
name: page
in: query
description: "Page number"
schema:
type: integer
page_size:
name: page_size
in: query
description: "Maximum page size"
schema:
type: integer
incidents:
name: incidents
in: query
description: "Фильтрация списка по переданному uuid инцидента"
schema:
type: string
assets:
name: assets
in: query
description: Фильтрация списка инцидентов по переданному `id` актива как по одному `1` так и списком `1,2,3`
schema:
type: string
example: 1,2,3
schemas:
Pagination:
properties:
count:
type: integer
example: 123
next:
type: string
nullable: true
previous:
type: string
nullable: true
results:
type: array
items:
type: object
AssetType:
type: string
enum:
- user
- arma_industrial_firewall
- plc
- pc
- server
- network_device
nullable: True
AssetStatus:
type: integer
enum:
- 0
- 1
nullable: true
description: "Статус актива: 1 - разрешенный, 0 - недоверенный"
NameDescriptionModel:
properties:
id:
type: integer
readOnly: true
name:
type: string
maxLength: 128
description:
type: string
nullable: true
AssetBase:
properties:
id:
type: integer
readOnly: true
name:
type: string
maxLength: 128
asset_type:
$ref: "#/components/schemas/AssetType"
status:
$ref: "#/components/schemas/AssetStatus"
ip:
type: string
description: Asset's IPv4 or IPv6 address.
updated:
type: string
format: date-time
readOnly: true
AssetGroup:
allOf:
- $ref: "#/components/schemas/NameDescriptionModel"
- properties:
collapsed:
type: boolean
description: Схлопнута ли данная группа на карте сети
default: false
Asset:
allOf:
- $ref: "#/components/schemas/AssetBase"
- properties:
description:
type: string
nullable: true
sensor:
type: string
maxLength: 128
nullable: true
model:
description: Asset model
type: string
nullable: true
mac:
type: string
nullable: true
description: Asset's MAC address
maxLength: 17
ports:
type: array
nullable: true
items:
type: integer
description: List of open ports
AssetList:
allOf:
- $ref: "#/components/schemas/AssetBase"
- properties:
incidents:
type: integer
readOnly: true
description: Count of incidents
AssetDetail:
allOf:
- $ref: "#/components/schemas/Asset"
- properties:
os:
$ref: "#/components/schemas/Os"
group:
$ref: "#/components/schemas/AssetGroup"
manufacturer:
$ref: "#/components/schemas/AssetManufacturer"
incidents:
type: array
items:
$ref: "#/components/schemas/Incident"
AssetPatch:
allOf:
- $ref: "#/components/schemas/Asset"
- properties:
os:
type: integer
nullable: true
minimum: 1
description: Operating system primary key
group:
type: integer
nullable: true
minimum: 1
description: Asset group primary key
manufacturer:
type: integer
nullable: true
minimum: 1
description: Asset manufacturer primary key
AssetManufacturer:
properties:
id:
type: integer
readOnly: true
name:
type: string
maxLength: 128
description:
type: string
nullable: true
description: Description
required:
- id
- name
nullable: true
Os:
properties:
id:
type: integer
readOnly: true
description:
type: string
nullable: true
description: Description
name:
type: string
maxLength: 128
required:
- id
- name
nullable: true
example:
id: 2345
description: MS Windows
name: Windows
Incident:
type: object
properties:
user_friendly_id:
type: integer
maximum: 2147483647
minimum: 0
nullable: true
readOnly: true
timestamp:
type: string
format: date-time
description: Date and time, when incident occurs
incident_id:
type: string
format: uuid
title: ID
description: ID of incident
title:
type: string
description: Title
maxLength: 128
category:
$ref: "#/components/schemas/IncidentCategory"
importance:
type: integer
maximum: 100
minimum: 0
description: Hazard level of incident
status:
$ref: "#/components/schemas/IncidentStatusEnum"
assigned_to:
type: string
readOnly: true
event_count:
type: integer
maximum: 2147483647
minimum: 1
title: Event's number
description: Amount of events in the incident
created:
type: string
format: date-time
readOnly: true
description: Date and time, when incident was created
updated:
type: string
format: date-time
readOnly: true
description: Date and time, when incident was updated
events:
type: array
items:
$ref: "#/components/schemas/Event"
deadline:
type: string
format: date-time
readOnly: true
description: Deadline. Deadline when incident must be resolved
comment:
type: string
readOnly: true
description: Incident comment
nullable: true
required:
- assigned_to
- category
- created
- event_count
- events
- importance
- title
- updated
IncidentCategory:
type: object
properties:
name:
type: string
maxLength: 128
description:
type: string
nullable: true
description: Description
id:
type: integer
readOnly: true
required:
- id
- name
IncidentStatusEnum:
enum:
- 0
- 1
- 2
- 3
- 4
description:
0 - Not assigned (Не назначен)
1 - Assigned (Назначен)
2 - Delayed (Отложен)
3 - Resolved (Решен)
4 - False_alarm (Ложное срабатывание)
type: integer
IncidentEdit:
type: object
properties:
status:
$ref: "#/components/schemas/IncidentStatusEnum"
deadline:
type: string
format: date-time
description: Deadline. Метка времени, до которого инцидент должен быть решен
comment:
type: string
description: Комментарии к инциденту
nullable: true
category:
type: integer
assigned_to:
type: integer
minimum: 0
Celery:
type: object
properties:
task_id:
type: string
format: uuid
readOnly: true
finished:
type: boolean
result:
type: integer
minimum: 0
readOnly: true
IncidentEffect:
type: object
properties:
name:
type: string
maxLength: 128
description:
type: string
nullable: true
description: Description
id:
type: integer
readOnly: true
required:
- id
- name
IncidentRecommendations:
type: object
properties:
name:
type: string
maxLength: 128
description:
type: string
nullable: true
description: Description
id:
type: integer
readOnly: true
required:
- id
- name
Event:
type: object
properties:
type:
type: string
Index:
type: string
sign_id:
type: string
"@created":
type: string
event_id:
type: string
rule_tags:
type: string
format: nullable
sign_name:
type: string
source_ip:
type: string
"@timestamp":
type: string
event_hash:
type: string
event_last:
type: string
source_mac:
type: string
celery_done:
type: boolean
event_count:
type: integer
format: int32
event_first:
type: string
source_host:
type: string
source_port:
type: integer
format: int32
source_user:
type: string
aggregated_id:
type: string
device_action:
type: string
device_vendor:
type: string
event_src_msg:
type: string
sign_category:
type: string
destination_ip:
type: string
device_product:
type: string
device_version:
type: string
event_protocol:
type: string
event_severity:
type: integer
format: int32
event_timestamp:
type: string
destination_host:
type: string
destination_port:
type: integer
format: int32
destination_user:
type: string
sign_subcategory:
type: string
UserInfo:
properties:
user:
$ref: '#/components/schemas/User'
comment:
type: string
example: asdasd
timezone:
type: string
example: "Europe/Moscow"
expire_date:
type: string
format: nullable
modified:
readOnly: true
type: string
example: "2022-04-13T14:49:41.810932+03:00"
User:
type: object
properties:
id:
readOnly: true
type: integer
format: int32
example: 3
username:
type: string
example: new_user_2
password:
description: "В случае если не нужно менять пароль - данное поле не стоит включать в body"
writeOnly: true
type: string
first_name:
type: string
example: asdasd
is_active:
type: boolean
email:
type: string
example: asdf@mail.ru
StorageTypeEnum:
type: integer
enum: [0, 1, 2, 3, 4]
description: Тип файла в хранилище.
0 - Unknown
1 - DB dump
2 - CSV export
3 - JSON export
4 - ClamAV updates
default: 0
StorageFormatEnum:
type: string
enum: ['Unknown','Plain','JSON','CSV','ZIP']
description: Формат файла в хранилище.
default: 'Unknown'
StorageList:
properties:
id:
type: integer
minimum: 1
format:
$ref: '#/components/schemas/StorageFormatEnum'
size:
type: integer
description:
type: string
created:
type: string
format: date-time
Storage:
allOf:
- $ref: '#/components/schemas/StorageList'
- properties:
last_access:
type: string
format: date-time
type:
$ref: '#/components/schemas/StorageTypeEnum'
crc:
type: object
properties:
crc:
type: string
type:
type: string
enum: ['sha256sum', 'sha512sum']
RotationSettings:
type: object
properties:
rotation_type:
$ref: '#/components/schemas/RotationTypeEnum'
size_rotation:
type: integer
schedule:
$ref: '#/components/schemas/Schedule'
required:
- rotation_type
- schedule
- size_rotation
RotationTypeEnum:
enum:
- 0
- 1
- 2
type: integer
Schedule:
type: object
properties:
period:
$ref: '#/components/schemas/PeriodEnum'
time:
type: string
format: time
week_day:
type: array
items:
$ref: '#/components/schemas/WeekDayEnum'
month:
type: array
items:
$ref: '#/components/schemas/MonthEnum'
required:
- period
PeriodEnum:
enum:
- day
- week
- month
type: string
WeekDayEnum:
enum:
- sunday
- monday
- tuesday
- wednesday
- thursday
- friday
- saturday
type: string
MonthEnum:
enum:
- january
- february
- march
- april
- may
- june
- july
- august
- september
- october
- november
- december
type: string
SyslogProtocol:
type: string
enum:
- UDP
- TCP
default: UDP
TypeReceiver:
type: string
enum:
- OPC_UA
- syslog
SeverityLevel:
type: integer
enum:
- 0
- 10
- 40
- 70
- 90
- 100
description: |
Уровень критичности инцидента.
0 - Minimal severity,
10 - Info severity,
40 - Low severity,
70 - Medium severity,
90 - High severity,
100 - Critical severity
default: 0
BaseReceiver:
properties:
id:
type: integer
readOnly: true
type:
$ref: '#/components/schemas/TypeReceiver'
cef_format:
type: boolean
default: true
message_filter:
type: string
default: ''
message_min_severity:
$ref: '#/components/schemas/SeverityLevel'
export_status:
type: boolean
default: true
OPCUAReceiver:
properties:
id:
type: integer
readOnly: true
host:
type: string
port:
type: integer
node_number:
type: integer
receiver:
$ref: '#/components/schemas/BaseReceiver'
SyslogReceiver:
properties:
id:
type: integer
readOnly: true
host:
type: string
port:
type: integer
protocol:
$ref: '#/components/schemas/SyslogProtocol'
receiver:
$ref: '#/components/schemas/BaseReceiver'