swagger-docs/backend.yml

679 lines
16 KiB
YAML
Raw Normal View History

2020-11-24 18:06:10 +01:00
openapi: 3.0.3
info:
title: videON Backend
description: Backend of videON
contact:
email: tormakristof@tormakristof.eu
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- url: https://videon.k8s.kmlabz.com
tags:
- name: backend
description: videON Backend interaction
paths:
/api/users:
get:
tags:
- backend
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:06:10 +01:00
summary: Get all users
operationId: getall
responses:
200:
description: Array of users
content:
application/json:
schema:
$ref: '#/components/schemas/UserMetadataResponse'
404:
description: No object matching filter
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
/api/users/{username}:
get:
tags:
- backend
summary: Get a user with a name
operationId: getauser
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:06:10 +01:00
parameters:
- name: username
in: path
description: Username of a user
required: true
schema:
type: string
responses:
200:
description: User's metadata
content:
application/json:
schema:
$ref: '#/components/schemas/UserMetadata'
404:
description: No object matching filter
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
delete:
tags:
- backend
summary: Delete a user
operationId: deleteuser
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:06:10 +01:00
parameters:
- name: username
in: path
description: Username of a user
required: true
schema:
type: string
responses:
200:
description: User's metadata
content:
application/json:
schema:
$ref: '#/components/schemas/UserMetadata'
404:
description: No object matching filter
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
2020-11-24 18:14:04 +01:00
put:
tags:
- backend
summary: Modifies a user
operationId: modifyUser
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:14:04 +01:00
parameters:
- name: username
in: path
description: Username of a user
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/UserMetadata'
400:
description: JSON parse error
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
417:
description: JSON invalid schema
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
2020-12-06 02:43:36 +01:00
/api/auth/me:
get:
tags:
- backend
security:
- bearerAuth: []
summary: Get current user data
operationId: getMe
responses:
200:
description: Array of users
content:
application/json:
schema:
$ref: '#/components/schemas/UserMetadataResponse'
404:
description: No object matching filter
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
2020-11-24 18:06:10 +01:00
/api/auth/signup:
2020-11-24 18:14:04 +01:00
post:
2020-11-24 18:06:10 +01:00
tags:
- backend
summary: Creates a user
operationId: createuser
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
200:
description: successful operation
content:
application/json:
schema:
2020-12-06 00:13:51 +01:00
$ref: '#/components/schemas/LoginToken'
2020-11-24 18:06:10 +01:00
400:
description: JSON parse error
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
417:
description: JSON invalid schema
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
/api/auth/login:
post:
tags:
- backend
summary: Logs on a user
operationId: logon
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
200:
description: successful operation
content:
application/json:
schema:
2020-11-24 20:01:56 +01:00
$ref: '#/components/schemas/LoginToken'
2020-11-24 18:06:10 +01:00
400:
description: JSON parse error
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
417:
description: JSON invalid schema
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
2020-11-24 18:50:25 +01:00
/api/objects/streamerobjects/ingest:
2020-11-24 18:14:04 +01:00
post:
2020-11-24 18:06:10 +01:00
tags:
- backend
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:50:25 +01:00
summary: Creates an ingest resource
operationId: createIngest
2020-11-24 18:06:10 +01:00
requestBody:
content:
application/json:
schema:
2020-11-24 18:50:25 +01:00
$ref: '#/components/schemas/IngestObjectNeighbors'
2020-11-24 18:06:10 +01:00
required: true
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectData'
2020-11-24 18:50:25 +01:00
/api/objects/streamerobjects/restream:
post:
tags:
- backend
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:50:25 +01:00
summary: Creates a restream resource
operationId: createRestream
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RestreamObjectParameters'
required: true
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectData'
/api/objects/streamerobjects/encode:
post:
tags:
- backend
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:50:25 +01:00
summary: Creates a encode resource
operationId: createEncode
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/EncodeObjectParameters'
required: true
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectData'
/api/objects/streamerobjects:
2020-11-24 18:06:10 +01:00
get:
tags:
- backend
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:50:25 +01:00
summary: Gets all streamer resources
2020-11-24 18:06:10 +01:00
operationId: getResource
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectArray'
2020-11-24 18:50:25 +01:00
/api/objects/streamerobjects/{id}:
2020-11-24 18:06:10 +01:00
delete:
tags:
- backend
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:14:04 +01:00
summary: Deletes a streamer resource
2020-11-24 18:06:10 +01:00
operationId: deleteResource
parameters:
- name: id
in: path
description: ID of a resource
required: true
schema:
type: string
format: uuid
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectData'
404:
description: ID not found
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
get:
tags:
- backend
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:14:04 +01:00
summary: Gets a streamer resource
2020-11-24 18:06:10 +01:00
operationId: getAResource
parameters:
- name: id
in: path
description: ID of a resource
required: true
schema:
type: string
format: uuid
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectData'
404:
description: ID not found
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
2020-12-05 11:24:01 +01:00
/api/objects/streamerobjects/ingest/{id}:
2020-11-24 18:14:04 +01:00
put:
2020-11-24 18:06:10 +01:00
tags:
- backend
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:53:25 +01:00
summary: Modifies an ingest resource
2020-12-05 11:24:01 +01:00
operationId: editIngest
2020-11-24 18:06:10 +01:00
requestBody:
content:
application/json:
schema:
2020-11-24 18:53:25 +01:00
$ref: '#/components/schemas/IngestObjectNeighbors'
2020-11-24 18:06:10 +01:00
required: true
parameters:
- name: id
in: path
description: ID of a resource
required: true
schema:
type: string
format: uuid
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectData'
404:
description: ID not found
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
2020-11-24 18:53:25 +01:00
/api/objects/streamerobjects/restream/{id}:
put:
tags:
- backend
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:53:25 +01:00
summary: Modifies a restream resource
operationId: editRestream
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RestreamObjectParameters'
required: true
parameters:
- name: id
in: path
description: ID of a resource
required: true
schema:
2020-11-24 18:50:25 +01:00
type: string
format: uuid
2020-11-24 18:53:25 +01:00
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectData'
404:
description: ID not found
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
/api/objects/streamerobjects/encode/{id}:
put:
tags:
- backend
2020-12-05 17:42:40 +01:00
security:
- bearerAuth: []
2020-11-24 18:53:25 +01:00
summary: Modifies an encode resource
operationId: editEncode
requestBody:
content:
application/json:
schema:
2020-11-24 22:29:30 +01:00
$ref: '#/components/schemas/EncodeObjectParameters'
2020-11-24 18:53:25 +01:00
required: true
parameters:
- name: id
in: path
description: ID of a resource
required: true
schema:
2020-11-24 18:50:25 +01:00
type: string
2020-11-24 18:53:25 +01:00
format: uuid
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
2020-12-05 17:42:40 +01:00
$ref: '#/components/schemas/StreamerObjectData'
404:
description: ID not found
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
/api/objects/streamerobjects/coordmodify/{id}:
put:
tags:
- backend
security:
- bearerAuth: []
summary: Modifies a resource coords
operationId: editCoords
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CoordParameters'
required: true
parameters:
- name: id
in: path
description: ID of a resource
required: true
schema:
type: string
format: uuid
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectData'
2020-11-24 18:53:25 +01:00
404:
description: ID not found
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
components:
schemas:
2020-11-24 18:06:10 +01:00
StreamerObjectData:
required:
- type
- url
- id
2020-11-25 03:50:56 +01:00
- x
- y
2020-11-24 18:06:10 +01:00
type: object
properties:
2020-12-06 19:59:20 +01:00
resource_type:
type: integer
minimum: 1
maximum: 3
2020-11-24 18:06:10 +01:00
url:
type: string
format: url
id:
type: string
format: uuid
2020-11-24 21:52:27 +01:00
inputNeighbour:
type: string
format: uuid
2020-11-25 03:32:23 +01:00
children:
2020-11-24 18:06:10 +01:00
type: array
items:
2020-11-25 03:45:00 +01:00
type: string
format: uuid
2020-11-25 03:32:23 +01:00
output_urls:
2020-11-24 18:50:25 +01:00
type: array
items:
2020-11-25 03:45:00 +01:00
type: string
2020-12-05 11:24:01 +01:00
steam_key:
type: string
format: uuid
2020-11-24 22:28:38 +01:00
bitrate:
type: integer
width:
type: integer
height:
type: integer
2020-11-25 03:50:56 +01:00
x:
type: integer
y:
type: integer
2020-11-24 18:50:25 +01:00
IngestObjectNeighbors:
required:
- outputNeighbours
type: object
properties:
outputNeighbours:
type: array
items:
type: string
format: uuid
2020-11-25 03:50:56 +01:00
x:
type: integer
y:
type: integer
2020-11-24 20:01:56 +01:00
LoginToken:
required:
- token
type: object
properties:
token:
type: string
2020-11-24 18:50:25 +01:00
RestreamObjectParameters:
2020-11-24 18:06:10 +01:00
required:
2020-11-24 18:50:25 +01:00
- inputNeighbours
- outputURLs
2020-11-25 03:50:56 +01:00
- x
- y
2020-11-24 18:06:10 +01:00
type: object
properties:
2020-11-24 21:51:24 +01:00
inputNeighbour:
type: string
format: uuid
2020-11-24 18:50:25 +01:00
outputURLs:
2020-11-24 18:06:10 +01:00
type: array
items:
type: string
2020-11-24 18:50:25 +01:00
format: url
2020-11-25 03:50:56 +01:00
x:
type: integer
y:
type: integer
2020-11-24 18:50:25 +01:00
EncodeObjectParameters:
required:
- inputNeighbours
- outputNeighbours
2020-11-24 22:28:38 +01:00
- bitrate
- width
- height
2020-11-25 03:50:56 +01:00
- x
- y
2020-11-24 18:06:10 +01:00
type: object
properties:
2020-11-24 21:51:24 +01:00
inputNeighbour:
type: string
format: uuid
2020-11-24 18:06:10 +01:00
outputNeighbours:
type: array
items:
type: string
format: uuid
2020-11-24 22:28:38 +01:00
bitrate:
type: integer
width:
type: integer
height:
type: integer
2020-11-25 03:50:56 +01:00
x:
type: integer
y:
type: integer
2020-11-24 18:06:10 +01:00
StreamerObjectArray:
type: array
items:
$ref: '#/components/schemas/StreamerObjectData'
UserMetadataResponse:
type: array
items:
$ref: '#/components/schemas/UserMetadata'
User:
required:
- name
- password
type: object
properties:
name:
type: string
password:
type: string
UserMetadata:
required:
- name
type: object
properties:
name:
type: string
creation_date:
type: string
format: date
last_logon:
type: string
format: date
2020-11-24 23:50:36 +01:00
stream_resources:
type: array
items:
$ref: '#/components/schemas/StreamerObjectData'
2020-11-24 18:06:10 +01:00
ApiResponse:
required:
- message
- status
type: object
properties:
status:
type: string
message:
2020-12-05 17:42:40 +01:00
type: string
CoordParameters:
required:
- x
- y
type: object
properties:
x:
type: integer
y:
type: integer
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT