update apis to openapi3 where possible

This commit is contained in:
Torma Kristóf 2020-07-26 18:22:48 +02:00
parent 5a8846e525
commit e334ec94a6
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
5 changed files with 496 additions and 661 deletions

View File

@ -1,58 +0,0 @@
swagger: "2.0"
info:
description: "This is the classification interface of the Birbnetes system."
version: "1.0.0"
title: "Classification 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/classification/v1"
tags:
- name: "classification"
description: "Classification Service interaction"
schemes:
- "https"
- "http"
paths:
/classify:
post:
tags:
- "classification"
summary: "Start classifying sample"
description: "This endpoint recieves the features extracted by the feature extractor"
operationId: "classify"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "modelId"
in: "body"
schema:
type: "object"
properties:
tag:
type: "string"
features:
type: "array"
items:
type: "number"
model:
type: "string"
responses:
200:
description: "Classification started"
schema:
$ref: "#/definitions/ApiResponse"
definitions:
ApiResponse:
type: "object"
properties:
status:
type: "string"
message:
type: "string"

View File

@ -1,235 +1,260 @@
swagger: "2.0"
openapi: 3.0.3
info:
description: "This service s responsible for controlling and handling information about IoT devices in the Birbnetes system."
version: "1.0.0"
title: "Command and Control Service"
title: Command and Control Service
description: This service s responsible for controlling and handling information
about IoT devices in the Birbnetes system.
contact:
email: "tormakristof@tormakristof.eu"
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/cnc/v1"
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- url: https://dev.k8s.tcloud.enginner/api/cnc/v1
- url: http://dev.k8s.tcloud.enginner/api/cnc/v1
tags:
- name: "cnc"
description: "Command and Control Service interaction"
schemes:
- "https"
- "http"
- name: cnc
description: Command and Control Service interaction
paths:
/device:
/devices:
get:
tags:
- cnc
summary: Get all device info
operationId: getall
responses:
200:
description: Array of devices
content:
application/json:
schema:
$ref: '#/components/schemas/ListOfDevices'
404:
description: No device found
content: {}
/devices/offline:
post:
tags:
- cnc
responses:
"200":
description: Array of devices
schema:
$ref: '#/definitions/ListOfDevices'
delete:
summary: Shut down all devices
operationId: offlineall
responses:
200:
description: Message sent
content: {}
500:
description: Message sending unsuccessful
content: {}
/devices/online:
post:
tags:
- cnc
responses:
"200":
description: Operation successful
"500":
description: Operation unsuccessful, rolled back successfully
"503":
description: Operation unsuccessful, rollback unsuccessful (system in inconsistent state)
post:
summary: Bring all devices online
operationId: onlineall
responses:
200:
description: Message sent
content: {}
500:
description: Message sending unsuccessful
content: {}
/devices/{deviceID}:
get:
tags:
- cnc
responses:
"200":
description: Operation successful
"500":
description: Operation unsuccessful, rolled back successfully
"503":
description: Operation unsuccessful, rollback unsuccessful (system in inconsistent state)
/device/{deviceID}:
get:
summary: Get all device info
parameters:
- in: path
name: deviceID
type: "string"
format: "uuid"
required: true
description: ID of device to query
operationId: getdevice
tags:
- cnc
parameters:
- name: deviceID
in: path
description: ID of device to query
required: true
schema:
type: string
format: uuid
responses:
"200":
200:
description: Information about a particular device
content:
application/json:
schema:
$ref: '#/definitions/Device'
"404":
$ref: '#/components/schemas/Device'
404:
description: Device not found
delete:
content: {}
/devices/{deviceID}/offline:
post:
tags:
- cnc
summary: Shut down device
parameters:
- in: path
name: deviceID
type: "string"
format: "uuid"
required: true
description: ID of device to shut down
operationId: offlinedevice
tags:
- cnc
responses:
"200":
description: Operation successful
"500":
description: Operation unsuccessful, rolled back successfully
"503":
description: Operation unsuccessful, rollback unsuccessful (device in errored state)
post:
summary: Bring device online
parameters:
- in: path
name: deviceID
type: "string"
format: "uuid"
- name: deviceID
in: path
description: ID of device to shut down
required: true
description: ID of device to bring online
operationId: onlinedevice
tags:
- cnc
responses:
"200":
description: Operation successful
"500":
description: Operation unsuccessful, rolled back successfully
"503":
description: Operation unsuccessful, rollback unsuccessful (device in errored state)
/device/{deviceID}/{sensorID}:
get:
summary: Get info about a particular device's sensor
parameters:
- in: path
name: deviceID
type: "string"
format: "uuid"
required: true
description: ID of device to query
- in: path
name: sensorID
type: "string"
format: "uuid"
required: true
description: ID of sensor to query
operationId: getsensor
tags:
- cnc
responses:
"200":
description: Information about a sensor
schema:
$ref: '#/definitions/Sensor'
"404":
description: Device or sensor not found
delete:
summary: Shut down sensor
parameters:
- in: path
name: deviceID
type: "string"
format: "uuid"
required: true
description: ID of device to query
- in: path
name: sensorID
type: "string"
format: "uuid"
required: true
description: ID of sensor to query
operationId: offlinesensor
tags:
- cnc
type: string
format: uuid
responses:
"200":
description: Operation successful
"500":
description: Operation unsuccessful, rolled back successfully
"503":
description: Operation unsuccessful, rollback unsuccessful (sensor in unknown state)
200:
description: Message sent
content: {}
500:
description: Message sending unsuccessful
content: {}
/devices/{deviceID}/online:
post:
summary: Bring sensor online
parameters:
- in: path
name: deviceID
type: "string"
format: "uuid"
required: true
description: ID of device to query
- in: path
name: sensorID
type: "string"
format: "uuid"
required: true
description: ID of sensor to query
operationId: onlinesensor
tags:
- cnc
summary: Bring device online
operationId: onlinedevice
parameters:
- name: deviceID
in: path
description: ID of device to bring online
required: true
schema:
type: string
format: uuid
responses:
"200":
description: Operation successful
"500":
description: Operation unsuccessful, rolled back successfully
"503":
description: Operation unsuccessful, rollback unsuccessful (sensor in unknown state)
definitions:
200:
description: Message sent
content: {}
500:
description: Message sending unsuccessful
content: {}
/devices/{deviceID}/{sensorID}:
get:
tags:
- cnc
summary: Get info about a particular device's sensor
operationId: getsensor
parameters:
- name: deviceID
in: path
description: ID of device to query
required: true
schema:
type: string
format: uuid
- name: sensorID
in: path
description: ID of sensor to query
required: true
schema:
type: string
format: uuid
responses:
200:
description: Information about a sensor
content:
application/json:
schema:
$ref: '#/components/schemas/Sensor'
404:
description: Device or sensor not found
content: {}
/devices/{deviceID}/{sensorID}/offline:
post:
tags:
- cnc
summary: Shut down sensor
operationId: offlinesensor
parameters:
- name: deviceID
in: path
description: ID of device to query
required: true
schema:
type: string
format: uuid
- name: sensorID
in: path
description: ID of sensor to query
required: true
schema:
type: string
format: uuid
responses:
200:
description: Message sent
content: {}
500:
description: Message sending unsuccessful
content: {}
/devices/{deviceID}/{sensorID}/online:
post:
tags:
- cnc
summary: Bring sensor online
operationId: onlinesensor
parameters:
- name: deviceID
in: path
description: ID of device to query
required: true
schema:
type: string
format: uuid
- name: sensorID
in: path
description: ID of sensor to query
required: true
schema:
type: string
format: uuid
responses:
200:
description: Message sent
content: {}
500:
description: Message sending unsuccessful
content: {}
components:
schemas:
ListOfDevices:
type: "array"
type: array
items:
$ref: "#/definitions/Device"
$ref: '#/components/schemas/Device'
Device:
type: "object"
properties:
id:
type: "string"
format: "uuid"
status:
type: "string"
enum: ["online", "error", "offline"]
url:
type: "string"
format: "url"
sensors:
$ref: '#/definitions/ArrayofSensors'
required:
- id
- sensors
- status
- url
- sensors
ArrayofSensors:
type: "array"
items:
$ref: "#/definitions/Sensor"
Sensor:
type: "object"
type: object
properties:
id:
type: "string"
format: "uuid"
type: string
format: uuid
status:
type: "string"
enum: ["online", "unknown", "offline"]
type: string
enum:
- online
- error
- offline
url:
type: string
format: url
sensors:
$ref: '#/components/schemas/ArrayofSensors'
ArrayofSensors:
type: array
items:
$ref: '#/components/schemas/Sensor'
Sensor:
required:
- id
- status
type: object
properties:
id:
type: string
format: uuid
status:
type: string
enum:
- online
- unknown
- offline

