docs(gateway): updated swagger doc
Signed-off-by: Klagarge <remi@heredero.ch>
This commit is contained in:
@@ -8,7 +8,190 @@
|
||||
},
|
||||
"host": "rest.mse.kb28.ch",
|
||||
"basePath": "/",
|
||||
"paths": {},
|
||||
"paths": {
|
||||
"/ping": {
|
||||
"get": {
|
||||
"description": "get ping response",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ping"
|
||||
],
|
||||
"summary": "Ping test endpoint",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "pong",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/raclette": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"BasicAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Request data from InfluxDB for a specific device in a room",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"request"
|
||||
],
|
||||
"summary": "Request Influx data",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"example": "Garage",
|
||||
"description": "Room name",
|
||||
"name": "room",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"example": "Door",
|
||||
"description": "Device name",
|
||||
"name": "device",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Returns a map of field names to their latest values.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/main.GarageDoorExample"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"BasicAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Publish a command to a specific device in a room",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"commands"
|
||||
],
|
||||
"summary": "Publish command",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"example": "Garage",
|
||||
"description": "Room name",
|
||||
"name": "room",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"example": "Door",
|
||||
"description": "Device name",
|
||||
"name": "device",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Command to publish",
|
||||
"name": "command",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/main.Command"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "status:ok",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gin.H"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"gin.H": {
|
||||
"type": "object",
|
||||
"additionalProperties": {}
|
||||
},
|
||||
"main.Command": {
|
||||
"description": "Command structure for publishing",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"command"
|
||||
],
|
||||
"properties": {
|
||||
"command": {
|
||||
"type": "string",
|
||||
"example": "UP"
|
||||
}
|
||||
}
|
||||
},
|
||||
"main.GarageDoorExample": {
|
||||
"description": "Example response for Garage Door status",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"IsClosed": {
|
||||
"description": "example: true",
|
||||
"type": "boolean"
|
||||
},
|
||||
"IsDownButtonPressed": {
|
||||
"description": "example: false",
|
||||
"type": "boolean"
|
||||
},
|
||||
"IsIRSensor": {
|
||||
"description": "example: false",
|
||||
"type": "boolean"
|
||||
},
|
||||
"IsOpen": {
|
||||
"description": "example: false",
|
||||
"type": "boolean"
|
||||
},
|
||||
"IsUpButtonPressed": {
|
||||
"description": "example: false",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
"BasicAuth": {
|
||||
"type": "basic"
|
||||
|
||||
Reference in New Issue
Block a user