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: info:
title: Sound storage as object description: "This is the internal storage interface of the Birbnetes system."
version: 1.1.1 version: "1.1.2"
servers: title: "Storage Service"
- url: https://dev.k8s.tcloud.enginner/api/storage/v1 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: paths:
/object: /object:
post: post:
summary: Upload sound file for storage tags:
requestBody: - "storage"
content: summary: "uploads an object into the service"
multipart/form-data: description: ""
schema: operationId: "uploadFile"
type: object consumes:
properties: - "multipart/form-data"
description: produces:
type: object - "application/json"
properties: parameters:
tag: - name: "tag"
type: string in: "formData"
soundFile: description: "Tag of sound file"
type: string required: true
format: binary type: "string"
- name: "file"
in: "formData"
description: "Wave file to upload"
required: true
type: "file"
responses: responses:
'200': 200:
description: Object successfully stored. This means that a get request for this object should be successful. description: "Object successfully stored. This means that a get request for this object should be successful."
content: schema:
application/json: $ref: "#/definitions/ApiResponse"
schema: 409:
$ref: '#/components/schemas/Success' description: "An object with this Tag already exists"
'409': schema:
description: An object with this Tag already exists $ref: "#/definitions/ApiResponse"
content: /object/{objectTag}:
application/json:
schema:
$ref: '#/components/schemas/Error'
/object/{tag}:
get: 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: parameters:
- in: path - name: "objectTag"
name: tag in: "path"
schema: description: "Tag of wave file to return"
type: string required: true
required: true type: "string"
description: Tag of the sound file to get
responses: responses:
'200': 200:
description: "The audio file requested" description: "The requested audio file."
content: 404:
audio/wave: description: "An object with this Tag does not exist."
schema: schema:
type: string $ref: "#/definitions/ApiResponse"
format: binary
'404':
description: "Unknown tag error"
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete: delete:
summary: Deletes a sound file from the storage tags:
- "storage"
summary: "Deletes a wave file"
description: ""
operationId: "deleteWave"
produces:
- "application/json"
parameters: parameters:
- in: path - name: "objectTag"
name: tag in: "path"
schema: description: "Tag of wave file to delete"
type: string required: true
required: true type: "string"
description: Tag of the sound file to delete
responses: responses:
'200': 200:
description: "The audio file successfully deleted." description: "Successful deletion"
content: 404:
application/json: description: "An object with this Tag does not exist."
schema: schema:
$ref: '#/components/schemas/Success' $ref: "#/definitions/ApiResponse"
'404': definitions:
description: "Unknown tag error" ApiResponse:
content: type: "object"
application/json: properties:
schema: status:
$ref: '#/components/schemas/Error' type: "string"
components: msg:
schemas: type: "string"
Success:
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"
required:
- status