Files
MSE-SoftwEng/gateway/src/docs/swagger.yaml
2025-04-15 10:46:01 +02:00

129 lines
2.9 KiB
YAML

basePath: /
definitions:
gin.H:
additionalProperties: {}
type: object
main.Command:
description: Command structure for publishing
properties:
command:
example: MEASURE_NEW
type: string
required:
- command
type: object
host: rest.mse.kb28.ch
info:
contact: {}
description: REST API for the SoftwEng course in MSE
title: Swagger SoftwEng API
version: "1.0"
paths:
/ping:
get:
consumes:
- application/json
description: get ping response
produces:
- application/json
responses:
"200":
description: pong
schema:
type: string
summary: Ping test endpoint
tags:
- ping
/raclette:
get:
consumes:
- application/json
description: Request data from InfluxDB for a specific device in a room
parameters:
- description: User name
example: remi
in: query
name: user
required: true
type: string
- description: Room name
example: Bedroom
in: query
name: room
required: true
type: string
- description: Device name
example: DoorSensor
in: query
name: device
required: true
type: string
produces:
- application/json
responses:
"200":
description: Returns a map of field names to their latest values.
schema:
additionalProperties: true
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/gin.H'
security:
- BasicAuth: []
summary: Request Influx data
tags:
- request
post:
consumes:
- application/json
description: Publish a command to a specific device in a room
parameters:
- description: User name
example: remi
in: query
name: user
required: true
type: string
- description: Room name
example: Bedroom
in: query
name: room
required: true
type: string
- description: Device name
example: DoorSensor
in: query
name: device
required: true
type: string
- description: Command to publish
in: body
name: command
required: true
schema:
$ref: '#/definitions/main.Command'
produces:
- application/json
responses:
"200":
description: status:ok
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/gin.H'
security:
- BasicAuth: []
summary: Publish command
tags:
- commands
securityDefinitions:
BasicAuth:
type: basic
swagger: "2.0"