A GraphQL service to fetch data from a Tango TTS (Tango TimeSeries) HDB (Historical Database) or TDB (Temporary Archiving Database).
- Usage for production (file application.yml from resources):
mvn package
java -jar target/tango-archiving-graphql-extractor-2.0.0.jar
- To start in dev a environment (file application-dev.yml from resources):
mvn package
java -Dspring.profiles.active=dev -Dspring.output.ansi.enabled=ALWAYS -jar target/tango-archiving-graphql-extractor-2.0.0.jar
- To start with an overridden external configuration
java -jar target/tango-archiving-graphql-extractor-2.0.0.jar -Dspring.config.location=./conf.yml
- Some GraphQL queries examples:
Get attributes names for the pattern *status:
{
attributesNames(attributesPattern: "*status")
}
Get last values of 2 attributes:
{
attributes(attributeNames: ["tango/tangotest/1/double_scalar","tango/tangotest/1/string_spectrum"]) {
info{
name
format
type
writeType
}
timestamps
read
write
}
}
Get values between 2 timestamps:
{
attributes(attributeNames: ["tango/tangotest/1/double_scalar"], startDate: "2017-12-21 16:00:00.000", endDate: "2018-12-31 16:00:00.000") {
read
write
timestamps
info{
name
format
type
writeType
}
}
}
- Subscription example:
subscription {
valuesUpdated(attributesNames: ["tango/tangotest/1/double_scalar"]) {
info {
name
format
type
writeType
}
timestamps
read
write
}
}
- With curl client:
curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ domains}" }' http://webapi-archiving-1.ica.synchrotron-soleil.fr:9000/graphql
curl -X POST -w "@curl_format.txt" -o /dev/null -H "Content-Type: application/json" --data '{ "query": "{ domains}" }' http://hdb-web.ica.synchrotron-soleil.fr/graphql
curl -X POST -H "Content-Type: application/json" --data '{"query": "{ attributes(attributeNames:[\"ANS/CA/MACHINESTATUS/current\",\"ANS-C03/DG/DCCT/lifeTime\",\"ANS-C03/RF/LLE.1/voltageRF\"]) { read, info{ name } } }"}' http://hdb-web.ica.synchrotron-soleil.fr/graphql
curl -X POST -H "Content-Type: application/json" --data '{"query": "{ attributes(attributeNames:[\"ANS/CA/MACHINESTATUS/current\",\"ANS-C03/DG/DCCT/lifeTime\",\"ANS-C03/RF/LLE.1/voltageRF\"], startDate: \"2021-02-01 10:00:00.000\", endDate: \"2021-02-01 12:00:00.000\") { read, info{ name } }}"}' http://hdb-web.ica.synchrotron-soleil.fr/graphql
more curl_format.txt
melookup: %{time_namelookup}s\n
time_connect: %{time_connect}s\n
time_appconnect: %{time_appconnect}s\n
time_pretransfer: %{time_pretransfer}s\n
time_redirect: %{time_redirect}s\n
time_starttransfer: %{time_starttransfer}s\n
----------\n
time_total: %{time_total}s\n