View File

@ -1,191 +1,194 @@
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"
description: A brief list of available models
content:
application/json:
schema:
$ref: "#/definitions/BriefModelDetails"
$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."
description: Model successfully stored. This means that a get request for
this object should be successful.
content:
application/json:
schema:
$ref: "#/definitions/ApiResponse"
$ref: '#/components/schemas/ApiResponse'
409:
description: "A model with this Id already exists"
description: A model with this Id already exists
content:
application/json:
schema:
$ref: "#/definitions/ApiResponse"
$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."
description: A model with this Id does not exist.
content:
application/json:
schema:
$ref: "#/definitions/ApiResponse"
$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."
description: An model with this Id does not exist.
content:
application/json:
schema:
$ref: "#/definitions/ApiResponse"
$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"
- model
summary: Updates the id of the default model
description: It really does
operationId: updateDefault
requestBody:
content:
'*/*':
schema:
type: "object"
type: object
properties:
id:
type: "string"
type: string
required: false
responses:
204:
description: "Successful update"
description: Successful update
content: {}
404:
description: "The id does not identifies any model"
description: The id does not identifies any model
content:
application/json:
schema:
$ref: "#/definitions/ApiResponse"
$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."
description: The details of the requested model.
content:
application/json:
schema:
$ref: "#/definitions/ModelDetails"
$ref: '#/components/schemas/ModelDetails'
404:
description: "A model with this id does not exist."
description: A model with this id does not exist.
content:
application/json:
schema:
$ref: "#/definitions/ApiResponse"
definitions:
$ref: '#/components/schemas/ApiResponse'
components:
schemas:
ApiResponse:
type: "object"
type: object
properties:
status:
type: "string"
type: string
msg:
type: "string"
UploadInfo:
type: "object"
properties:
type:
type: "string"
id:
type: "string"
type: string
BriefModelDetails:
type: array
items:
type: "object"
type: object
properties:
id:
type: string
default:
type: boolean
ModelDetails:
type: "object"
type: object
properties:
id:
type: string

