api_v1.4/hub_api/docs/openapi-specs.yml
2023-02-22 23:14:41 -05:00

184 lines
4.9 KiB
YAML

info:
title: CERC API Swagger - OpenAPI 3.0
description: NextGen Cities Institute API
termsOfService: http://swagger.io/terms/
contact:
email: peteryefi@gmail.com
version: 1.4
externalDocs:
description: Find out more about Swagger
url: http://swagger.io
paths:
/v1.4/uptime:
get:
parameters:
[]
tags:
- Uptime
summary: API uptime
operationId: uptime
description: Retrieve current API uptime
responses:
'200':
description: Request successful
content:
application/json:
schema:
$ref: '#/components/schemas/uptime'
/v1.4/session/start:
put:
parameters:
- in: header
name: username
schema:
type: string
required: true
description: the application username accessing this API
- in: header
name: password
schema:
type: string
required: true
description: the password for the user accessing this API
- in: header
name: application_uuid
schema:
type: string
required: true
description: the uuid of the application accessing this API
tags:
- Session start
summary: Starts an user session
operationId: session_start
description: Authentication and initialization of a user session in the Api
responses:
'200':
description: Login succeed
content:
application/json:
schema:
$ref: '#/components/schemas/login_succeed'
headers:
session_id:
type: string
format: uuid
description: Session id
example: '77e1c83b-7bb0-437b-bc50-a7a58e5660ac'
token:
type: string
format: uuid
description: Token expected in next operation header
example: '77e1c83b-7bb0-437b-bc50-a7a58e5660ac'
'403':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/unauthorized'
/v1.4/session/keep_alive:
put:
security:
- session_id: []
- token: []
- application_uuid: []
parameters:
[]
tags:
- Keep alive
summary: Keep the current user session alive
operationId: keep_alive
description: Refresh and keep the current session alive and renew the token
responses:
'200':
description: Succeed
content:
application/json:
schema:
$ref: '#/components/schemas/succeed'
headers:
token:
type: string
format: uuid
description: Token expected in next operation header
example: '77e1c83b-7bb0-437b-bc50-a7a58e5660ac'
'403':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/unauthorized'
/v1.4/session/end:
put:
security:
- session_id: []
- token: []
- application_uuid: []
parameters:
[]
tags:
- End session
summary: Ends the current user session
operationId: session_end
description: End the current user session and free the alocated resources
responses:
'200':
description: Succeed
content:
application/json:
schema:
$ref: '#/components/schemas/succeed'
headers:
token:
type: string
format: uuid
description: Token expected in next operation header
example: '77e1c83b-7bb0-437b-bc50-a7a58e5660ac'
'403':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/unauthorized'
components:
securitySchemes:
session_id:
type: apiKey
in: header
name: session_id
application_uuid:
type: apiKey
in: header
name: application_uuid
token:
type: apiKey
in: header
name: token
schemas:
uptime:
type: object
properties:
uptime:
type: string
format: hh:mm:ss.ms
example: '00:09:53.600281'
unauthorized:
type: object
properties:
error:
type: string
example: 'unauthorized'
succeed:
type: object
properties:
result:
type: string
example: 'succeed'
login_succeed:
type: object
properties:
result:
type: string
example: 'succeed'
cities:
type: array
example: [{'name': 'city 1', 'geometric_level_of_detail': '1'}, {'name': 'city 2', 'geometric_level_of_detail': '1'}]