This commit is contained in:
Fabian Märki
2015-08-21 11:06:58 +02:00
parent 3886bd4c77
commit eb1bdee425

View File

@ -79,6 +79,7 @@ There exist following fields:
- **aggregations**: Activates data aggregation. Array of requested aggregations (see [here](https://github.psi.ch/projects/ST/repos/ch.psi.daq.query/browse/src/main/java/ch/psi/daq/query/model/Aggregation.java) for possible values). These values will be added to the *data* array response.
- **aggregationType**: Specifies the type of aggregation (see [here](https://github.psi.ch/projects/ST/repos/ch.psi.daq.query/browse/src/main/java/ch/psi/daq/query/model/AggregationType.java)). The default type is *value* aggregation (e.g., sum([1,2,3])=6). Alternatively, it is possible to define *index* aggregation for multiple arrays in combination with binning (e.g., sum([1,2,3], [3,2,1]) = [4,4,4]).
- **aggregateChannels**: Specifies whether the data of the requested channels should be combined together using the defined aggregation (values: true|**false**)
- **dbMode**: Defines the database to access (values: **databuffer**|archiverappliance)
### Example
@ -310,11 +311,11 @@ See JSON representation of the data above.
```
{
"dbmode":"archiverappliance",
"startMillis":0,
"startNanos":0,
"endMillis":30,
"endNanos":999999,
"dbmode":"archiverappliance",
"channels":[
"Channel_01"
]
@ -327,9 +328,83 @@ Archiver Appliance supports queries by *time range* and *date range* only (as it
###### Command
```bash
curl -H "Content-Type: application/json" -X POST -d '{"startDate":"1970/01/01 01:00:00.000","startNanos":0,"endDate":"1970/01/01 01: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 '{"dbmode":"archiverappliance","startMillis":0,"startNanos":0,"endMillis":30,"endNanos":999999,"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
```
###### Response
See JSON representation of the data above.
See JSON representation of the data above.
##### Querying for Specific Fields
Allows for server side optimizations since not all data needs to be retrieved.
```
{
"fields":["pulseId","value"]
"startPulseId":0,
"endPulseId":3,
"channels":[
"Channel_01"
]
}
```
Archiver Appliance supports queries by *time range* and *date range* only (as it has no notion about pulse-id).
###### Command
```bash
curl -H "Content-Type: application/json" -X POST -d '{"fields":["pulseId","value"],"startPulseId":0,"endPulseId":3,"channels":["Channel_01"]}' http://sf-nube-14.psi.ch:8080/query
```
###### Response
```json
[
{
"channel":"Channel_01",
"data":[
{
"pulseId":0,
"value":[
1,
2,
3,
4
]
},
{
"pulseId":1,
"value":[
2,
3,
4,
5
]
},
{
"pulseId":2,
"value":[
3,
4,
5,
6
]
},
{
"pulseId":3,
"value":[
4,
5,
6,
7
]
}
]
}
]
```