155 lines
3.9 KiB
YAML
155 lines
3.9 KiB
YAML
openapi: '3.0.3'
|
|
info:
|
|
title: SlotDB
|
|
version: '1.0'
|
|
servers:
|
|
- url: http://127.0.0.1:8080/api/slotdb/v1
|
|
paths:
|
|
/slots:
|
|
get:
|
|
description: Query all slots
|
|
tags: [ Slots ]
|
|
parameters:
|
|
- in: query
|
|
name: get
|
|
description: Comma-separated list of keys to return
|
|
schema: { type: string }
|
|
- in: query
|
|
name: group
|
|
description: Comma-separated list of groups to filter on
|
|
schema: { type: string }
|
|
- in: query
|
|
name: limit
|
|
description: Number of results per page
|
|
schema: { type: number }
|
|
- in: query
|
|
name: page
|
|
description: Page number (from 0)
|
|
schema: { type: number }
|
|
- in: query
|
|
name: where
|
|
description: Match expression for returned results
|
|
schema:
|
|
oneOf:
|
|
- type: string
|
|
- type: array
|
|
items: { type: string }
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Slot'
|
|
post:
|
|
description: Create or update slots
|
|
tags: [ Slots ]
|
|
requestBody:
|
|
description: Array of slots
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: object
|
|
required: [ id ]
|
|
properties:
|
|
slot: { type: string, description: "Unique slot ID", example: "4B-1" }
|
|
name: { type: string, description: "Like ID, but for humans", example: "4B Unit 1" }
|
|
properties: { type: object, additionalProperties: true, example: { is-available: true, monthly-rate: 191 } }
|
|
group: { type: string, description: "The group that this slot belongs to", example: "units" }
|
|
responses:
|
|
'201':
|
|
description: Slots created
|
|
'409':
|
|
description: Slot already exists
|
|
'422':
|
|
description: Unprocessable content
|
|
/slot/{slot}:
|
|
get:
|
|
tags: [ Slots ]
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Slot'
|
|
post:
|
|
tags: [ Slots ]
|
|
requestBody:
|
|
description: >
|
|
Post one or more properties to update the slot. Note that not all properties may
|
|
be writable.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Slot'
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
delete:
|
|
tags: [ Slots ]
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
/slot/{slot}/{key}:
|
|
get:
|
|
description: Query a specific property from a slot
|
|
tags: [ Slots ]
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
/groups:
|
|
get:
|
|
tags: [ Groups ]
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
post:
|
|
tags: [ Groups ]
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
/group/{group}:
|
|
get:
|
|
tags: [ Groups ]
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
post:
|
|
tags: [ Groups ]
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
delete:
|
|
tags: [ Groups ]
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
|
|
components:
|
|
schemas:
|
|
Slot:
|
|
type: object
|
|
properties:
|
|
_id:
|
|
type: string
|
|
description: Slot numeric ID
|
|
_slot:
|
|
type: string
|
|
description: Slot ID
|
|
_name:
|
|
type: string
|
|
description: Slot name
|
|
_group:
|
|
type: string
|
|
description: Group ID
|
|
_schema:
|
|
type: array
|
|
description: Active schemas
|
|
additionalProperties: true
|