aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--support/doc/api/openapi.yaml698
1 files changed, 694 insertions, 4 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index 0bf168044..4230fc827 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -274,7 +274,7 @@ tags:
274 description: Operations on video files 274 description: Operations on video files
275 - name: Video Transcoding 275 - name: Video Transcoding
276 description: Video transcoding related operations 276 description: Video transcoding related operations
277 - name: Video stats 277 - name: Video Stats
278 description: Video statistics 278 description: Video statistics
279 - name: Video Feeds 279 - name: Video Feeds
280 description: Server syndication feeds of videos 280 description: Server syndication feeds of videos
@@ -297,6 +297,9 @@ tags:
297 - name: Stats 297 - name: Stats
298 description: | 298 description: |
299 Statistics 299 Statistics
300 - name: Runner Registration Token
301 description: |
302 Manage runner registration token
300 303
301x-tagGroups: 304x-tagGroups:
302 - name: Static endpoints 305 - name: Static endpoints
@@ -353,6 +356,12 @@ x-tagGroups:
353 - Stats 356 - Stats
354 - Logs 357 - Logs
355 - Job 358 - Job
359 - name: Remote Jobs
360 tags:
361 - Runner Registration Token
362 - Runner Jobs
363 - Runners
364
356paths: 365paths:
357 '/static/webseed/{filename}': 366 '/static/webseed/{filename}':
358 get: 367 get:
@@ -806,9 +815,15 @@ paths:
806 content: 815 content:
807 'application/json': 816 'application/json':
808 schema: 817 schema:
809 type: array 818 type: object
810 items: 819 properties:
811 $ref: '#/components/schemas/Account' 820 total:
821 type: integer
822 example: 1
823 data:
824 type: array
825 items:
826 $ref: '#/components/schemas/Account'
812 827
813 /api/v1/config: 828 /api/v1/config:
814 get: 829 get:
@@ -5469,6 +5484,443 @@ paths:
5469 '204': 5484 '204':
5470 description: successful operation 5485 description: successful operation
5471 5486
5487 /api/v1/runners/registration-tokens/generate:
5488 post:
5489 summary: Generate registration token
5490 description: Generate a new runner registration token
5491 security:
5492 - OAuth2:
5493 - admin
5494 tags:
5495 - Runner Registration Token
5496 responses:
5497 '204':
5498 description: successful operation
5499
5500 /api/v1/runners/registration-tokens/{registrationTokenId}:
5501 delete:
5502 summary: Remove registration token
5503 description: Remove a registration token. Runners that used this token for their registration are automatically removed.
5504 security:
5505 - OAuth2:
5506 - admin
5507 tags:
5508 - Runner Registration Token
5509 parameters:
5510 - $ref: '#/components/parameters/registrationTokenId'
5511 responses:
5512 '204':
5513 description: successful operation
5514
5515 /api/v1/runners/registration-tokens:
5516 get:
5517 summary: List registration tokens
5518 security:
5519 - OAuth2:
5520 - admin
5521 tags:
5522 - Runner Registration Token
5523 parameters:
5524 - $ref: '#/components/parameters/start'
5525 - $ref: '#/components/parameters/count'
5526 - $ref: '#/components/parameters/registrationTokenSort'
5527 responses:
5528 '200':
5529 description: successful operation
5530 content:
5531 application/json:
5532 schema:
5533 type: object
5534 properties:
5535 total:
5536 type: integer
5537 example: 1
5538 data:
5539 type: array
5540 items:
5541 $ref: '#/components/schemas/RunnerRegistrationToken'
5542
5543 /api/v1/runners/register:
5544 post:
5545 summary: Register a new runner
5546 description: API used by PeerTube runners
5547 tags:
5548 - Runners
5549 requestBody:
5550 content:
5551 application/json:
5552 schema:
5553 type: object
5554 properties:
5555 registrationToken:
5556 type: string
5557 name:
5558 type: string
5559 description:
5560 type: string
5561 required:
5562 - registrationToken
5563 - name
5564 responses:
5565 '200':
5566 description: successful operation
5567 content:
5568 application/json:
5569 schema:
5570 type: object
5571 properties:
5572 id:
5573 type: integer
5574 description: Runner id
5575 runnerToken:
5576 type: string
5577
5578 /api/v1/runners/unregister:
5579 post:
5580 summary: Unregister a runner
5581 description: API used by PeerTube runners
5582 tags:
5583 - Runners
5584 requestBody:
5585 content:
5586 application/json:
5587 schema:
5588 type: object
5589 properties:
5590 runnerToken:
5591 type: string
5592 required:
5593 - runnerToken
5594 responses:
5595 '204':
5596 description: successful operation
5597
5598 /api/v1/runners/{runnerId}:
5599 delete:
5600 summary: Delete a runner
5601 security:
5602 - OAuth2:
5603 - admin
5604 tags:
5605 - Runners
5606 parameters:
5607 - $ref: '#/components/parameters/runnerId'
5608 requestBody:
5609 content:
5610 application/json:
5611 schema:
5612 type: object
5613 properties:
5614 runnerToken:
5615 type: string
5616 required:
5617 - runnerToken
5618 responses:
5619 '204':
5620 description: successful operation
5621
5622 /api/v1/runners:
5623 get:
5624 summary: List runners
5625 security:
5626 - OAuth2:
5627 - admin
5628 tags:
5629 - Runners
5630 parameters:
5631 - $ref: '#/components/parameters/start'
5632 - $ref: '#/components/parameters/count'
5633 - $ref: '#/components/parameters/runnerSort'
5634 responses:
5635 '200':
5636 description: successful operation
5637 content:
5638 application/json:
5639 schema:
5640 type: object
5641 properties:
5642 total:
5643 type: integer
5644 example: 1
5645 data:
5646 type: array
5647 items:
5648 $ref: '#/components/schemas/Runner'
5649
5650
5651 /api/v1/runners/jobs/request:
5652 post:
5653 summary: Request a new job
5654 description: API used by PeerTube runners
5655 tags:
5656 - Runner Jobs
5657 requestBody:
5658 content:
5659 application/json:
5660 schema:
5661 type: object
5662 properties:
5663 runnerToken:
5664 type: string
5665 required:
5666 - runnerToken
5667 responses:
5668 '200':
5669 description: successful operation
5670 content:
5671 application/json:
5672 schema:
5673 type: object
5674 properties:
5675 availableJobs:
5676 type: array
5677 items:
5678 type: object
5679 properties:
5680 uuid:
5681 $ref: '#/components/schemas/UUIDv4'
5682 type:
5683 $ref: '#/components/schemas/RunnerJobType'
5684 payload:
5685 $ref: '#/components/schemas/RunnerJobPayload'
5686
5687 /api/v1/runners/jobs/{jobUUID}/accept:
5688 post:
5689 summary: Accept job
5690 description: API used by PeerTube runners
5691 tags:
5692 - Runner Jobs
5693 parameters:
5694 - $ref: '#/components/parameters/jobUUID'
5695 requestBody:
5696 content:
5697 application/json:
5698 schema:
5699 type: object
5700 properties:
5701 runnerToken:
5702 type: string
5703 required:
5704 - runnerToken
5705 responses:
5706 '200':
5707 description: successful operation
5708 content:
5709 application/json:
5710 schema:
5711 type: object
5712 properties:
5713 job:
5714 allOf:
5715 - $ref: '#/components/schemas/RunnerJob'
5716 - type: object
5717 properties:
5718 jobToken:
5719 type: string
5720
5721 /api/v1/runners/jobs/{jobUUID}/abort:
5722 post:
5723 summary: Abort job
5724 description: API used by PeerTube runners
5725 tags:
5726 - Runner Jobs
5727 parameters:
5728 - $ref: '#/components/parameters/jobUUID'
5729 requestBody:
5730 content:
5731 application/json:
5732 schema:
5733 type: object
5734 properties:
5735 runnerToken:
5736 type: string
5737 jobToken:
5738 type: string
5739 reason:
5740 type: string
5741 description: Why the runner aborts this job
5742 required:
5743 - runnerToken
5744 - jobToken
5745 - reason
5746 responses:
5747 '204':
5748 description: successful operation
5749
5750 /api/v1/runners/jobs/{jobUUID}/update:
5751 post:
5752 summary: Update job
5753 description: API used by PeerTube runners
5754 tags:
5755 - Runner Jobs
5756 parameters:
5757 - $ref: '#/components/parameters/jobUUID'
5758 requestBody:
5759 content:
5760 application/json:
5761 schema:
5762 type: object
5763 properties:
5764 runnerToken:
5765 type: string
5766 jobToken:
5767 type: string
5768 progress:
5769 type: integer
5770 description: Update job progression percentage (optional)
5771 payload:
5772 anyOf:
5773 - type: object
5774 description: Provide live transcoding chunks update
5775 properties:
5776 type:
5777 type: string
5778 enum:
5779 - 'add-chunk'
5780 - 'remove-chunk'
5781 masterPlaylistFile:
5782 type: string
5783 format: binary
5784 resolutionPlaylistFile:
5785 type: string
5786 format: binary
5787 resolutionPlaylistFilename:
5788 type: string
5789 videoChunkFile:
5790 type: string
5791 format: binary
5792 videoChunkFilename:
5793 type: string
5794 required:
5795 - runnerToken
5796 - jobToken
5797 responses:
5798 '204':
5799 description: successful operation
5800
5801 /api/v1/runners/jobs/{jobUUID}/error:
5802 post:
5803 summary: Post job error
5804 description: API used by PeerTube runners
5805 tags:
5806 - Runner Jobs
5807 parameters:
5808 - $ref: '#/components/parameters/jobUUID'
5809 requestBody:
5810 content:
5811 application/json:
5812 schema:
5813 type: object
5814 properties:
5815 runnerToken:
5816 type: string
5817 jobToken:
5818 type: string
5819 message:
5820 type: string
5821 description: Why the runner failed to process this job
5822 required:
5823 - runnerToken
5824 - jobToken
5825 - message
5826 responses:
5827 '204':
5828 description: successful operation
5829
5830 /api/v1/runners/jobs/{jobUUID}/success:
5831 post:
5832 summary: Post job success
5833 description: API used by PeerTube runners
5834 tags:
5835 - Runner Jobs
5836 parameters:
5837 - $ref: '#/components/parameters/jobUUID'
5838 requestBody:
5839 content:
5840 application/json:
5841 schema:
5842 type: object
5843 properties:
5844 runnerToken:
5845 type: string
5846 jobToken:
5847 type: string
5848 payload:
5849 anyOf:
5850 - type: object
5851 title: VOD web video transcoding
5852 properties:
5853 videoFile:
5854 type: string
5855 format: binary
5856 - type: object
5857 title: VOD HLS transcoding
5858 properties:
5859 videoFile:
5860 type: string
5861 format: binary
5862 resolutionPlaylistFile:
5863 type: string
5864 format: binary
5865 - type: object
5866 title: VOD audio merge transcoding
5867 properties:
5868 videoFile:
5869 type: string
5870 format: binary
5871 - type: object
5872 title: Live RTMP to HLS transcoding
5873 required:
5874 - runnerToken
5875 - jobToken
5876 - payload
5877 responses:
5878 '204':
5879 description: successful operation
5880
5881 /api/v1/runners/jobs/{jobUUID}/cancel:
5882 get:
5883 summary: Cancel a job
5884 security:
5885 - OAuth2:
5886 - admin
5887 tags:
5888 - Runner Jobs
5889 parameters:
5890 - $ref: '#/components/parameters/jobUUID'
5891 responses:
5892 '204':
5893 description: successful operation
5894
5895 /api/v1/runners/jobs:
5896 get:
5897 summary: List jobs
5898 security:
5899 - OAuth2:
5900 - admin
5901 tags:
5902 - Runner Jobs
5903 parameters:
5904 - $ref: '#/components/parameters/start'
5905 - $ref: '#/components/parameters/count'
5906 - $ref: '#/components/parameters/runnerJobSort'
5907 - $ref: '#/components/parameters/search'
5908 responses:
5909 '200':
5910 description: successful operation
5911 content:
5912 application/json:
5913 schema:
5914 type: object
5915 properties:
5916 total:
5917 type: integer
5918 example: 1
5919 data:
5920 type: array
5921 items:
5922 $ref: '#/components/schemas/RunnerJobAdmin'
5923
5472servers: 5924servers:
5473 - url: 'https://peertube2.cpy.re' 5925 - url: 'https://peertube2.cpy.re'
5474 description: Live Test Server (live data - latest nightly version) 5926 description: Live Test Server (live data - latest nightly version)
@@ -5650,6 +6102,37 @@ components:
5650 type: string 6102 type: string
5651 enum: 6103 enum:
5652 - createdAt 6104 - createdAt
6105 registrationTokenSort:
6106 name: sort
6107 in: query
6108 required: false
6109 description: Sort registration tokens by criteria
6110 schema:
6111 type: string
6112 enum:
6113 - createdAt
6114 runnerSort:
6115 name: sort
6116 in: query
6117 required: false
6118 description: Sort runners by criteria
6119 schema:
6120 type: string
6121 enum:
6122 - createdAt
6123 runnerJobSort:
6124 name: sort
6125 in: query
6126 required: false
6127 description: Sort runner jobs by criteria
6128 schema:
6129 type: string
6130 enum:
6131 - updatedAt
6132 - createdAt
6133 - priority
6134 - state
6135 - progress
5653 6136
5654 name: 6137 name:
5655 name: name 6138 name: name
@@ -6000,6 +6483,24 @@ components:
6000 required: false 6483 required: false
6001 schema: 6484 schema:
6002 $ref: '#/components/schemas/VideoPlaylistTypeSet' 6485 $ref: '#/components/schemas/VideoPlaylistTypeSet'
6486 registrationTokenId:
6487 name: registrationTokenId
6488 in: path
6489 required: true
6490 schema:
6491 type: integer
6492 runnerId:
6493 name: runnerId
6494 in: path
6495 required: true
6496 schema:
6497 type: integer
6498 jobUUID:
6499 name: jobUUID
6500 in: path
6501 required: true
6502 schema:
6503 $ref: '#/components/schemas/UUIDv4'
6003 6504
6004 securitySchemes: 6505 securitySchemes:
6005 OAuth2: 6506 OAuth2:
@@ -8902,6 +9403,195 @@ components:
8902 - uploadedBytesP2P 9403 - uploadedBytesP2P
8903 - videoId 9404 - videoId
8904 9405
9406 RunnerRegistrationToken:
9407 properties:
9408 id:
9409 type: integer
9410 registrationToken:
9411 type: string
9412 createdAt:
9413 type: string
9414 format: date-time
9415 updatedAt:
9416 type: string
9417 format: date-time
9418 registeredRunnersCount:
9419 type: integer
9420
9421 Runner:
9422 properties:
9423 id:
9424 type: integer
9425 name:
9426 type: string
9427 description:
9428 type: string
9429 ip:
9430 type: string
9431 updatedAt:
9432 type: string
9433 format: date-time
9434 createdAt:
9435 type: string
9436 format: date-time
9437 lastContact:
9438 type: string
9439 format: date-time
9440
9441 RunnerJobType:
9442 type: string
9443 enum:
9444 - vod-web-video-transcoding
9445 - vod-hls-transcoding
9446 - vod-audio-merge-transcoding
9447 - live-rtmp-hls-transcoding
9448
9449 RunnerJobState:
9450 type: integer
9451 enum:
9452 - 1
9453 - 2
9454 - 3
9455 - 4
9456 - 5
9457 - 6
9458 - 7
9459 - 8
9460 description: >
9461 The runner job state:
9462 - `1` Pending
9463 - `2` Processing
9464 - `3` Completed
9465 - `4` Errored
9466 - `5` Waiting for a parent job
9467 - `6` Cancelled
9468 - `7` Parent had an error
9469 - `8` Parent has been cancelled
9470
9471 RunnerJobStateConstant:
9472 type: object
9473 properties:
9474 id:
9475 $ref: '#/components/schemas/RunnerJobState'
9476 label:
9477 type: string
9478 example: 'Processing'
9479
9480 RunnerJobPayload:
9481 anyOf:
9482 - type: object
9483 title: VOD web video transcoding
9484 properties:
9485 input:
9486 type: object
9487 properties:
9488 videoFileUrl:
9489 type: string
9490 output:
9491 type: object
9492 properties:
9493 resolution:
9494 type: number
9495 fps:
9496 type: number
9497 - type: object
9498 title: VOD HLS transcoding
9499 properties:
9500 input:
9501 type: object
9502 properties:
9503 videoFileUrl:
9504 type: string
9505 output:
9506 type: object
9507 properties:
9508 resolution:
9509 type: number
9510 fps:
9511 type: number
9512 - type: object
9513 title: VOD audio merge transcoding
9514 properties:
9515 input:
9516 type: object
9517 properties:
9518 audioFileUrl:
9519 type: string
9520 previewFileUrl:
9521 type: string
9522 output:
9523 type: object
9524 properties:
9525 resolution:
9526 type: number
9527 fps:
9528 type: number
9529
9530 RunnerJob:
9531 properties:
9532 uuid:
9533 $ref: '#/components/schemas/UUIDv4'
9534 type:
9535 $ref: '#/components/schemas/RunnerJobType'
9536 state:
9537 $ref: '#/components/schemas/RunnerJobStateConstant'
9538 payload:
9539 $ref: '#/components/schemas/RunnerJobPayload'
9540 failures:
9541 type: integer
9542 description: Number of times a remote runner failed to process this job. After too many failures, the job in "error" state
9543 error:
9544 nullable: true
9545 type: string
9546 description: Error message if the job is errored
9547 progress:
9548 type: integer
9549 description: Percentage progress
9550 priority:
9551 type: integer
9552 description: Job priority (less has more priority)
9553 updatedAt:
9554 type: string
9555 format: date-time
9556 createdAt:
9557 type: string
9558 format: date-time
9559 startedAt:
9560 type: string
9561 format: date-time
9562 finishedAt:
9563 type: string
9564 format: date-time
9565 parent:
9566 nullable: true
9567 description: If job has a parent job
9568 type: object
9569 properties:
9570 type:
9571 $ref: '#/components/schemas/RunnerJobType'
9572 state:
9573 $ref: '#/components/schemas/RunnerJobStateConstant'
9574 uuid:
9575 $ref: '#/components/schemas/UUIDv4'
9576 runner:
9577 nullable: true
9578 description: If job is associated to a runner
9579 properties:
9580 id:
9581 type: number
9582 name:
9583 type: string
9584 description:
9585 type: string
9586
9587 RunnerJobAdmin:
9588 allOf:
9589 - $ref: '#/components/schemas/RunnerJob'
9590 - type: object
9591 properties:
9592 privatePayload:
9593 type: object
9594
8905 callbacks: 9595 callbacks:
8906 searchIndex: 9596 searchIndex:
8907 'https://search.example.org/api/v1/search/videos': 9597 'https://search.example.org/api/v1/search/videos':