OpenMUC REST API documentation.
Adds a new Channel to the OpenMUC configuration. In this sample the channel “TestChannel” will added.
curl -X POST -H "Content-Type: application/json" -d '{
"device":"dummy-device1",
"configs":{
"id":"TestChannel",
"samplingInterval":5,
"loggingInterval":5,
"disabled":true,
"description":"test description of TestChannel"
}
}' "127.0.0.1:8888/rest/channels/TestChannel"
POST 127.0.0.1:8888/rest/channels/TestChannel HTTP/1.1
Host:
Content-Type: application/json
{
"device":"dummy-device1",
"configs":{
"id":"TestChannel",
"samplingInterval":5,
"loggingInterval":5,
"disabled":true,
"description":"test description of TestChannel"
}
}
Changes the configuration of a existing channel. Note: Not setted config fields will be deleted. In this sample the config of channel “TestChannel” will changed.
curl -X PUT -H "Content-Type: application/json" -d '{
"configs":{
"id":"TestChannel",
"samplingInterval":15,
"loggingInterval":15,
"listening":true,
"disabled":true,
"description":"NEW test description for TestChannel"
}
}' "127.0.0.1:8888/rest/channels/TestChannel/configs"
PUT 127.0.0.1:8888/rest/channels/TestChannel/configs HTTP/1.1
Host:
Content-Type: application/json
{
"configs":{
"id":"TestChannel",
"samplingInterval":15,
"loggingInterval":15,
"listening":true,
"disabled":true,
"description":"NEW test description for TestChannel"
}
}
Removes the channel from the config. In this sample the channel “TestChannel” will removed.
curl -X DELETE -H "Content-Type: application/json" "127.0.0.1:8888/rest/channels/TestChannel"
DELETE 127.0.0.1:8888/rest/channels/TestChannel HTTP/1.1
Host:
Content-Type: application/json
Get latest sample of all channels.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/channels"
GET 127.0.0.1:8888/rest/channels HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:07:11 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get latest sample of a channel. In this sample of channel “power_grid”.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/channels/power_grid"
GET 127.0.0.1:8888/rest/channels/power_grid HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:07:19 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get the timestamp of the latest sample of a channel. In this sample of channel “power_grid”.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/channels/power_grid/timestamp"
GET 127.0.0.1:8888/rest/channels/power_grid/timestamp HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:07:27 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get the configuration of a channel. In this sample of channel “power_grid”.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/channels/power_grid/configs"
GET 127.0.0.1:8888/rest/channels/power_grid/configs HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:07:33 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get a specific configuration field of a channel. In this sample of channel “power_grid” and the config field “description”.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/channels/power_grid/configs/description"
GET 127.0.0.1:8888/rest/channels/power_grid/configs/description HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:07:38 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get historical data of a channel. In this sample from channel “power_grid”. The time “from” and “until” is in unix timestamp in miliseconds. In this sample of channel “power_grid”.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/channels/power_grid/history?from=1427374290000&until=1427380000000"
GET 127.0.0.1:8888/rest/channels/power_grid/history?from=1427374290000&until=1427380000000 HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:07:44 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get the deviceId of a channel. In this sample of channel “power_grid”.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/channels/power_grid/deviceId"
GET 127.0.0.1:8888/rest/channels/power_grid/deviceId HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:07:50 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get the driverId of a channel. In this sample of channel “power_grid”.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/channels/power_grid/driverId"
GET 127.0.0.1:8888/rest/channels/power_grid/driverId HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:07:56 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Set the latest record of a channel. In this sample of channel “TestChannel”.
curl -X PUT -H "Content-Type: application/json" -d '{
"record": {
"timestamp": 1427461752501,
"flag": "VALID",
"value": 123.4
}
}' "127.0.0.1:8888/rest/channels/TestChannel/latestRecord"
PUT 127.0.0.1:8888/rest/channels/TestChannel/latestRecord HTTP/1.1
Host:
Content-Type: application/json
{
"record": {
"timestamp": 1427461752501,
"flag": "VALID",
"value": 123.4
}
}
Write a value to the channel for example over the bus.
curl -X PUT -H "Content-Type: application/json" -d '{
"record": {
"timestamp": 1427461752501,
"flag": "VALID",
"value": 181.8
}
}' "127.0.0.1:7043/rest/channels/ChannelName"
PUT 127.0.0.1:7043/rest/channels/ChannelName HTTP/1.1
Host:
Content-Type: application/json
{
"record": {
"timestamp": 1427461752501,
"flag": "VALID",
"value": 181.8
}
}
Add new device to the config. In this sample device “TestDevice”.
curl -X POST -H "Content-Type: application/json" -d '{
"driver":"dummy",
"configs":{
"id":"TestDevice",
"deviceAddress":"dummy/device/address/3",
"samplingTimeout":0,
"connectRetryInterval":60000,
"disabled":true,
"description":"test description for TestDevice"
}
}' "127.0.0.1:8888/rest/devices/TestDevice"
POST 127.0.0.1:8888/rest/devices/TestDevice HTTP/1.1
Host:
Content-Type: application/json
{
"driver":"dummy",
"configs":{
"id":"TestDevice",
"deviceAddress":"dummy/device/address/3",
"samplingTimeout":0,
"connectRetryInterval":60000,
"disabled":true,
"description":"test description for TestDevice"
}
}
Changes the config of a device. In this sample of device “TestDevice”. Note: Not setted config fields will be deleted.
curl -X PUT -H "Content-Type: application/json" -d '{
"configs":{
"id":"TestDevice",
"samplingTimeout":8,
"connectRetryInterval":8189,
"disabled":true,
"description":"NEW test description for TestDevice"
}
}' "127.0.0.1:8888/rest/devices/TestDevice/configs"
PUT 127.0.0.1:8888/rest/devices/TestDevice/configs HTTP/1.1
Host:
Content-Type: application/json
{
"configs":{
"id":"TestDevice",
"samplingTimeout":8,
"connectRetryInterval":8189,
"disabled":true,
"description":"NEW test description for TestDevice"
}
}
Deletes a device. In this sample device “TestDevice” will deleted.
curl -X DELETE -H "Content-Type: application/json" "127.0.0.1:8888/rest/devices/TestDevice"
DELETE 127.0.0.1:8888/rest/devices/TestDevice HTTP/1.1
Host:
Content-Type: application/json
Get the list of all devices.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/devices"
GET 127.0.0.1:8888/rest/devices HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:05:01 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get all latest records of all channel of a device and the current state of the device. In this sample all latest records of device “home1” will returend.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/devices/home1"
GET 127.0.0.1:8888/rest/devices/home1 HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:05:15 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get the lsiut off all channels of a device and the device state.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/devices/home1/channels"
GET 127.0.0.1:8888/rest/devices/home1/channels HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:05:24 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get the current device state.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/devices/home1/state"
GET 127.0.0.1:8888/rest/devices/home1/state HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:05:32 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get the configuration of device.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/devices/home1/configs/"
GET 127.0.0.1:8888/rest/devices/home1/configs/ HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:05:41 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get a specific configutration field.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/devices/home1/configs/deviceAddress"
GET 127.0.0.1:8888/rest/devices/home1/configs/deviceAddress HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:05:52 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Scans a device for channels.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/devices/home1/scan"
GET 127.0.0.1:8888/rest/devices/home1/scan HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:10:27 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Scans a device for channels with device configuration.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/devices/home1/scan?settings=SOME_DEVICE_SPECIFIC_CONFIGURATIONS"
GET 127.0.0.1:8888/rest/devices/home1/scan?settings=SOME_DEVICE_SPECIFIC_CONFIGURATIONS HTTP/1.1
Host:
Content-Type: application/json
Adds a new driver to the configuration.
curl -X POST -H "Content-Type: application/json" -d '{
"configs":{
"samplingTimeout":0,
"connectRetryInterval":60000,
"disabled":true
}
}' "127.0.0.1:8888/rest/drivers/mbus"
POST 127.0.0.1:8888/rest/drivers/mbus HTTP/1.1
Host:
Content-Type: application/json
{
"configs":{
"samplingTimeout":0,
"connectRetryInterval":60000,
"disabled":true
}
}
Change a driver configuration. Note: Not setted config fields will be deleted.
curl -X PUT -H "Content-Type: application/json" -d '{
"configs":{
"id":"mbus",
"samplingTimeout":3,
"connectRetryInterval":55555,
"disabled":true
}
}' "127.0.0.1:8888/rest/drivers/mbus/configs"
PUT 127.0.0.1:8888/rest/drivers/mbus/configs HTTP/1.1
Host:
Content-Type: application/json
{
"configs":{
"id":"mbus",
"samplingTimeout":3,
"connectRetryInterval":55555,
"disabled":true
}
}
curl -X DELETE -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/mbus"
DELETE 127.0.0.1:8888/rest/drivers/mbus HTTP/1.1
Host:
Content-Type: application/json
Get รก list of all drivers.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers"
GET 127.0.0.1:8888/rest/drivers HTTP/1.1
Host:
Content-Type: application/json
Get all latest records of all channels of a driver.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/csv"
GET 127.0.0.1:8888/rest/drivers/csv HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:14:29 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get a list of all devices of a driver and the curent driver state.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/csv/devices"
GET 127.0.0.1:8888/rest/drivers/csv/devices HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:16:04 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get a list of all channels of a driver and the driver state.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/csv/channels"
GET 127.0.0.1:8888/rest/drivers/csv/channels HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:17:04 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get the current state of a driver.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/csv/running"
GET 127.0.0.1:8888/rest/drivers/csv/running HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:18:18 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get the configuration of a driver.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/virtual/configs"
GET 127.0.0.1:8888/rest/drivers/virtual/configs HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:19:08 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get a specific config field of a driver.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/virtual/configs/samplingTimeout"
GET 127.0.0.1:8888/rest/drivers/virtual/configs/samplingTimeout HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:19:31 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Scans a driver for devices. In this example no devices were found.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/csv/scan/"
GET 127.0.0.1:8888/rest/drivers/csv/scan/ HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:20:20 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Get the progress information of a driver scan.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/dummy/scanProgressInfo"
GET 127.0.0.1:8888/rest/drivers/dummy/scanProgressInfo HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:22:15 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|
Scans a driver for devices with settings.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/csv/scan?settings=SOME_DRIVER_SETTINGS"
GET 127.0.0.1:8888/rest/drivers/csv/scan?settings=SOME_DRIVER_SETTINGS HTTP/1.1
Host:
Content-Type: application/json
Get informations about a driver.
curl -X GET -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/csv/infos"
GET 127.0.0.1:8888/rest/drivers/csv/infos HTTP/1.1
Host:
Content-Type: application/json
Status | 200 OK |
---|---|
Content-Type | application/json |
Date | Wed, 19 Apr 2017 15:24:31 GMT |
Server | Jetty(9.2.9.v20150224) |
Transfer-Encoding | chunked |
X-Powered-By | Jetty(9.2.9.v20150224) |
|