Update 'storage.yml'

This commit is contained in:
Torma Kristóf 2020-03-28 00:10:53 +01:00
parent 39d58ff2a9
commit 4824cd8ef9

View File

@ -1,106 +1,103 @@
openapi: 3.0.0
swagger: "2.0"
info:
title: Sound storage as object
version: 1.1.1
servers:
- url: https://dev.k8s.tcloud.enginner/api/storage/v1
description: "This is the internal storage interface of the Birbnetes system."
version: "1.1.2"
title: "Storage Service"
contact:
email: "tormakristof@tormakristof.eu"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "dev.k8s.tcloud.enginner"
basePath: "/api/storage/v1"
tags:
- name: "storage"
description: "Storage Service definition"
schemes:
- "https"
- "http"
paths:
/object:
post:
summary: Upload sound file for storage
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
description:
type: object
properties:
tag:
type: string
soundFile:
type: string
format: binary
tags:
- "storage"
summary: "uploads an object into the service"
description: ""
operationId: "uploadFile"
consumes:
- "multipart/form-data"
produces:
- "application/json"
parameters:
- name: "tag"
in: "formData"
description: "Tag of sound file"
required: true
type: "string"
- name: "file"
in: "formData"
description: "Wave file to upload"
required: true
type: "file"
responses:
'200':
description: Object successfully stored. This means that a get request for this object should be successful.
content:
application/json:
200:
description: "Object successfully stored. This means that a get request for this object should be successful."
schema:
$ref: '#/components/schemas/Success'
'409':
description: An object with this Tag already exists
content:
application/json:
$ref: "#/definitions/ApiResponse"
409:
description: "An object with this Tag already exists"
schema:
$ref: '#/components/schemas/Error'
/object/{tag}:
$ref: "#/definitions/ApiResponse"
/object/{objectTag}:
get:
summary: Get a sound file from the storage
tags:
- "storage"
summary: "Find pet by ID"
description: "Returns a single pet"
operationId: "getPetById"
produces:
- "application/json"
- "audio/wave"
parameters:
- in: path
name: tag
schema:
type: string
- name: "objectTag"
in: "path"
description: "Tag of wave file to return"
required: true
description: Tag of the sound file to get
type: "string"
responses:
'200':
description: "The audio file requested"
content:
audio/wave:
200:
description: "The requested audio file."
404:
description: "An object with this Tag does not exist."
schema:
type: string
format: binary
'404':
description: "Unknown tag error"
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
$ref: "#/definitions/ApiResponse"
delete:
summary: Deletes a sound file from the storage
tags:
- "storage"
summary: "Deletes a wave file"
description: ""
operationId: "deleteWave"
produces:
- "application/json"
parameters:
- in: path
name: tag
schema:
type: string
- name: "objectTag"
in: "path"
description: "Tag of wave file to delete"
required: true
description: Tag of the sound file to delete
type: "string"
responses:
'200':
description: "The audio file successfully deleted."
content:
application/json:
200:
description: "Successful deletion"
404:
description: "An object with this Tag does not exist."
schema:
$ref: '#/components/schemas/Success'
$ref: "#/definitions/ApiResponse"
'404':
description: "Unknown tag error"
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
Success:
definitions:
ApiResponse:
type: "object"
properties:
status:
type: string
description: "Status message from backend."
required:
- status
Error:
properties:
status:
type: string
description: "Status message from backend."
type: "string"
msg:
type: string
description: "Human-readable description of the error"
required:
- status
type: "string"