swagger-docs/backend.yml

377 lines
8.9 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'
/api/auth/signup:
put:
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:
$ref: '#/components/schemas/ApiResponse'
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:
$ref: '#/components/schemas/ApiResponse'
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/objects/streamerobject:
put:
tags:
- backend
summary: Creates a streamer resource
operationId: createResource
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectSimpleData'
required: true
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectData'
get:
tags:
- backend
summary: Gets all streamer resource
operationId: getResource
responses:
200:
description: Streamer resource data
content:
application/json:
schema:
$ref: '#/components/schemas/StreamerObjectArray'
/api/objects/streamerobject/{id}:
delete:
tags:
- backend
summary: Creates a streamer resource
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
summary: Creates a streamer resource
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'
post:
tags:
- backend
summary: Creates a streamer resource
operationId: editAResource
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/NeighbourseData'
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'
components:
schemas:
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
StreamerObjectSimpleData:
required:
- type
type: object
properties:
type:
type: string
enum:
- ingest
- encoder
- restream
inputNeighbours:
type: array
items:
type: string
format: uuid
outputNeighbours:
type: array
items:
type: string
format: uuid
NeighbourseData:
type: object
properties:
inputNeighbours:
type: array
items:
type: string
format: uuid
outputNeighbours:
type: array
items:
type: string
format: uuid
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