View File

@ -1,155 +1,175 @@
swagger: "2.0"
openapi: 3.0.3
info:
description: "This is the feature extraction interface of the Birbnetes system."
version: "1.0.0"
title: "Output Service - RDB"
title: Output Service - RDB
description: This is the feature extraction interface of the Birbnetes system.
contact:
email: "tormakristof@tormakristof.eu"
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/result/rdb/v1"
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- url: https://dev.k8s.tcloud.enginner/api/result/rdb/v1
- url: http://dev.k8s.tcloud.enginner/api/result/rdb/v1
tags:
- name: "result"
description: "Output Service - RDB interaction"
schemes:
- "https"
- "http"
- name: result
description: Output Service - RDB interaction
paths:
/result:
get:
tags:
- result
summary: Get all decision objects
operationId: getall
tags:
- result
responses:
"200":
200:
description: Array of decision objects
content:
'application/JSON':
schema:
$ref: '#/definitions/ResultObjects'
"404":
$ref: '#/components/schemas/ResultObjects'
404:
description: No object matching filter
content:
'application/JSON':
schema:
$ref: '#/definitions/ApiResponse'
$ref: '#/components/schemas/ApiResponse'
/result/filter/negative:
get:
tags:
- result
summary: Get all negative decision objects
operationId: getallnegative
tags:
- result
responses:
"200":
200:
description: Array of decision objects
content:
'application/JSON':
schema:
$ref: '#/definitions/ResultObjects'
"404":
$ref: '#/components/schemas/ResultObjects'
404:
description: No object matching filter
content:
'application/JSON':
schema:
$ref: '#/definitions/ApiResponse'
$ref: '#/components/schemas/ApiResponse'
/result/filter/positive:
get:
tags:
- result
summary: Get positive decision objects
operationId: getallpositive
tags:
- result
responses:
"200":
200:
description: Array of decision objects
content:
'application/JSON':
schema:
$ref: '#/definitions/ResultObjects'
"404":
$ref: '#/components/schemas/ResultObjects'
404:
description: No object matching filter
content:
'application/JSON':
schema:
$ref: '#/definitions/ApiResponse'
$ref: '#/components/schemas/ApiResponse'
/result/after/{dateAfter}:
get:
summary: Get decision before a date
operationId: getallafter
tags:
- result
summary: Get decision before a date
operationId: getallafter
parameters:
- name: dateAfter
in: path
description: Date of filter
required: true
schema:
type: string
format: date
responses:
"200":
200:
description: Array of decision objects
content:
'application/JSON':
schema:
$ref: '#/definitions/ResultObjects'
"404":
$ref: '#/components/schemas/ResultObjects'
404:
description: No object matching filter
content:
'application/JSON':
schema:
$ref: '#/definitions/ApiResponse'
$ref: '#/components/schemas/ApiResponse'
/result/before/{dateBefore}:
get:
summary: Get decision before a date
operationId: getallbefore
tags:
- result
summary: Get decision before a date
operationId: getallbefore
parameters:
- name: dateBefore
in: path
description: Date of filter
required: true
schema:
type: string
format: date
responses:
"200":
200:
description: Array of decision objects
content:
'application/JSON':
schema:
$ref: '#/definitions/ResultObjects'
"404":
$ref: '#/components/schemas/ResultObjects'
404:
description: NO objects matching filter
content:
'application/JSON':
schema:
$ref: '#/definitions/ApiResponse'
$ref: '#/components/schemas/ApiResponse'
/result/{tagID}:
get:
summary: Get decision by ID
operationId: getDecision
tags:
- result
summary: Get decision by ID
operationId: getDecision
parameters:
- name: tagID
in: path
description: ID of wave file
required: true
schema:
type: integer
format: int32
responses:
"200":
200:
description: Decision object
content:
'application/JSON':
schema:
$ref: '#/definitions/ResultObject'
"404":
$ref: '#/components/schemas/ResultObject'
404:
description: Tag not found
content:
'application/JSON':
schema:
$ref: '#/definitions/ApiResponse'
definitions:
$ref: '#/components/schemas/ApiResponse'
components:
schemas:
ResultObjects:
type: array
items:
$ref: '#/definitions/ResultObject'
$ref: '#/components/schemas/ResultObject'
ResultObject:
type: "object"
type: object
properties:
tag:
type: "string"
type: string
probability:
type: "number"
type: number
ApiResponse:
type: "object"
type: object
properties:
status:
type: "string"
type: string
message:
type: "string"
type: string

