update apis to openapi3 where possible

This commit is contained in:
2020-07-26 18:22:48 +02:00
parent 5a8846e525
commit e334ec94a6
5 changed files with 496 additions and 661 deletions

View File

@@ -1,207 +1,210 @@
swagger: "2.0"
openapi: 3.0.3
info:
description: "This is the model-service interface of the Birbnetes system."
version: "1.0.1"
title: "Model Service"
title: Model Service
description: This is the model-service interface of the Birbnetes system.
contact:
email: "punkosdmarcell@rocketmail.com"
email: punkosdmarcell@rocketmail.com
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "dev.k8s.tcloud.enginner"
basePath: "/api/model/v1"
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.3
servers:
- url: https://dev.k8s.tcloud.enginner/api/model/v1
- url: http://dev.k8s.tcloud.enginner/api/model/v1
tags:
- name: "model"
description: "Model Service definition"
schemes:
- "https"
- "http"
- name: model
description: Model Service definition
paths:
/model:
get:
tags:
- "model"
summary: "Return a brief list of available models"
description: "Returns a brief list of available models"
operationId: "getModelList"
produces:
- "application/json"
- model
summary: Return a brief list of available models
description: Returns a brief list of available models
operationId: getModelList
responses:
200:
description: "A brief list of available models"
schema:
$ref: "#/definitions/BriefModelDetails"
description: A brief list of available models
content:
application/json:
schema:
$ref: '#/components/schemas/BriefModelDetails'
post:
tags:
- "model"
summary: "Uploads a new model into the service"
description: ""
operationId: "uploadFile"
consumes:
- "multipart/form-data"
produces:
- "application/json"
parameters:
- name: "info"
in: "formData"
description: "This is actually a UploadInfo but swagger 2.0 does not support that"
- model
summary: Uploads a new model into the service
operationId: uploadFile
requestBody:
content:
multipart/form-data:
schema:
required:
- file
- info
properties:
info:
type: string
description: This is actually a UploadInfo but swagger 2.0 does
not support that
file:
type: string
description: model
format: binary
required: true
type: "string"
- name: "file"
in: "formData"
description: "model"
required: true
type: "file"
responses:
201:
description: "Model successfully stored. This means that a get request for this object should be successful."
schema:
$ref: "#/definitions/ApiResponse"
description: Model successfully stored. This means that a get request for
this object should be successful.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
409:
description: "A model with this Id already exists"
schema:
$ref: "#/definitions/ApiResponse"
description: A model with this Id already exists
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
/model/{modelId}:
get:
tags:
- "model"
summary: "Download a model identified by Id"
description: "Returns a single model"
operationId: "getModelById"
produces:
- "application/json"
- "application/octet-stream"
- model
summary: Download a model identified by Id
description: Returns a single model
operationId: getModelById
parameters:
- name: "modelId"
in: "path"
description: "Id of the model to return or `$default` for the default"
- name: modelId
in: path
description: Id of the model to return or `$default` for the default
required: true
type: "string"
schema:
type: string
responses:
200:
description: "The requested model"
description: The requested model
content: {}
404:
description: "A model with this Id does not exist."
schema:
$ref: "#/definitions/ApiResponse"
description: A model with this Id does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
application/octet-stream:
schema:
$ref: '#/components/schemas/ApiResponse'
delete:
tags:
- "model"
summary: "Deletes a model identified by Id"
description: ""
operationId: "deleteModel"
produces:
- "application/json"
- model
summary: Deletes a model identified by Id
operationId: deleteModel
parameters:
- name: "modelId"
in: "path"
description: "Id of the model to delete"
- name: modelId
in: path
description: Id of the model to delete
required: true
type: "string"
schema:
type: string
responses:
204:
description: "Successful deletion"
description: Successful deletion
content: {}
404:
description: "An model with this Id does not exist."
schema:
$ref: "#/definitions/ApiResponse"
description: An model with this Id does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
/model/$default:
put:
tags:
- "model"
summary: "Updates the id of the default model"
description: "It really does"
operationId: "updateDefault"
produces:
- "application/json"
parameters:
- name: "modelId"
in: "body"
schema:
type: "object"
properties:
id:
type: "string"
- model
summary: Updates the id of the default model
description: It really does
operationId: updateDefault
requestBody:
content:
'*/*':
schema:
type: object
properties:
id:
type: string
required: false
responses:
204:
description: "Successful update"
description: Successful update
content: {}
404:
description: "The id does not identifies any model"
schema:
$ref: "#/definitions/ApiResponse"
description: The id does not identifies any model
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
x-codegen-request-body-name: modelId
/model/{modelId}/details:
get:
tags:
- "model"
summary: "Get the details of the model required for extraction"
description: "Returns a single object representing model details"
operationId: "getModelDetailsById"
produces:
- "application/json"
- model
summary: Get the details of the model required for extraction
description: Returns a single object representing model details
operationId: getModelDetailsById
parameters:
- name: "modelId"
in: "path"
description: "Id of the model to return the details of or `$default` for the default model"
- name: modelId
in: path
description: Id of the model to return the details of or `$default` for the
default model
required: true
type: "string"
schema:
type: string
responses:
200:
description: "The details of the requested model."
schema:
$ref: "#/definitions/ModelDetails"
description: The details of the requested model.
content:
application/json:
schema:
$ref: '#/components/schemas/ModelDetails'
404:
description: "A model with this id does not exist."
schema:
$ref: "#/definitions/ApiResponse"
definitions:
ApiResponse:
type: "object"
properties:
status:
type: "string"
msg:
type: "string"
UploadInfo:
type: "object"
properties:
type:
type: "string"
id:
type: "string"
BriefModelDetails:
type: array
items:
type: "object"
description: A model with this id does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
components:
schemas:
ApiResponse:
type: object
properties:
status:
type: string
msg:
type: string
BriefModelDetails:
type: array
items:
type: object
properties:
id:
type: string
default:
type: boolean
ModelDetails:
type: object
properties:
id:
type: string
timestamp:
type: string
default:
type: boolean
ModelDetails:
type: "object"
properties:
id:
type: string
timestamp:
type: string
default:
type: boolean
mid_window:
type: number
mid_step:
type: number
short_window:
type: number
short_step:
type: number
compute_beat:
type: boolean
type:
type: string
mid_window:
type: number
mid_step:
type: number
short_window:
type: number
short_step:
type: number
compute_beat:
type: boolean
type:
type: string