swagger-docs/storage.yml

106 lines
2.7 KiB
YAML
Raw Normal View History

2020-03-17 17:07:51 +01:00
openapi: 3.0.0
info:
title: Sound storage as object
version: 1.1.1
2020-03-17 17:07:51 +01:00
servers:
2020-03-17 17:09:30 +01:00
- url: https://dev.k8s.tcloud.enginner/api/storage/v1
2020-03-17 17:07:51 +01:00
paths:
/object:
post:
summary: Upload sound file for storage
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
description:
2020-03-24 17:20:03 +01:00
type: object
2020-03-20 20:08:06 +01:00
properties:
tag:
type: string
2020-03-17 17:07:51 +01:00
soundFile:
type: string
format: binary
responses:
'200':
description: Object successfully stored. This means that a get request for this object should be successful.
2020-03-17 17:07:51 +01:00
content:
application/json:
schema:
$ref: '#/components/schemas/Success'
'409':
description: An object with this Tag already exists
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/object/{tag}:
get:
summary: Get a sound file from the storage
parameters:
- in: path
name: tag
schema:
type: string
required: true
description: Tag of the sound file to get
responses:
'200':
description: "The audio file requested"
content:
audio/wave:
schema:
type: string
format: binary
'404':
description: "Unknown tag error"
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2020-03-17 17:07:51 +01:00
delete:
summary: Deletes a sound file from the storage
parameters:
- in: path
name: tag
schema:
type: string
required: true
description: Tag of the sound file to delete
responses:
'200':
description: "The audio file successfully deleted."
content:
application/json:
schema:
$ref: '#/components/schemas/Success'
'404':
description: "Unknown tag error"
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2020-03-17 17:07:51 +01:00
components:
schemas:
Success:
2020-03-17 17:07:51 +01:00
properties:
status:
type: string
description: "Status message from backend."
required:
- status
Error:
properties:
status:
type: string
description: "Status message from backend."
msg:
type: string
description: "Human-readable description of the error"
2020-03-17 17:07:51 +01:00
required:
2020-03-20 20:08:06 +01:00
- status