176 lines
4.4 KiB
YAML
176 lines
4.4 KiB
YAML
|
swagger: "2.0"
|
||
|
info:
|
||
|
description: "This is the model-service interface of the Birbnetes system."
|
||
|
version: "1.0.0"
|
||
|
title: "Model Service"
|
||
|
contact:
|
||
|
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"
|
||
|
tags:
|
||
|
- name: "model"
|
||
|
description: "Model Service definition"
|
||
|
schemes:
|
||
|
- "https"
|
||
|
- "http"
|
||
|
paths:
|
||
|
/model:
|
||
|
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"
|
||
|
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"
|
||
|
409:
|
||
|
description: "A model with this Id already exists"
|
||
|
schema:
|
||
|
$ref: "#/definitions/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"
|
||
|
parameters:
|
||
|
- name: "modelId"
|
||
|
in: "path"
|
||
|
description: "Id of the model to return or `$default` for the default"
|
||
|
required: true
|
||
|
type: "string"
|
||
|
responses:
|
||
|
200:
|
||
|
description: "The requested model"
|
||
|
404:
|
||
|
description: "A model with this Id does not exist."
|
||
|
schema:
|
||
|
$ref: "#/definitions/ApiResponse"
|
||
|
delete:
|
||
|
tags:
|
||
|
- "model"
|
||
|
summary: "Deletes a model identified by Id"
|
||
|
description: ""
|
||
|
operationId: "deleteModel"
|
||
|
produces:
|
||
|
- "application/json"
|
||
|
parameters:
|
||
|
- name: "modelId"
|
||
|
in: "path"
|
||
|
description: "Id of the model to delete"
|
||
|
required: true
|
||
|
type: "string"
|
||
|
responses:
|
||
|
204:
|
||
|
description: "Successful deletion"
|
||
|
404:
|
||
|
description: "An model with this Id does not exist."
|
||
|
schema:
|
||
|
$ref: "#/definitions/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"
|
||
|
responses:
|
||
|
204:
|
||
|
description: "Successful update"
|
||
|
404:
|
||
|
description: "The id does not identifies any model"
|
||
|
schema:
|
||
|
$ref: "#/definitions/ApiResponse"
|
||
|
|
||
|
|
||
|
/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"
|
||
|
parameters:
|
||
|
- name: "modelId"
|
||
|
in: "path"
|
||
|
description: "Id of the model to return the details of or `$default` for the default model"
|
||
|
required: true
|
||
|
type: "string"
|
||
|
responses:
|
||
|
200:
|
||
|
description: "The details of the requested model."
|
||
|
schema:
|
||
|
$ref: "#/definitions/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"
|
||
|
ModelDetails:
|
||
|
type: "object"
|
||
|
properties:
|
||
|
mid_window:
|
||
|
type: number
|
||
|
mid_step:
|
||
|
type: number
|
||
|
short_window:
|
||
|
type: number
|
||
|
short_step:
|
||
|
type: number
|
||
|
compute_beat:
|
||
|
type: number
|
||
|
type:
|
||
|
type: string
|