-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
126 lines (119 loc) · 3.13 KB
/
Copy pathopenapi.yaml
File metadata and controls
126 lines (119 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
openapi: 3.0.3
info:
title: air_operator HTTP API
description: HTTP API виджета оператора и мониторинга сервиса.
version: 1.0.0
servers:
- url: http://localhost:8080
tags:
- name: Operator
description: Подключение к операторской сессии
- name: Monitoring
description: Мониторинг сервиса
paths:
/metrics:
get:
tags: [Monitoring]
summary: Получить Prometheus-метрики
operationId: getMetrics
responses:
'200':
description: Метрики Prometheus
content:
text/plain:
schema:
type: string
/oper/available:
get:
tags: [Operator]
summary: Проверить доступность сервиса
operationId: getOperatorAvailability
responses:
'200':
description: Сервис доступен
/op:
get:
tags: [Operator]
summary: Открыть SSE-соединение с оператором
operationId: subscribeOperatorEvents
parameters:
- $ref: '#/components/parameters/UserId'
- $ref: '#/components/parameters/DialogId'
responses:
'200':
description: Поток событий оператора
content:
text/event-stream:
schema:
type: string
'400':
$ref: '#/components/responses/BadRequest'
post:
tags: [Operator]
summary: Отправить сообщение оператору
operationId: sendOperatorMessage
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OperatorMessageRequest'
responses:
'200':
description: Сообщение принято
'400':
$ref: '#/components/responses/BadRequest'
'404':
description: Сессия не найдена
'504':
description: Тайм-аут отправки сообщения
components:
parameters:
UserId:
name: user_id
in: query
required: true
schema:
type: integer
format: int32
minimum: 1
DialogId:
name: dialog_id
in: query
required: true
schema:
type: integer
format: int64
minimum: 1
schemas:
OperatorMessageRequest:
type: object
required: [user_id, dialog_id, sid, msg]
properties:
user_id:
type: integer
format: int32
minimum: 1
dialog_id:
type: integer
format: int64
minimum: 1
sid:
type: integer
format: int64
description: Telegram ID оператора.
msg:
type: object
additionalProperties: true
ErrorResponse:
type: object
properties:
error:
type: string
responses:
BadRequest:
description: Некорректный запрос
content:
text/plain:
schema:
type: string