Archived
2
This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
definma-api/api/model.yaml

194 lines
5.3 KiB
YAML
Raw Permalink Normal View History

2020-08-19 13:48:47 +02:00
/model/groups:
get:
2020-08-26 19:37:36 +02:00
summary: list all available groups for user
description: 'Auth: basic, levels: predict, read, write, dev, admin'
2020-08-19 13:48:47 +02:00
tags:
- /model
responses:
200:
description: all groups
content:
application/json:
schema:
type: array
items:
properties:
group:
type: string
example: VN
models:
type: array
items:
$ref: 'api.yaml#/components/schemas/ModelItem'
401:
$ref: 'api.yaml#/components/responses/401'
500:
$ref: 'api.yaml#/components/responses/500'
/model/{group}:
parameters:
- $ref: 'api.yaml#/components/parameters/Group'
post:
summary: add/replace model group item
description: 'Auth: basic, levels: dev, admin <br> If the given name exists, the item is replaced,
otherwise it is newly created'
tags:
- /model
requestBody:
required: true
content:
application/json:
schema:
$ref: 'api.yaml#/components/schemas/ModelItem'
responses:
200:
$ref: 'api.yaml#/components/responses/Ok'
400:
$ref: 'api.yaml#/components/responses/400'
401:
$ref: 'api.yaml#/components/responses/401'
403:
$ref: 'api.yaml#/components/responses/403'
500:
$ref: 'api.yaml#/components/responses/500'
/model/{group}/{name}:
parameters:
- $ref: 'api.yaml#/components/parameters/Group'
- $ref: 'api.yaml#/components/parameters/Name'
delete:
summary: remove model group item
description: 'Auth: basic, levels: dev, admin'
tags:
- /model
responses:
200:
$ref: 'api.yaml#/components/responses/Ok'
401:
$ref: 'api.yaml#/components/responses/401'
403:
$ref: 'api.yaml#/components/responses/403'
404:
$ref: 'api.yaml#/components/responses/404'
500:
$ref: 'api.yaml#/components/responses/500'
2020-08-28 09:04:05 +02:00
/model/files:
get:
summary: list all stored models
description: 'Auth: basic, levels: dev, admin'
tags:
- /model
responses:
200:
description: model details list
content:
application/json:
schema:
properties:
name:
type: string
example: model_VN_A3WG6_V1
size:
type: number
example: 4177449
401:
$ref: 'api.yaml#/components/responses/401'
403:
$ref: 'api.yaml#/components/responses/403'
500:
$ref: 'api.yaml#/components/responses/500'
2020-08-19 13:48:47 +02:00
/model/file/{name}:
2020-04-21 10:53:07 +02:00
parameters:
2020-04-29 12:10:27 +02:00
- $ref: 'api.yaml#/components/parameters/Name'
2020-04-21 10:53:07 +02:00
get:
2020-08-13 12:07:40 +02:00
summary: get model data by name
2020-04-23 13:59:45 +02:00
description: 'Auth: all, levels: dev, admin'
2020-04-21 10:53:07 +02:00
tags:
- /model
responses:
200:
description: binary model data
content:
application/octet-stream:
schema:
type: string
format: binary
401:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/401'
2020-04-21 10:53:07 +02:00
403:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/403'
2020-04-21 10:53:07 +02:00
404:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/404'
2020-04-21 10:53:07 +02:00
500:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/500'
2020-08-13 12:07:40 +02:00
post:
summary: add/replace model data by name
2020-04-23 13:59:45 +02:00
description: 'Auth: all, levels: dev, admin'
2020-04-21 10:53:07 +02:00
tags:
- /model
requestBody:
required: true
2020-08-13 12:07:40 +02:00
description: binary model data, Content-Type header must be set to application/octet-stream
2020-04-21 10:53:07 +02:00
content:
application/json:
schema:
type: string
format: binary
responses:
200:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/Ok'
2020-04-21 10:53:07 +02:00
401:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/401'
2020-04-21 10:53:07 +02:00
403:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/403'
2020-04-21 10:53:07 +02:00
500:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/500'
2020-04-21 10:53:07 +02:00
delete:
2020-08-13 12:07:40 +02:00
summary: delete model data
2020-04-23 13:59:45 +02:00
description: 'Auth: basic, levels: dev, admin'
2020-04-21 10:53:07 +02:00
tags:
- /model
2020-04-23 13:59:45 +02:00
security:
- BasicAuth: []
2020-04-21 10:53:07 +02:00
responses:
200:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/Ok'
2020-04-21 10:53:07 +02:00
400:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/400'
2020-04-21 10:53:07 +02:00
401:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/401'
2020-04-21 10:53:07 +02:00
403:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/403'
2020-04-21 10:53:07 +02:00
404:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/404'
2020-08-26 19:37:36 +02:00
500:
$ref: 'api.yaml#/components/responses/500'
/model/authorized/{url}:
parameters:
- name: url
in: path
required: true
description: URLComponent encoded URL of the requested model
schema:
type: string
example: https%3A%2F%2Fdefinma-model-test.apps.de1.bosch-iot-cloud.com%2Fpredict%2FH2O_A3WG6
get:
summary: check user permissions for model URL
description: 'Auth: basic, levels: predict, read, write, dev, admin. dev and admin users can access all models,
other users need the model specified by an admin in user.models'
tags:
- /model
security:
- BasicAuth: []
responses:
200:
$ref: 'api.yaml#/components/responses/Ok'
401:
$ref: 'api.yaml#/components/responses/401'
403:
$ref: 'api.yaml#/components/responses/403'
2020-04-21 10:53:07 +02:00
500:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/500'