OpenMUC REST API

General notes

OpenMUC REST API documentation.

API detail

Channels

add channel

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"
    }
}

change channel config

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"
    }
}

delete channel

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 channels

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:07:11 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "records": [
        {
            "id": "power_grid",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614430001,
                "flag": "VALID",
                "value": -4.654
            }
        },
        {
            "id": "status_electric_vehicle",
            "type": "STRING",
            "record": {
                "timestamp": 1492614428298,
                "flag": "VALID",
                "value": "idle"
            }
        },
        {
            "id": "hhmmss",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614430001,
                "flag": "VALID",
                "value": 170710.0
            }
        },
        {
            "id": "power_electric_vehicle",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614430001,
                "flag": "VALID",
                "value": 0.017
            }
        },
        {
            "id": "enery_exported",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614430001,
                "flag": "VALID",
                "value": 1.681
            }
        },
        {
            "id": "power_photovoltaics",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614430001,
                "flag": "VALID",
                "value": 5.46
            }
        },
        {
            "id": "enery_imported",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614430001,
                "flag": "VALID",
                "value": 0.011
            }
        },
        {
            "id": "power_heatpump",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614430001,
                "flag": "VALID",
                "value": 0.577
            }
        }
    ]
}

get channel

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:07:19 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "record": {
        "timestamp": 1492614435001,
        "flag": "VALID",
        "value": -4.652
    }
}

get channel timestamp

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:07:27 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "timestamp": 1492614445000
}

get channel configs

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:07:33 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "configs": {
        "id": "power_grid",
        "channelAddress": "grid_power",
        "description": "grid_power",
        "unit": "W",
        "samplingInterval": 5000,
        "loggingInterval": 5000
    }
}

get channel configField

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:07:38 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "configs": {
        "description": "grid_power"
    }
}

get channel history

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:07:44 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "records": []
}

get channel deviceId

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:07:50 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "deviceId": "home1"
}

get channel driverId

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:07:56 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "driverId": "csv"
}

setRecord channel

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 channel

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
    }
}

Devices

add device

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"
    }
}

change device config

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"
    }
}

delete device

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 devices

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:05:01 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "devices": [
        "home1",
        "virtual"
    ]
}

get device

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:05:15 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "records": [
        {
            "id": "hhmmss",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614315000,
                "flag": "VALID",
                "value": 170515.0
            }
        },
        {
            "id": "power_photovoltaics",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614315000,
                "flag": "VALID",
                "value": 5.512
            }
        },
        {
            "id": "power_grid",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614315000,
                "flag": "VALID",
                "value": -4.777
            }
        },
        {
            "id": "power_heatpump",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614315000,
                "flag": "VALID",
                "value": 0.571
            }
        },
        {
            "id": "power_electric_vehicle",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614315000,
                "flag": "VALID",
                "value": 0.017
            }
        }
    ],
    "state": "CONNECTED"
}

get device channels

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:05:24 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "channels": [
        "hhmmss",
        "power_photovoltaics",
        "power_grid",
        "power_heatpump",
        "power_electric_vehicle"
    ],
    "state": "CONNECTED"
}

get device state

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:05:32 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "state": "CONNECTED"
}

get device configs

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:05:41 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "configs": {
        "id": "home1",
        "deviceAddress": "./csv-driver/home1.csv",
        "settings": "samplingmode\u003dhhmmss;rewind\u003dtrue"
    }
}

get device configField

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:05:52 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "configs": {
        "deviceAddress": "./csv-driver/home1.csv"
    }
}

