Central query backend

This commit is contained in:
Fabian Märki
2019-02-14 11:58:25 +01:00
parent 8cdfcb5b82
commit cce7b4f4fb
11 changed files with 854 additions and 287 deletions

View File

@ -82,7 +82,7 @@ POST https://<host>:<port>/channels
#### Command
```bash
curl -H "Content-Type: application/json" -X POST -d '{"regex": "AMPLT|PHASE"}' https://data-api.psi.ch/sf/channels | python -m json.tool
curl -L -H "Content-Type: application/json" -X POST -d '{"regex": "AMPLT|PHASE"}' https://data-api.psi.ch/sf/channels | python -m json.tool
```
#### Response
@ -152,7 +152,7 @@ POST https://<host>:<port>/channels/config
#### Command
```bash
curl -H "Content-Type: application/json" -X POST -d '{"regex": "AMPLT|PHASE|CAM"}' https://data-api.psi.ch/sf/channels/config | python -m json.tool
curl -L -H "Content-Type: application/json" -X POST -d '{"regex": "AMPLT|PHASE|CAM"}' https://data-api.psi.ch/sf/channels/config | python -m json.tool
```
#### Response
@ -233,13 +233,13 @@ GET https://<host>:<port>/channel/config/{channel}
#### Command
```bash
curl -H "Content-Type: application/json" -X POST -d '{"name": "SINEG01-RCIR-PUP10:SIG-AMPLT", "backend":"sf-databuffer"}' https://data-api.psi.ch/sf/channel/config | python -m json.tool
curl -L -H "Content-Type: application/json" -X POST -d '{"name": "SINEG01-RCIR-PUP10:SIG-AMPLT", "backend":"sf-databuffer"}' https://data-api.psi.ch/sf/channel/config | python -m json.tool
```
or
```bash
curl -H "Content-Type: application/json" -X GET https://data-api.psi.ch/sf/channel/config/SINEG01-RCIR-PUP10:SIG-AMPLT | python -m json.tool
curl -L -H "Content-Type: application/json" -X GET https://data-api.psi.ch/sf/channel/config/SINEG01-RCIR-PUP10:SIG-AMPLT | python -m json.tool
```
#### Response
@ -302,7 +302,8 @@ A request is performed by sending a valid JSON object in the HTTP request body.
},
"response":{
"format":"json",
"compression":"none"
"compression":"none",
"allowRedirect":true
},
"mapping":{
"incomplete":"provide-as-is"
@ -507,12 +508,14 @@ It is possible to specify the response format the queried data should have.
```json
"response":{
"format":"json",
"compression":"none"
"compression":"none",
"allowRedirect":true
}
```
- **format**: The format of the response (values: **json**|csv). Please note that `csv` does not support `index` and `extrema` aggregations.
- **compression**: Responses can be compressed when transferred from the server (values: **none**|gzip). If compression is enabled, you have to tell `curl` that the data is compressed by defining the attribute `--compressed` so that it decompresses the data automatically.
- **allowRedirect**: Defines it the central query rest server is allowed to redirect queries to the query rest server of the actual backend given that the query allows for it (values: **true**|false). Redirect needs to be enabled in `curl` using the `-L` option.
<a name="value_mapping"/>
@ -989,7 +992,7 @@ curl -H "Content-Type: application/json" -X POST -d '{"eventFields":["pulseId",
##### Command
```bash
curl -H "Content-Type: application/json" -X POST -d '{"response":{"format":"csv"},"range":{"startPulseId":0,"endPulseId":4},"channels":["channel1","channel2"],"eventFields":["channel","pulseId","iocSeconds","globalSeconds","shape","eventCount","value"]}' https://data-api.psi.ch/sf/query
curl -L -H "Content-Type: application/json" -X POST -d '{"response":{"format":"csv"},"range":{"startPulseId":0,"endPulseId":4},"channels":["channel1","channel2"],"eventFields":["channel","pulseId","iocSeconds","globalSeconds","shape","eventCount","value"]}' https://data-api.psi.ch/sf/query
```
##### Response
@ -1465,7 +1468,8 @@ A request is performed by sending a valid JSON object in the HTTP request body.
],
"response":{
"format":"json",
"compression":"none"
"compression":"none",
"allowRedirect":true
}
}
```