-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
724 lines (683 loc) · 15.9 KB
/
openapi.yaml
File metadata and controls
724 lines (683 loc) · 15.9 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
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
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
openapi: 3.1.0
info:
title: WebEncode API
description: |
WebEncode is a distributed video encoding platform that provides VOD transcoding,
live streaming management, and multi-platform publishing capabilities.
## Authentication
All API endpoints require authentication via Bearer token in the Authorization header.
Use the Auth Plugin to obtain tokens.
## Rate Limiting
API requests are rate limited to 100 requests per minute per IP address.
Exceeding this limit will result in a 429 Too Many Requests response.
version: 1.0.0
contact:
name: WebEncode Team
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
- url: http://localhost:8090
description: Local development
- url: https://api.webencode.example.com
description: Production
tags:
- name: Jobs
description: VOD encoding job management
- name: Streams
description: Live stream management
- name: Restreams
description: Restream/republish job management
- name: Workers
description: Worker node management
- name: Profiles
description: Encoding profile management
- name: Plugins
description: Plugin configuration
- name: Webhooks
description: Webhook management
- name: System
description: System health and stats
- name: Events
description: Server-Sent Events for real-time updates
paths:
/v1/jobs:
get:
tags: [Jobs]
summary: List all jobs
parameters:
- name: limit
in: query
schema:
type: integer
default: 100
- name: offset
in: query
schema:
type: integer
default: 0
responses:
'200':
description: List of jobs
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Job'
post:
tags: [Jobs]
summary: Create a new encoding job
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateJobRequest'
responses:
'201':
description: Job created
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
'400':
description: Invalid request
/v1/jobs/{id}:
get:
tags: [Jobs]
summary: Get job by ID
parameters:
- $ref: '#/components/parameters/JobId'
responses:
'200':
description: Job details
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
'404':
description: Job not found
delete:
tags: [Jobs]
summary: Delete a job
parameters:
- $ref: '#/components/parameters/JobId'
responses:
'204':
description: Job deleted
'404':
description: Job not found
/v1/jobs/{id}/cancel:
post:
tags: [Jobs]
summary: Cancel a running job
parameters:
- $ref: '#/components/parameters/JobId'
responses:
'200':
description: Job cancelled
'404':
description: Job not found
'409':
description: Job cannot be cancelled (already completed/failed)
/v1/streams:
get:
tags: [Streams]
summary: List all streams
responses:
'200':
description: List of streams
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Stream'
post:
tags: [Streams]
summary: Create a new stream
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateStreamRequest'
responses:
'201':
description: Stream created
content:
application/json:
schema:
$ref: '#/components/schemas/Stream'
/v1/streams/{id}:
get:
tags: [Streams]
summary: Get stream by ID
parameters:
- $ref: '#/components/parameters/StreamId'
responses:
'200':
description: Stream details
content:
application/json:
schema:
$ref: '#/components/schemas/Stream'
'404':
description: Stream not found
/v1/workers:
get:
tags: [Workers]
summary: List all workers
responses:
'200':
description: List of workers
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Worker'
/v1/profiles:
get:
tags: [Profiles]
summary: List encoding profiles
responses:
'200':
description: List of profiles
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/EncodingProfile'
post:
tags: [Profiles]
summary: Create encoding profile
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateProfileRequest'
responses:
'201':
description: Profile created
/v1/profiles/{id}:
get:
tags: [Profiles]
summary: Get profile by ID
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: Profile details
'404':
description: Profile not found
delete:
tags: [Profiles]
summary: Delete profile
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'204':
description: Profile deleted
/v1/restreams:
get:
tags: [Restreams]
summary: List restream jobs
responses:
'200':
description: List of restream jobs
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RestreamJob'
post:
tags: [Restreams]
summary: Create restream job
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateRestreamRequest'
responses:
'201':
description: Restream job created
/v1/restreams/{id}/start:
post:
tags: [Restreams]
summary: Start a restream job
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Restream started
/v1/restreams/{id}/stop:
post:
tags: [Restreams]
summary: Stop a restream job
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Restream stopped
/v1/webhooks:
get:
tags: [Webhooks]
summary: List webhooks
responses:
'200':
description: List of webhooks
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Webhook'
post:
tags: [Webhooks]
summary: Create webhook
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateWebhookRequest'
responses:
'201':
description: Webhook created
/v1/plugins:
get:
tags: [Plugins]
summary: List plugins
responses:
'200':
description: List of plugins
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PluginConfig'
/v1/plugins/{id}/enable:
post:
tags: [Plugins]
summary: Enable a plugin
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: Plugin enabled
/v1/plugins/{id}/disable:
post:
tags: [Plugins]
summary: Disable a plugin
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: Plugin disabled
/v1/system/health:
get:
tags: [System]
summary: Health check
responses:
'200':
description: System health status
content:
application/json:
schema:
$ref: '#/components/schemas/HealthResponse'
/v1/system/stats:
get:
tags: [System]
summary: System statistics
responses:
'200':
description: System stats
content:
application/json:
schema:
$ref: '#/components/schemas/StatsResponse'
/v1/events:
get:
tags: [Events]
summary: Server-Sent Events stream
description: |
Opens a long-lived connection for real-time updates.
Events include job progress, stream status changes, etc.
responses:
'200':
description: SSE stream
content:
text/event-stream:
schema:
type: string
/v1/audit:
get:
tags: [System]
summary: List audit logs
responses:
'200':
description: Audit logs
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AuditLog'
components:
parameters:
JobId:
name: id
in: path
required: true
schema:
type: string
format: uuid
StreamId:
name: id
in: path
required: true
schema:
type: string
format: uuid
schemas:
Job:
type: object
properties:
id:
type: string
format: uuid
source_url:
type: string
profiles:
type: array
items:
type: string
status:
type: string
enum: [queued, processing, completed, failed, cancelled, stitching, uploading]
progress_pct:
type: integer
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
CreateJobRequest:
type: object
required:
- source_url
- profiles
properties:
source_url:
type: string
description: URL of the source video file
profiles:
type: array
items:
type: string
description: List of encoding profile IDs to apply
Stream:
type: object
properties:
id:
type: string
format: uuid
stream_key:
type: string
is_live:
type: boolean
title:
type: string
ingest_url:
type: string
playback_url:
type: string
created_at:
type: string
format: date-time
CreateStreamRequest:
type: object
properties:
title:
type: string
description:
type: string
archive_enabled:
type: boolean
Worker:
type: object
properties:
id:
type: string
hostname:
type: string
version:
type: string
status:
type: string
is_healthy:
type: boolean
last_seen:
type: string
format: date-time
capacity:
type: object
EncodingProfile:
type: object
properties:
id:
type: string
name:
type: string
video_codec:
type: string
audio_codec:
type: string
width:
type: integer
height:
type: integer
bitrate_kbps:
type: integer
preset:
type: string
container:
type: string
CreateProfileRequest:
type: object
required:
- name
- video_codec
properties:
name:
type: string
video_codec:
type: string
audio_codec:
type: string
width:
type: integer
height:
type: integer
bitrate_kbps:
type: integer
preset:
type: string
container:
type: string
RestreamJob:
type: object
properties:
id:
type: string
format: uuid
title:
type: string
input_url:
type: string
output_destinations:
type: array
items:
type: object
status:
type: string
created_at:
type: string
format: date-time
CreateRestreamRequest:
type: object
properties:
title:
type: string
input_url:
type: string
output_destinations:
type: array
items:
type: object
Webhook:
type: object
properties:
id:
type: string
format: uuid
url:
type: string
events:
type: array
items:
type: string
is_active:
type: boolean
created_at:
type: string
format: date-time
CreateWebhookRequest:
type: object
required:
- url
- events
properties:
url:
type: string
events:
type: array
items:
type: string
PluginConfig:
type: object
properties:
id:
type: string
plugin_type:
type: string
is_enabled:
type: boolean
config_json:
type: object
HealthResponse:
type: object
properties:
status:
type: string
enum: [healthy, degraded, unhealthy]
version:
type: string
services:
type: object
properties:
database:
type: string
nats:
type: string
storage:
type: string
StatsResponse:
type: object
properties:
jobs:
type: object
properties:
total:
type: integer
queued:
type: integer
processing:
type: integer
completed:
type: integer
failed:
type: integer
workers:
type: object
properties:
total:
type: integer
healthy:
type: integer
streams:
type: object
properties:
total:
type: integer
live:
type: integer
AuditLog:
type: object
properties:
id:
type: string
format: uuid
user_id:
type: string
format: uuid
action:
type: string
resource_type:
type: string
resource_id:
type: string
created_at:
type: string
format: date-time
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- bearerAuth: []