-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.yml
305 lines (301 loc) · 7.46 KB
/
api.yml
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
openapi: 3.0.3
info:
title: ReactPHP - Trassir
description: PHP [Library](https://github.com/alexmorbo/react-trassir) for work with Trassir instances build on top of ReactPHP
contact:
name: Alex Morbo
url: https://github.com/alexmorbo
email: alex@morbo.ru
license:
name: MIT
version: 0.1.5
tags:
- name: Instance
description: Everything about Trassir instances
- name: Channel
description: Access to Trassir Channels
paths:
/instances:
post:
tags:
- Instance
summary: Add a new trassir server
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TrassirAuth'
required: true
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/TrassirAuthSuccessResponse'
'400':
description: Invalid input
content:
application/json:
schema:
$ref: '#/components/schemas/TrassirErrorResponse'
'500':
description: Operation not successful
content:
application/json:
schema:
$ref: '#/components/schemas/TrassirErrorResponse'
get:
tags:
- Instance
summary: Get list of added instances
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/TrassirInstance'
/instance/{instanceId}:
get:
tags:
- Instance
summary: Get Instance by ID
description: Returns a single instance
operationId: GetInstance
parameters:
- name: instanceId
in: path
description: ID of instance to return
required: true
schema:
type: integer
format: int64
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/TrassirInstance'
'404':
description: Instance not found
content:
application/json:
schema:
$ref: '#/components/schemas/TrassirErrorResponse'
delete:
tags:
- Instance
summary: Delete instance by ID
operationId: DeleteInstance
parameters:
- name: instanceId
in: path
description: Instance id to delete
required: true
schema:
type: integer
format: int64
responses:
'204':
description: Successful deletion
'404':
description: Instance not found
content:
application/json:
schema:
$ref: '#/components/schemas/TrassirErrorResponse'
/instance/{instanceId}/channel/{channelId}/screenshot:
get:
tags:
- Channel
summary: Get channel screenshot
operationId: GetChannelScreenshot
parameters:
- name: instanceId
in: path
description: Instance id
required: true
schema:
type: integer
format: int64
- name: channelId
in: path
description: Channel id
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
image/jpeg:
schema:
type: string
format: binary
/instance/{instanceId}/channel/{channelId}/video/{container}:
get:
tags:
- Channel
summary: Get channel video stream
operationId: GetChannelVideoStream
parameters:
- name: instanceId
in: path
description: Instance id
required: true
schema:
type: integer
format: int64
- name: channelId
in: path
description: Channel id
required: true
schema:
type: string
- name: container
in: path
description: Video container
required: true
schema:
type: string
enum: ["rtsp", "hls"]
- name: redirect
in: query
description: Need to be true for HomeAssistant
required: false
schema:
type: integer
enum: [1, 0]
default: 0
responses:
'200':
description: successful operation if redirect query sets to false
content:
plain/text:
schema:
type: string
format: binary
description: HTTP link with video stream
'302':
description: successful operation if redirect query sets to true
headers:
Location:
schema:
type: string
description: HTTP link with video stream
components:
schemas:
TrassirAuth:
type: object
properties:
ip:
type: string
http_port:
type: integer
rtsp_port:
type: integer
login:
type: string
password:
type: string
TrassirAuthSuccessResponse:
type: object
properties:
status:
type: string
id:
type: integer
TrassirErrorResponse:
type: object
properties:
status:
type: string
error:
type: string
TrassirInstance:
type: object
properties:
id:
type: integer
ip:
type: string
name:
type: string
http_port:
type: integer
rtsp_port:
type: integer
login:
type: string
password:
type: string
created_at:
type: string
format: date-time
state:
type: integer
channels:
type: array
items:
$ref: '#/components/schemas/Channel'
remote_channels:
type: array
items:
$ref: '#/components/schemas/Channel'
zombies:
type: array
items:
$ref: '#/components/schemas/Channel'
templates:
type: array
items:
$ref: '#/components/schemas/Channel'
Channel:
type: object
properties:
guid:
type: string
name:
type: string
rights:
type: string
codec:
type: string
have_mainstream:
oneOf:
- type: string
- type: integer
have_substream:
oneOf:
- type: string
- type: integer
have_hardware_archive:
oneOf:
- type: string
- type: integer
have_ptz:
oneOf:
- type: string
- type: integer
fish_eye:
oneOf:
- type: string
- type: integer
have_voice_comm:
oneOf:
- type: string
- type: integer
aspect_ratio:
type: string
flip:
type: string
rotate:
type: string
server_name:
type: string
server_guid:
type: string