View File

@ -1,155 +0,0 @@
swagger: "2.0"
info:
description: "This is the feature extraction interface of the Birbnetes system."
version: "1.0.0"
title: "Output Service - RDB"
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/result/rdb/v1"
tags:
- name: "result"
description: "Output Service - RDB interaction"
schemes:
- "https"
- "http"
paths:
/result:
get:
summary: Get all decision objects
operationId: getall
tags:
- result
responses:
"200":
description: Array of decision objects
schema:
$ref: '#/definitions/ResultObjects'
"404":
description: No object matching filter
schema:
$ref: '#/definitions/ApiResponse'
/result/filter/negative:
get:
summary: Get all negative decision objects
operationId: getallnegative
tags:
- result
responses:
"200":
description: Array of decision objects
schema:
$ref: '#/definitions/ResultObjects'
"404":
description: No object matching filter
schema:
$ref: '#/definitions/ApiResponse'
/result/filter/positive:
get:
summary: Get positive decision objects
operationId: getallpositive
tags:
- result
responses:
"200":
description: Array of decision objects
schema:
$ref: '#/definitions/ResultObjects'
"404":
description: No object matching filter
schema:
$ref: '#/definitions/ApiResponse'
/result/after/{dateAfter}:
get:
summary: Get decision before a date
operationId: getallafter
tags:
- result
parameters:
- name: dateAfter
in: path
description: Date of filter
required: true
type: string
format: date
responses:
"200":
description: Array of decision objects
schema:
$ref: '#/definitions/ResultObjects'
"404":
description: No object matching filter
schema:
$ref: '#/definitions/ApiResponse'
/result/before/{dateBefore}:
get:
summary: Get decision before a date
operationId: getallbefore
tags:
- result
parameters:
- name: dateBefore
in: path
description: Date of filter
required: true
type: string
format: date
responses:
"200":
description: Array of decision objects
schema:
$ref: '#/definitions/ResultObjects'
"404":
description: NO objects matching filter
schema:
$ref: '#/definitions/ApiResponse'
/result/{tagID}:
get:
summary: Get decision by ID
operationId: getDecision
tags:
- result
parameters:
- name: tagID
in: path
description: ID of wave file
required: true
type: integer
format: int32
responses:
"200":
description: Decision object
schema:
$ref: '#/definitions/ResultObject'
"404":
description: Tag not found
schema:
$ref: '#/definitions/ApiResponse'
definitions:
ResultObjects:
type: array
items:
$ref: '#/definitions/ResultObject'
ResultObject:
type: "object"
properties:
tag:
type: "string"
probability:
type: "number"
ApiResponse:
type: "object"
properties:
status:
type: "string"
message:
type: "string"