swagger-docs/backend.yml

547 lines
13 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
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
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
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
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-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-11-24 18:14:04 +01:00
$ref: '#/components/schemas/UserMetadata'
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-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
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
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-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-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-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-11-24 18:53:25 +01:00
/api/objects/streamerobjects/ingress/{id}:
2020-11-24 18:14:04 +01:00
put:
2020-11-24 18:06:10 +01:00
tags:
- backend
2020-11-24 18:53:25 +01:00
summary: Modifies an ingest resource
operationId: editIngress
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
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
summary: Modifies an encode resource
operationId: editEncode
requestBody:
content:
application/json:
schema:
2020-11-24 21:51:24 +01:00
$ref: '#/components/schemas/RestreamObjectParameters'
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-11-24 21:51:24 +01:00
$ref: '#/components/schemas/EncodeObjectParameters'
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
type: object
properties:
type:
type: string
enum:
- ingest
- encoder
- restream
url:
type: string
format: url
id:
type: string
format: uuid
inputNeighbours:
type: array
items:
type: string
format: uuid
outputNeighbours:
type: array
items:
type: string
format: uuid
2020-11-24 18:50:25 +01:00
outputURLs:
type: array
items:
type: string
format: url
2020-11-24 21:51:24 +01:00
ffmpeg_args:
type: string
2020-11-24 18:50:25 +01:00
IngestObjectNeighbors:
required:
- outputNeighbours
type: object
properties:
outputNeighbours:
type: array
items:
type: string
format: uuid
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-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
EncodeObjectParameters:
required:
- inputNeighbours
- outputNeighbours
2020-11-24 21:51:24 +01:00
- ffmpeg_args
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 21:51:24 +01:00
ffmpeg_args:
type: string
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
ApiResponse:
required:
- message
- status
type: object
properties:
status:
type: string
message:
type: string