mirror of
https://github.com/resources-manager/resources-manager-api.git
synced 2024-12-22 08:03:58 +01:00
sessions swagger defs
This commit is contained in:
parent
6924473f78
commit
ba73c88df9
|
@ -8,9 +8,10 @@ basePath: "/api"
|
||||||
tags:
|
tags:
|
||||||
- name: "user"
|
- name: "user"
|
||||||
description: "Operations about user"
|
description: "Operations about user"
|
||||||
|
- name: "session"
|
||||||
|
description: "logon and log out methods to get a token"
|
||||||
schemes:
|
schemes:
|
||||||
- "https"
|
- "https"
|
||||||
- "http"
|
|
||||||
paths:
|
paths:
|
||||||
/user:
|
/user:
|
||||||
post:
|
post:
|
||||||
|
@ -18,7 +19,6 @@ paths:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Create user"
|
summary: "Create user"
|
||||||
description: "Need pass an api key to authentificate."
|
description: "Need pass an api key to authentificate."
|
||||||
operationId: "createUser"
|
|
||||||
produces:
|
produces:
|
||||||
- "application/json"
|
- "application/json"
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -35,41 +35,17 @@ paths:
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
/user/createWithArray:
|
401:
|
||||||
post:
|
description: Authentification failed
|
||||||
tags:
|
403:
|
||||||
- "user"
|
description: You are not allowed to do that
|
||||||
summary: "Creates list of users with given input array"
|
|
||||||
description: ""
|
|
||||||
operationId: "createUsersWithArrayInput"
|
|
||||||
produces:
|
|
||||||
- "application/xml"
|
|
||||||
- "application/json"
|
|
||||||
parameters:
|
|
||||||
- in: "body"
|
|
||||||
name: "body"
|
|
||||||
description: "List of user object"
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: "array"
|
|
||||||
items:
|
|
||||||
$ref: "#/definitions/User"
|
|
||||||
- in: header
|
|
||||||
name: X-API-Key
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
responses:
|
|
||||||
default:
|
|
||||||
description: "successful operation"
|
|
||||||
/user/createWithList:
|
/user/createWithList:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Creates list of users with given input array"
|
summary: "Creates list of users with given input array"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "createUsersWithListInput"
|
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
|
||||||
- "application/json"
|
- "application/json"
|
||||||
parameters:
|
parameters:
|
||||||
- in: "body"
|
- in: "body"
|
||||||
|
@ -87,15 +63,17 @@ paths:
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
|
401:
|
||||||
|
description: Authentification failed
|
||||||
|
403:
|
||||||
|
description: You are not allowed to do that
|
||||||
/user/{username}:
|
/user/{username}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Get user by user name"
|
summary: "Get user by user name"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "getUserByName"
|
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
|
||||||
- "application/json"
|
- "application/json"
|
||||||
parameters:
|
parameters:
|
||||||
- name: "username"
|
- name: "username"
|
||||||
|
@ -111,19 +89,21 @@ paths:
|
||||||
200:
|
200:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/definitions/User"
|
$ref: "#/definitions/UserInfo"
|
||||||
400:
|
400:
|
||||||
description: "Invalid username supplied"
|
description: "Invalid username supplied"
|
||||||
404:
|
404:
|
||||||
description: "User not found"
|
description: "User not found"
|
||||||
|
401:
|
||||||
|
description: Authentification failed
|
||||||
|
403:
|
||||||
|
description: You are not allowed to do that
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Updated user"
|
summary: "Updated user"
|
||||||
description: "This can only be done by the logged in user."
|
description: "This can only be done by the logged in user."
|
||||||
operationId: "updateUser"
|
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
|
||||||
- "application/json"
|
- "application/json"
|
||||||
parameters:
|
parameters:
|
||||||
- name: "username"
|
- name: "username"
|
||||||
|
@ -146,6 +126,10 @@ paths:
|
||||||
description: "Invalid user supplied"
|
description: "Invalid user supplied"
|
||||||
404:
|
404:
|
||||||
description: "User not found"
|
description: "User not found"
|
||||||
|
401:
|
||||||
|
description: Authentification failed
|
||||||
|
403:
|
||||||
|
description: You are not allowed to do that
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
|
@ -153,7 +137,6 @@ paths:
|
||||||
description: "This can only be done by the logged in user."
|
description: "This can only be done by the logged in user."
|
||||||
operationId: "deleteUser"
|
operationId: "deleteUser"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
|
||||||
- "application/json"
|
- "application/json"
|
||||||
parameters:
|
parameters:
|
||||||
- name: "username"
|
- name: "username"
|
||||||
|
@ -170,6 +153,47 @@ paths:
|
||||||
description: "Invalid username supplied"
|
description: "Invalid username supplied"
|
||||||
404:
|
404:
|
||||||
description: "User not found"
|
description: "User not found"
|
||||||
|
401:
|
||||||
|
description: Authentification failed
|
||||||
|
403:
|
||||||
|
description: You are not allowed to do that
|
||||||
|
/session:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- session
|
||||||
|
summary: "Get current session info"
|
||||||
|
parameters:
|
||||||
|
- in: header
|
||||||
|
name: X-API-Key
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
responses:
|
||||||
|
401:
|
||||||
|
description: Authentification failed
|
||||||
|
200:
|
||||||
|
description: "successful operation"
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/Session"
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- session
|
||||||
|
summary: "Try to auth and retrive an api key"
|
||||||
|
parameters:
|
||||||
|
- in: "body"
|
||||||
|
name: "body"
|
||||||
|
description: "auth"
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/InternalAuth"
|
||||||
|
responses:
|
||||||
|
401:
|
||||||
|
description: Authentification failed
|
||||||
|
200:
|
||||||
|
description: "successful operation"
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/Session"
|
||||||
|
|
||||||
|
|
||||||
definitions:
|
definitions:
|
||||||
User:
|
User:
|
||||||
type: "object"
|
type: "object"
|
||||||
|
@ -187,9 +211,60 @@ definitions:
|
||||||
type: "string"
|
type: "string"
|
||||||
password:
|
password:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
format: "password"
|
||||||
phone:
|
phone:
|
||||||
type: "string"
|
type: "string"
|
||||||
userStatus:
|
userStatus:
|
||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int32"
|
format: "int32"
|
||||||
description: "User Status"
|
description: "User Status"
|
||||||
|
authMethod:
|
||||||
|
type: "string"
|
||||||
|
pattern: '^(internal|ldap|cas)$'
|
||||||
|
UserInfo:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: "integer"
|
||||||
|
format: "int64"
|
||||||
|
username:
|
||||||
|
type: "string"
|
||||||
|
firstName:
|
||||||
|
type: "string"
|
||||||
|
lastName:
|
||||||
|
type: "string"
|
||||||
|
email:
|
||||||
|
type: "string"
|
||||||
|
phone:
|
||||||
|
type: "string"
|
||||||
|
userStatus:
|
||||||
|
type: "integer"
|
||||||
|
format: "int32"
|
||||||
|
description: "User Status"
|
||||||
|
authMethod:
|
||||||
|
type: "string"
|
||||||
|
pattern: '^(internal|ldap|cas)$'
|
||||||
|
lastConnect:
|
||||||
|
type: "string"
|
||||||
|
format: date-time
|
||||||
|
Session:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
user:
|
||||||
|
type: object
|
||||||
|
createDate:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
endDate:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
X-API-Key:
|
||||||
|
type: string
|
||||||
|
InternalAuth:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
username:
|
||||||
|
type: "string"
|
||||||
|
password:
|
||||||
|
type: "string"
|
||||||
|
format: password
|
Loading…
Reference in New Issue
Block a user