get device scan

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:10:27 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "channels": [
        {
            "channelAddress": "grid_energy_export",
            "type": "DOUBLE",
            "description": "grid_energy_export",
            "metadata": ""
        },
        {
            "channelAddress": "hhmmss",
            "type": "DOUBLE",
            "description": "hhmmss",
            "metadata": ""
        },
        {
            "channelAddress": "unixtimestamp",
            "type": "DOUBLE",
            "description": "unixtimestamp",
            "metadata": ""
        },
        {
            "channelAddress": "ev_energy_consumption_",
            "type": "DOUBLE",
            "description": "ev_energy_consumption_",
            "metadata": ""
        },
        {
            "channelAddress": "grid_power",
            "type": "DOUBLE",
            "description": "grid_power",
            "metadata": ""
        },
        {
            "channelAddress": "hp_power_consumption",
            "type": "DOUBLE",
            "description": "hp_power_consumption",
            "metadata": ""
        },
        {
            "channelAddress": "hp_energy_consumption",
            "type": "DOUBLE",
            "description": "hp_energy_consumption",
            "metadata": ""
        },
        {
            "channelAddress": "gride_energy_import",
            "type": "DOUBLE",
            "description": "gride_energy_import",
            "metadata": ""
        },
        {
            "channelAddress": "pv_power_production",
            "type": "DOUBLE",
            "description": "pv_power_production",
            "metadata": ""
        },
        {
            "channelAddress": "YYYYMMDD",
            "type": "DOUBLE",
            "description": "YYYYMMDD",
            "metadata": ""
        },
        {
            "channelAddress": "pv_energy_production",
            "type": "DOUBLE",
            "description": "pv_energy_production",
            "metadata": ""
        },
        {
            "channelAddress": "ev_power_consumption",
            "type": "DOUBLE",
            "description": "ev_power_consumption",
            "metadata": ""
        }
    ]
}

get device scan with settings

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

Drivers

add driver

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 driver config

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
    }
}

delete driver

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 drivers

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 driver

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:14:29 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "records": [
        {
            "id": "hhmmss",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614865001,
                "flag": "VALID",
                "value": 171425.0
            }
        },
        {
            "id": "power_photovoltaics",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614865001,
                "flag": "VALID",
                "value": 2.105
            }
        },
        {
            "id": "power_grid",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614865001,
                "flag": "VALID",
                "value": -1.289
            }
        },
        {
            "id": "power_heatpump",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614865001,
                "flag": "VALID",
                "value": 0.584
            }
        },
        {
            "id": "power_electric_vehicle",
            "type": "DOUBLE",
            "record": {
                "timestamp": 1492614865001,
                "flag": "VALID",
                "value": 0.017
            }
        }
    ],
    "running": true
}

get driver devices

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:16:04 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "devices": [
        "home1"
    ],
    "running": true
}

get driver channels

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:17:04 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "channels": [
        "hhmmss",
        "power_photovoltaics",
        "power_grid",
        "power_heatpump",
        "power_electric_vehicle"
    ],
    "running": true
}

get driver is running

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:18:18 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "running": true
}

get driver configs

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:19:08 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "configs": {
        "id": "virtual"
    }
}

get driver configField

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:19:31 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "configs": {
        "samplingTimeout": 10000
    }
}

get driver scan

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:20:20 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "devices": []
}

get driver dummy scan progress info

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:22:15 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "scanProgressInfo": {
        "scanProgress": -1,
        "isScanFinished": false,
        "isScanInterrupted": false,
        "scanError": "Scan settings syntax invalid: No scan settings specified."
    }
}

get driver scan with settings

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 driver infos

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
Status200 OK
Content-Typeapplication/json
DateWed, 19 Apr 2017 15:24:31 GMT
ServerJetty(9.2.9.v20150224)
Transfer-Encodingchunked
X-Powered-ByJetty(9.2.9.v20150224)
{
    "infos": {
        "id": "csv",
        "description": "Driver to read out csv files.",
        "deviceAddressSyntax": "csv file path e.g. /home/usr/bin/openmuc/csv/meter.csv",
        "settingsSyntax": "Synopsis: samplingmode\u003d \u003csamplingmode\u003e [;rewind\u003d \u003crewind\u003e]\n samplingmode: [unixtimestamp, hhmmss, line] Example: samplingmode\u003dline;rewind\u003dtrue Default: samplingmode\u003dline",
        "channelAddressSyntax": "column header",
        "deviceScanSettingsSyntax": "Synopsis: path\u003d \u003cpath\u003e path of directory containing csv files e.g: path\u003d/home/usr/bin/openmuc/csv/."
    }
}

stop driver scanning

Interrupt an active driver scan.

curl -X PUT -H "Content-Type: application/json" "127.0.0.1:8888/rest/drivers/csv/scanInterrupt"
PUT 127.0.0.1:8888/rest/drivers/csv/scanInterrupt HTTP/1.1
Host: 
Content-Type: application/json