User Tools

Site Tools


Sidebar

The VSCP Server

Setup

Configure

Server/Service Discovery

Security

Webserver

UDP

Multicast

TCP/IP Interface

TCP/IP Protocol Description

DRIVER

FILE

UDP

REMOTE

INTERFACE

DM

VAR

TABLE

Websocket

Websocket Commands

Widgets

REST interface

Decision Matrix

Tables

Variables

Drivers

Level I Drivers

Level II Drivers

Appendix

Other documentation

vscp_daemon_rest_interface_table

:!: The table functionality is broken in the head version. This is because it is being rewritten at the moment.

Read Table

Tables is a feature of the daemon that makes it easy to collect time + value data, typically measurements from a sensor. It is a feature of the decision matrix of the VSCP daemon and is described here.

  op=11 or op=TABLE

Read data from a server defined table. Requires a valid session parameter

General Format

http://host:port/vscp/rest?
    vscpsession=session-key&
    format=plain|csv|xml|json|jsonp&
    op=11|table&
    name=name-of-table&
    from=from-date-time&
    to=from-date-time  

Arguments:

  • op - Set to 11|gettable
  • format - can be 0|plain, 1|csv, 2|xml, 3|json or 4|jsonp.
  • vscpsession - A valid session key received from the open method.
  • name - Name of table to fetch data from.
  • from - Time on the form YY-MM-DD HH:MM:SS to start show values from.
  • to - Time on the form YY-MM-DD HH:MM:SS to show values to.

HTTP Request with GET

http://host:port/vscp/rest?vscpsession=d1c13eb83f52f319f14d167962048521 &format=plain|csv|xml|json|jsonp&op=11|table    

to test this with curl use the following format

curl -X GET "http://host:port/vscp/rest? \
    vscpsession=d1c13eb83f52f319f14d167962048521 & \
    format=plain|csv|xml|json|jsonp& \
    op=11|table"
example GET HTTP request
  http://localhost:8080/vscp/rest?  
              vscpsession=d1c13eb83f52f319f14d167962048521&
              format=plain&
              op=11

HTTP Request with POST

curl -X POST "http://localhost:8080/vscp/rest" \
    -H "vscpsession: d1c13eb83f52f319f14d167962048521" \ 
    -d "op=table&format=plain"     

Demo

There is a a demo app in the source tree, that demonstrates this functionality using JavaScript.

Javascript Request with JSONP

Responses

Plain



CSV



XML

 

JSON

 

JSONP

vscp_daemon_rest_interface_table.txt · Last modified: 2016/10/06 21:44 by admin