249 lines
No EOL
5.6 KiB
JSON
249 lines
No EOL
5.6 KiB
JSON
{
|
|
"components": {
|
|
"schemas": {
|
|
"eventClass": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "object",
|
|
"$ref": "#/components/schemas/dataClass"
|
|
},
|
|
"name": {"type": "string"},
|
|
"id": {"type": "integer"},
|
|
"map": {
|
|
"type": "object",
|
|
"$ref": "#/components/schemas/mapClass"
|
|
},
|
|
"user": {"type": "string"},
|
|
"config": {
|
|
"type": "object",
|
|
"$ref": "#/components/schemas/configClass"
|
|
}
|
|
}
|
|
},
|
|
|
|
"roomClass": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {"type": "integer"},
|
|
"name": {"type": "string"},
|
|
"map": {
|
|
"type": "object",
|
|
"$ref": "#/components/schemas/mapClass"
|
|
}
|
|
}
|
|
},
|
|
|
|
"sensorClass": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "object",
|
|
"$ref": "#/components/schemas/dataClass"
|
|
},
|
|
"name": {"type": "string"},
|
|
"id": {"type": "integer"},
|
|
"map": {
|
|
"type": "object",
|
|
"$ref": "#/components/schemas/mapClass"
|
|
},
|
|
"user": {"type": "string"},
|
|
"config": {
|
|
"type": "object",
|
|
"$ref": "#/components/schemas/configClass"
|
|
},
|
|
"aggregate": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"timestamps": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
"configClass": {
|
|
"type": "object",
|
|
"properties": {
|
|
"typeConfig": {"type": "string"},
|
|
"typeData": {"type": "string"}
|
|
}
|
|
},
|
|
|
|
"dataClass": {
|
|
"type": "object",
|
|
"properties": {
|
|
"valueStr": {"type": "string"},
|
|
"value": {"type": "number"},
|
|
"timestamp": {"type": "integer"}
|
|
}
|
|
},
|
|
|
|
"mapClass": {
|
|
"type": "object",
|
|
"properties": {
|
|
"x": {"type": "number"},
|
|
"y": {"type": "number"},
|
|
"width": {"type": "number"},
|
|
"height": {"type": "number"}
|
|
}
|
|
},
|
|
}
|
|
},
|
|
|
|
"servers": [
|
|
{
|
|
"description": "Hal Server",
|
|
"url": "/api"
|
|
}
|
|
],
|
|
|
|
"openapi": "3.0.1",
|
|
|
|
"paths": {
|
|
"/event": {
|
|
"get": {
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"$ref": "#/components/schemas/eventClass"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"schema": {
|
|
"type": "integer"
|
|
},
|
|
"in": "query",
|
|
"name": "id",
|
|
"required": false
|
|
},
|
|
{
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"in": "query",
|
|
"name": "typeConfig",
|
|
"required": false
|
|
},
|
|
{
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"in": "query",
|
|
"name": "typeData",
|
|
"required": false
|
|
}
|
|
]
|
|
}
|
|
},
|
|
|
|
"/room": {
|
|
"get": {
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"$ref": "#/components/schemas/roomClass"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"schema": {
|
|
"type": "integer"
|
|
},
|
|
"in": "query",
|
|
"name": "id",
|
|
"required": false
|
|
}
|
|
]
|
|
}
|
|
},
|
|
|
|
"/sensor": {
|
|
"get": {
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"$ref": "#/components/schemas/sensorClass"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"schema": {
|
|
"type": "integer"
|
|
},
|
|
"in": "query",
|
|
"name": "id",
|
|
"required": false
|
|
},
|
|
{
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"in": "query",
|
|
"name": "typeConfig",
|
|
"required": false
|
|
},
|
|
{
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"in": "query",
|
|
"name": "typeData",
|
|
"required": false
|
|
},
|
|
{
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": [
|
|
"min",
|
|
"hour",
|
|
"day",
|
|
"week"
|
|
]
|
|
},
|
|
"in": "query",
|
|
"name": "aggregation",
|
|
"required": false
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"info": {
|
|
"description": "This API allows developers and external tools to interface to Hal data and trigger different actions.",
|
|
"title": "Hal REST API",
|
|
"version": ""
|
|
}
|
|
} |