Reputation: 1649
Following is working in REPL mode:
influx -precision rfc3339 -type=flux -path-prefix=/api/v2/query
> bName = "benchmark_db/autogen"
> import "influxdata/influxdb/v1"
> v1.measurements(bucket: bName)
I would like to wrap the query. According to this doc, I created a script called demo.flux under /home/demo.flux and put the above content in it and initiate following statement:
curl -XPOST localhost:8086/api/v2/query -sS -H 'Accept:application/csv' -H 'Content-type:application/vnd.flux' --data-binary "@/home/demo.flux"
However, it returns with an error:
error
loc 3:1-3:7: invalid statement @3:1-3:7: import
Upvotes: 1
Views: 290