Update readme with new api url
Fix validator with time queries for archiverappliance
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
#Fri Dec 04 11:50:01 CET 2015
|
#Mon Dec 07 08:06:14 CET 2015
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
|
26
Readme.md
26
Readme.md
@ -44,6 +44,8 @@ Upload jar DropIt (from ch.psi.daq.buildall):
|
|||||||
|
|
||||||
# REST Interface
|
# REST Interface
|
||||||
|
|
||||||
|
The REST interface is accessible through `http://data-api.psi.ch/sf`.
|
||||||
|
|
||||||
<a name="query_channel_names"/>
|
<a name="query_channel_names"/>
|
||||||
|
|
||||||
## Query Channel Names
|
## Query Channel Names
|
||||||
@ -69,7 +71,7 @@ POST http://<host>:<port>/channels
|
|||||||
### Example
|
### Example
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"regex": "TRFCA|TRFCB"}' http://sf-nube-14.psi.ch:8080/channels
|
curl -H "Content-Type: application/json" -X POST -d '{"regex": "TRFCA|TRFCB"}' http://data-api.psi.ch/sf/channels
|
||||||
```
|
```
|
||||||
|
|
||||||
<a name="query_range"/>
|
<a name="query_range"/>
|
||||||
@ -156,7 +158,7 @@ There exist following fields:
|
|||||||
### Example
|
### Example
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"range":{"startPulseId":0,"endPulseId":4},"channels":["channel1","channel2"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"range":{"startPulseId":0,"endPulseId":4},"channels":["channel1","channel2"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
### Response example
|
### Response example
|
||||||
@ -297,7 +299,7 @@ Following examples build on a waveform data (see below). They also work for scal
|
|||||||
###### Command
|
###### Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Response
|
###### Response
|
||||||
@ -325,7 +327,7 @@ See JSON representation of the data above.
|
|||||||
###### Command
|
###### Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"range":{"startMillis":0,"startNanos":0,"endMillis":30,"endNanos":999999},"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"range":{"startMillis":0,"startNanos":0,"endMillis":30,"endNanos":999999},"channels":["Channel_01"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Response
|
###### Response
|
||||||
@ -355,7 +357,7 @@ Supported format is ISO8601 *YYYY-MM-DDThh:mm:ss.sTZD* (e.g. *1997-07-16T19:20:3
|
|||||||
###### Command
|
###### Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"range":{"startDate":"1970-01-01T01:00:00.000","startNanos":0,"endDate":"1970-01-01T01:00:00.030","endNanos":999999},"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"range":{"startDate":"1970-01-01T01:00:00.000","startNanos":0,"endDate":"1970-01-01T01:00:00.030","endNanos":999999},"channels":["Channel_01"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Response
|
###### Response
|
||||||
@ -387,7 +389,7 @@ Archiver Appliance supports queries by *time range* and *date range* only (as it
|
|||||||
###### Command
|
###### Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"dbmode":"archiverappliance","range":{"startMillis":0,"startNanos":0,"endMillis":30,"endNanos":999999},"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"dbmode":"archiverappliance","range":{"startMillis":0,"startNanos":0,"endMillis":30,"endNanos":999999},"channels":["Channel_01"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Response
|
###### Response
|
||||||
@ -416,7 +418,7 @@ Allows for server side optimizations since not all data needs to be retrieved.
|
|||||||
###### Command
|
###### Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Response
|
###### Response
|
||||||
@ -469,7 +471,7 @@ Use **none** in case ordering does not matter (allows for server side optimizati
|
|||||||
###### Command
|
###### Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"ordering":"desc","fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"ordering":"desc","fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Response
|
###### Response
|
||||||
@ -522,7 +524,7 @@ curl -H "Content-Type: application/json" -X POST -d '{"ordering":"desc","fields"
|
|||||||
###### Command
|
###### Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"aggregationType":"value","aggregations":["min","max","mean"],"fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"aggregationType":"value","aggregations":["min","max","mean"],"fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Response
|
###### Response
|
||||||
@ -596,7 +598,7 @@ Array value [aggregations](https://github.psi.ch/projects/ST/repos/ch.psi.daq.qu
|
|||||||
###### Command
|
###### Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"nrOfBins":2,"aggregationType":"value","aggregations":["min","max","mean"],"fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"nrOfBins":2,"aggregationType":"value","aggregations":["min","max","mean"],"fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Response
|
###### Response
|
||||||
@ -653,7 +655,7 @@ Array value [aggregations](https://github.psi.ch/projects/ST/repos/ch.psi.daq.qu
|
|||||||
###### Command
|
###### Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"nrOfBins":1,"aggregationType":"index","aggregations":["min","max","mean","sum"],"fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"nrOfBins":1,"aggregationType":"index","aggregations":["min","max","mean","sum"],"fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Response
|
###### Response
|
||||||
@ -722,7 +724,7 @@ curl -H "Content-Type: application/json" -X POST -d '{"nrOfBins":1,"aggregationT
|
|||||||
###### Command
|
###### Command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -H "Content-Type: application/json" -X POST -d '{"aggregationType":"extrema","aggregations":["min","max","sum"],"fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
|
curl -H "Content-Type: application/json" -X POST -d '{"aggregationType":"extrema","aggregations":["min","max","sum"],"fields":["pulseId","value"],"range":{"startPulseId":0,"endPulseId":3},"channels":["Channel_01"]}' http://data-api.psi.ch/sf/query
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Response
|
###### Response
|
||||||
|
@ -44,7 +44,7 @@ public class QueryValidator implements Validator {
|
|||||||
Request request = query.getRequest();
|
Request request = query.getRequest();
|
||||||
|
|
||||||
if (DBMode.archiverappliance.equals(query.getDbMode())) {
|
if (DBMode.archiverappliance.equals(query.getDbMode())) {
|
||||||
if (!(request.getRequestRange() instanceof RequestRangeTime)) {
|
if (!request.getRequestRange().isTimeRangeDefined()) {
|
||||||
errors.reject("dbMode", "ArchiverAppliance supports time range queries only!");
|
errors.reject("dbMode", "ArchiverAppliance supports time range queries only!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user