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/user.yaml

282 lines
7.3 KiB
YAML
Raw Permalink Normal View History

2020-04-21 10:53:07 +02:00
/users:
get:
2020-04-24 12:25:32 +02:00
summary: lists all users
2020-04-23 13:59:45 +02:00
description: 'Auth: basic, levels: admin'
2020-04-21 10:53:07 +02:00
tags:
- /user
security:
- BasicAuth: []
responses:
200:
description: user API key
content:
application/json:
schema:
type: array
items:
2020-08-26 19:37:36 +02:00
allOf:
- $ref: 'api.yaml#/components/schemas/User'
properties:
status:
type: string
description: can be deleted/new
example: new
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-24 12:25:32 +02:00
/user:
get:
summary: list own user details
2020-08-26 19:37:36 +02:00
description: 'Auth: basic, levels: predict, read, write, dev, admin'
2020-04-24 12:25:32 +02:00
tags:
- /user
security:
- BasicAuth: []
responses:
200:
description: user details
content:
application/json:
schema:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/schemas/User'
2020-04-24 12:25:32 +02:00
401:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/401'
2020-04-24 12:25:32 +02:00
403:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/403'
2020-04-24 12:25:32 +02:00
500:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/500'
2020-04-24 12:25:32 +02:00
put:
2020-04-27 15:10:14 +02:00
summary: change user details
2020-08-26 19:37:36 +02:00
description: 'Auth: basic, levels: predict, read, write, dev, admin'
2020-04-24 12:25:32 +02:00
tags:
- /user
security:
- BasicAuth: []
requestBody:
required: true
content:
application/json:
schema:
allOf:
2020-04-29 12:10:27 +02:00
- $ref: 'api.yaml#/components/schemas/_Id'
- $ref: 'api.yaml#/components/schemas/UserName'
- $ref: 'api.yaml#/components/schemas/Email'
2020-04-24 12:25:32 +02:00
properties:
pass:
type: string
writeOnly: true
example: Abc123!#
location:
type: string
example: Rng
2020-08-06 13:58:12 +02:00
devices:
type: array
items:
type: string
example: Alpha II
2020-04-24 12:25:32 +02:00
responses:
200:
description: user details
content:
application/json:
schema:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/schemas/User'
2020-04-24 12:25:32 +02:00
400:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/400'
2020-04-24 12:25:32 +02:00
401:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/401'
2020-04-24 12:25:32 +02:00
403:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/403'
2020-04-24 12:25:32 +02:00
500:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/500'
2020-04-24 12:25:32 +02:00
delete:
2020-04-27 15:10:14 +02:00
summary: delete user
2020-08-26 19:37:36 +02:00
description: 'Auth: basic, levels: predict, read, write, dev, admin'
2020-04-24 12:25:32 +02:00
tags:
- /user
security:
- BasicAuth: []
responses:
200:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/Ok'
2020-04-24 12:25:32 +02:00
401:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/401'
2020-04-24 12:25:32 +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
/user/{name}:
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-04-24 12:25:32 +02:00
summary: list user details
description: 'Auth: basic, levels: admin'
2020-04-21 10:53:07 +02:00
tags:
- /user
security:
- BasicAuth: []
responses:
200:
description: user details
content:
application/json:
schema:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/schemas/User'
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-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
put:
2020-04-27 15:10:14 +02:00
summary: change user details
2020-04-24 12:25:32 +02:00
description: 'Auth: basic, levels: admin'
2020-04-21 10:53:07 +02:00
tags:
- /user
2020-04-23 13:59:45 +02:00
security:
- BasicAuth: []
2020-04-21 10:53:07 +02:00
requestBody:
required: true
content:
application/json:
schema:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/schemas/User'
2020-04-21 10:53:07 +02:00
responses:
200:
description: user details
content:
application/json:
schema:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/schemas/User'
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-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-04-27 15:10:14 +02:00
summary: delete user
2020-04-24 12:25:32 +02:00
description: 'Auth: basic, levels: admin'
2020-04-21 10:53:07 +02:00
tags:
- /user
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
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-26 19:37:36 +02:00
/user/restore/{name}:
put:
summary: restore deleted user
description: 'Auth: basic, levels: admin'
tags:
- /user
security:
- BasicAuth: []
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-04-21 10:53:07 +02:00
/user/key:
get:
2020-04-27 15:10:14 +02:00
summary: get API key for the user
description: 'Auth: basic, levels: read, write, dev, admin'
2020-04-21 10:53:07 +02:00
tags:
- /user
security:
- BasicAuth: []
responses:
200:
description: user details
content:
application/json:
schema:
2020-04-27 14:26:51 +02:00
properties:
key:
type: string
example: 5ea0450ed851c30a90e70899
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
500:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/500'
2020-04-21 10:53:07 +02:00
/user/new:
post:
2020-04-24 12:25:32 +02:00
summary: add new user
2020-04-23 13:59:45 +02:00
description: 'Auth: basic, levels: admin'
2020-04-21 10:53:07 +02:00
tags:
- /user
security:
- BasicAuth: []
requestBody:
required: true
content:
application/json:
schema:
required:
- email
- name
- pass
- level
- location
2020-08-06 13:58:12 +02:00
- devices
allOf:
2020-04-29 12:10:27 +02:00
- $ref: 'api.yaml#/components/schemas/User'
2020-04-21 10:53:07 +02:00
responses:
200:
description: user details
content:
application/json:
schema:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/schemas/User'
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
500:
2020-04-29 12:10:27 +02:00
$ref: 'api.yaml#/components/responses/500'
2020-04-21 10:53:07 +02:00
/user/passreset:
post:
2020-04-24 12:25:32 +02:00
summary: reset password and send mail to restore
2020-04-23 13:59:45 +02:00
description: 'Auth: none'
2020-04-21 10:53:07 +02:00
tags:
- /user
security: []
requestBody:
required: true
description: mail saved in user profile to provide authentication
content:
application/json:
schema:
2020-04-23 17:46:00 +02:00
allOf:
2020-04-29 12:10:27 +02:00
- $ref: 'api.yaml#/components/schemas/UserName'
- $ref: 'api.yaml#/components/schemas/Email'
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-23 17:46:00 +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'