-
Notifications
You must be signed in to change notification settings - Fork 10
/
annotationd.yml
501 lines (501 loc) · 13.2 KB
/
annotationd.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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
openapi: 3.0.0
info:
title: Annotations service
version: 0.2.3
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'
servers:
- url: /api/v2private
paths:
/annotations:
post:
tags:
- Annotations
operationId: createAnnotations
summary: Create annotations
requestBody:
description: Annotations to create
content:
application/json:
schema:
$ref: '#/components/schemas/AnnotationCreateList'
responses:
'200':
description: Annotations created
content:
application/json:
schema:
$ref: '#/components/schemas/AnnotationEventList'
'204':
$ref: '#/components/responses/NoContent'
'400':
$ref: '#/components/responses/ServerError'
'401':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
get:
tags:
- Annotations
operationId: listAnnotations
summary: List annotations
parameters:
- $ref: '#/components/parameters/AnnotationListFilter'
responses:
'200':
description: Optionally filtered list of annotations
content:
application/json:
schema:
$ref: '#/components/schemas/AnnotationList'
'400':
$ref: '#/components/responses/ServerError'
'401':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
delete:
tags:
- Annotations
operationId: deleteAnnotations
summary: Delete annotation
parameters:
- $ref: '#/components/parameters/AnnotationDeleteFilter'
responses:
'204':
$ref: '#/components/responses/NoContent'
'400':
$ref: '#/components/responses/ServerError'
'401':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
'/annotations/{annotationID}':
get:
tags:
- Annotations
summary: Retrieve an annotation
parameters:
- in: path
name: annotationID
description: The identifier of the annotation.
required: true
schema:
type: string
responses:
'200':
description: The annotation details
content:
application/json:
schema:
$ref: '#/components/schemas/AnnotationEvent'
'401':
$ref: '#/components/responses/ServerError'
'404':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
default:
$ref: '#/components/responses/ServerError'
put:
tags:
- Annotations
operationId: updateAnnotation
summary: Update an annotation
parameters:
- in: path
name: annotationID
description: The identifier of the annotation.
required: true
schema:
type: string
requestBody:
description: Annotation to store
content:
application/json:
schema:
$ref: '#/components/schemas/AnnotationCreate'
responses:
'200':
description: The updated annotation
content:
application/json:
schema:
$ref: '#/components/schemas/AnnotationEvent'
'400':
$ref: '#/components/responses/ServerError'
'401':
$ref: '#/components/responses/ServerError'
'404':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
delete:
tags:
- Annotations
operationId: deleteAnnotation
summary: Delete an annotation by ID
parameters:
- in: path
name: annotationID
description: The identifier of the annotation.
required: true
schema:
type: string
responses:
'204':
$ref: '#/components/responses/NoContent'
'400':
$ref: '#/components/responses/ServerError'
'401':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
/streams:
put:
tags:
- Streams
operationId: createUpdateStream
summary: Create or update stream
requestBody:
description: Stream to create or update
content:
application/json:
schema:
$ref: '#/components/schemas/Stream'
responses:
'200':
description: Stream as created/updated
content:
application/json:
schema:
$ref: '#/components/schemas/ReadStream'
'400':
$ref: '#/components/responses/ServerError'
'401':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
get:
tags:
- Streams
operationId: getStreams
summary: Get streams
parameters:
- $ref: '#/components/parameters/StreamListFilter'
responses:
'200':
description: Optionally filtered list of streams
content:
application/json:
schema:
$ref: '#/components/schemas/StreamList'
'400':
$ref: '#/components/responses/ServerError'
'401':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
delete:
tags:
- Streams
operationId: deleteStream
summary: Delete stream
parameters:
- $ref: '#/components/parameters/StreamDeleteFilter'
responses:
'204':
$ref: '#/components/responses/NoContent'
'400':
$ref: '#/components/responses/ServerError'
'401':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
'/streams/{streamID}':
put:
tags:
- Streams
operationId: updateStream
summary: Update stream
parameters:
- in: path
name: streamID
description: stream to update
required: true
schema:
type: string
requestBody:
description: Stream to update
content:
application/json:
schema:
$ref: '#/components/schemas/Stream'
responses:
'200':
description: Stream as updated
content:
application/json:
schema:
$ref: '#/components/schemas/ReadStream'
'400':
$ref: '#/components/responses/ServerError'
'401':
$ref: '#/components/responses/ServerError'
'404':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
delete:
tags:
- Streams
operationId: deleteStreamByID
summary: Delete stream by ID
parameters:
- in: path
name: streamID
description: stream to delete
required: true
schema:
type: string
responses:
'204':
$ref: '#/components/responses/NoContent'
'400':
$ref: '#/components/responses/ServerError'
'401':
$ref: '#/components/responses/ServerError'
'500':
$ref: '#/components/responses/ServerError'
components:
parameters:
AnnotationListFilter:
in: query
name: AnnotationListFilter
required: false
description: Filter for returned annotations
schema:
$ref: '#/components/schemas/AnnotationListFilter'
AnnotationDeleteFilter:
in: query
name: AnnotationDeleteFilter
required: true
description: Annotations to delete
schema:
$ref: '#/components/schemas/AnnotationDeleteFilter'
StreamListFilter:
in: query
name: StreamListFilter
required: false
description: Filter for returned streams
schema:
$ref: '#/components/schemas/StreamListFilter'
StreamDeleteFilter:
in: query
name: StreamDeleteFilter
required: true
description: Stream to delete
schema:
$ref: '#/components/schemas/StreamDeleteFilter'
schemas:
AnnotationListFilter:
allOf:
- $ref: '#/components/schemas/BasicFilter'
- type: object
properties:
stickerIncludes:
type: object
additionalProperties:
type: string
streamIncludes:
type: array
items:
type: string
AnnotationDeleteFilter:
type: object
required:
- stream
- startTime
- endTime
properties:
stickers:
type: object
additionalProperties:
type: string
stream:
type: string
streamID:
type: string
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
BasicFilter:
type: object
properties:
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
AnnotationList:
type: array
items:
type: object
properties:
stream:
type: string
annotations:
type: array
items:
$ref: '#/components/schemas/AnnotationResponse'
AnnotationEventList:
type: array
items:
$ref: '#/components/schemas/AnnotationEvent'
AnnotationEvent:
allOf:
- $ref: '#/components/schemas/Annotation'
- type: object
properties:
stream:
type: string
id:
type: string
AnnotationCreateList:
type: array
items:
$ref: '#/components/schemas/AnnotationCreate'
AnnotationCreate:
allOf:
- $ref: '#/components/schemas/Annotation'
- type: object
properties:
stream:
type: string
Annotation:
type: object
properties:
summary:
type: string
message:
type: string
stickers:
type: object
additionalProperties:
type: string
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
AnnotationResponse:
type: object
properties:
id:
type: string
summary:
type: string
message:
type: string
stickers:
type: object
additionalProperties:
type: string
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
StreamListFilter:
allOf:
- $ref: '#/components/schemas/BasicFilter'
- type: object
properties:
streamIncludes:
type: array
items:
type: string
allStreams:
type: boolean
StreamDeleteFilter:
type: object
properties:
stream:
type: string
StreamList:
type: array
items:
$ref: '#/components/schemas/ReadStream'
Stream:
type: object
properties:
stream:
type: string
description:
type: string
ReadStream:
type: object
properties:
id:
type: string
stream:
type: string
description:
type: string
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
Error:
properties:
code:
description: code is the machine-readable error code.
readOnly: true
type: string
enum:
- internal error
- not implemented
- not found
- conflict
- invalid
- unprocessable entity
- empty value
- unavailable
- forbidden
- too many requests
- unauthorized
- method not allowed
- request too large
- unsupported media type
message:
readOnly: true
description: Human-readable message.
type: string
op:
readOnly: true
description: Describes the logical code operation when the error occurred. Useful for debugging.
type: string
err:
readOnly: true
description: Stack of errors that occurred during processing of the request. Useful for debugging.
type: string
required:
- code
responses:
NoContent:
description: No content
ServerError:
description: Non 2XX error response from server.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'