Response data will have the following format:
{
"data": "Mixed content",
"message": "Description of what happened"
}
Definition
GET /devices
Response
200 OK
on success
[
{
"identifier": "ceiling-lamp",
"name": "Ceiling Lamp 1",
"device_type": "switch",
"controller_gateway": "192.168.1.17"
},
{
"identifier": "raspberry-pi",
"name": "Raspberry PI 1",
"device_type": "raspi",
"controller_gateway": "192.168.1.21"
}
]
Definition
POST /devices
Arguments
"identifier": string
a globally unique identifier for device"name": string
a user-friendly name for device"device_type": string
the type of device as understood by the client"controller_gateway": string
the IP address of the device's controller
Response
201 Created
on success
{
"identifier": "raspberry-pi",
"name": "Raspberry PI 1",
"device_type": "raspi",
"controller_gateway": "192.168.1.21"
}
Definition
GET /device/<identifier>
Response
404 Not Found
if the device does not exist200 OK
on success
{
"identifier": "raspberry-pi",
"name": "Raspberry PI 1",
"device_type": "raspi",
"controller_gateway": "192.168.1.21"
}
Definition
DELETE /devices/<identifier>
Response
404 Not Found
if device does not exist204 No Content
on success