All responses will have the form
{
"data": "Mixed type holding the content of the response",
"message": "Description of what happned"
}Subsequent response definitions will only detail the expected value of the 'data field'
Definition
GET /devices
Response
200 OKon success
[
{
"identifier":"floor-lamp",
"name": "Floor Lamp",
"device_type": "switch",
"controller_gateway": "192.1.68.0.2"
},
{
"Identifier": "samsung-tv",
"name": "Living Room TV",
"device_type": "tv",
"controller_gateway": "192.168.0.9"
}
]Definition
POST/devices
Arguments
"identifer":stringa globally unique identifier for this device"name":stringa friendly name for this devuce"device_type":stringthe type of the device as understood by the client"controller_gateway::stringthe IP address of the device's controller
If a device with the given identifier already exists, the exsting device will be overwritten.
Response
201 Createdon success
{
"identifier":"floor-lamp",
"name": "Floor Lamp",
"device_type": "switch",
"controller_gateway": "192.1.68.0.2"
}GET /device/<identifier>
Response
404 Not Foundif the device does not exist200 OKon success
{
"identifier": "floor-lamp",
"name": "Floor Lmap",
"device_type": "switch",
"controller_gateway": "192.1.68.0.2"
}Definition
DELETE /devices/<identifier>
Response
404 Not Foundif the device does not exist204 No Contenton success docker-compose up -d