2015-08-07 08:43:59 +02:00
2015-05-27 16:59:20 +02:00
2015-08-07 08:38:37 +02:00
2015-08-07 08:43:59 +02:00
2015-05-26 16:33:57 +02:00
2015-05-27 16:59:20 +02:00
2015-06-10 17:06:30 +02:00
2015-07-09 17:00:09 +02:00
2015-07-30 12:16:31 +02:00
2015-08-07 08:38:37 +02:00
2015-07-08 16:18:47 +02:00

#Overview

This project provides a REST interface to execute queries on the databuffer.

Requirements

This project requires Java 8 or greater.

Deployment

Use the instructions provided by ch.psi.daq.install to install the application on a server.

Application Properties

Following files define and describe application properties:

It is possible to overwrite properties by defining new values in ${HOME}/.config/daq/queryrest.properties

REST Interface

Query Channel Names

Request

GET http://<host>:<port>/channels

or

GET http://<host>:<port>/channels/{regex}

Example

curl -H "Content-Type: application/json" -X GET http://sf-nube-14.psi.ch:8080/channels

or

curl -H "Content-Type: application/json" -X GET http://sf-nube-14.psi.ch:8080/channels/TRFCB

Query Data

Request

GET http://<host>:<port>/query

Example

A request is performed using JSON. The JSON query defines the channels to be queried, the range, and how the data should be aggregated (this is optional but highly recommended).

curl -H "Content-Type: application/json" -X GET -d '{"channels":["channel1","channel2"],"startPulseId":0,"endPulseId":4}' http://sf-nube-14.psi.ch:8080/channels

Response example

The response is in JSON.

[
   {
      "channel":"channel1",
      "data":[
         {
            "pulseId":0,
            "iocMillis":0,
            "iocNanos":0,
            "globalMillis":0,
            "globalNanos":0,
            "value":0
         },
         {
            "pulseId":2,
            "iocMillis":2,
            "iocNanos":2,
            "globalMillis":2,
            "globalNanos":2,
            "value":2
         },
         {
            "pulseId":4,
            "iocMillis":4,
            "iocNanos":4,
            "globalMillis":4,
            "globalNanos":4,
            "value":4
         }
      ]
   },
   {
      "channel":"channel2",
      "data":[
         {
            "pulseId":1,
            "iocMillis":1,
            "iocNanos":1,
            "globalMillis":1,
            "globalNanos":1,
            "value":1
         },
         {
            "pulseId":3,
            "iocMillis":3,
            "iocNanos":3,
            "globalMillis":3,
            "globalNanos":3,
            "value":3
         }
      ]
   }
]

JSON Query

Queries are defined using JSON. There exist following fields:

Example JSON Queries

TODO:

Description
Copy of ch.psi.daq.queryrest from git.psi.ch. This contains the documentation of the GLS API.
Readme 1.6 MiB
Languages
Java 100%