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
2020-08-19 13:48:47 +02:00

141 lines
3.8 KiB
YAML

/model/groups:
get:
summary: list all available groups
description: 'Auth: basic, levels: read, write, dev, admin'
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'
/model/file/{name}:
parameters:
- $ref: 'api.yaml#/components/parameters/Name'
get:
summary: get model data by name
description: 'Auth: all, levels: dev, admin'
tags:
- /model
responses:
200:
description: binary model data
content:
application/octet-stream:
schema:
type: string
format: binary
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'
post:
summary: add/replace model data by name
description: 'Auth: all, levels: dev, admin'
tags:
- /model
requestBody:
required: true
description: binary model data, Content-Type header must be set to application/octet-stream
content:
application/json:
schema:
type: string
format: binary
responses:
200:
$ref: 'api.yaml#/components/responses/Ok'
401:
$ref: 'api.yaml#/components/responses/401'
403:
$ref: 'api.yaml#/components/responses/403'
500:
$ref: 'api.yaml#/components/responses/500'
delete:
summary: delete model data
description: 'Auth: basic, levels: dev, admin'
tags:
- /model
security:
- BasicAuth: []
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'
404:
$ref: 'api.yaml#/components/responses/404'
500:
$ref: 'api.yaml#/components/responses/500'