Curl Command for /api/query/exp

166 views
Skip to first unread message

Chris Hannam

unread,
Jul 15, 2016, 7:41:54 AM7/15/16
to open...@googlegroups.com
Hi,
I am struggling to use the example for accessing the url /api/query/exp from the doc page http://opentsdb.net/docs/build/html/api_http/query/exp.html I am using the following cURL command:

curl -i     -H "Accept: application/json" -X POST -d '"time":{"start":"1h-ago","end":"10m-ago","downsampler":{"interval":"15m","aggregator":"max"}}' http://localhost:4242/api/query/exp

I get the follwoing error:

HTTP/1.1 500 Internal Server Error
Content-Type: application/json; charset=UTF-8
Content-Length: 9337

{"error":{"code":500,"message":"com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class net.opentsdb.query.pojo.Query$Builder] from String value ('time'); no single-String constructor/factory method\n at [Source: \"time\":{\"start\":\"1h-ago\",\"end\":\"10m-ago\",\"downsampler\":{\"interval\":\"15m\",\"aggregator\":\"max\"}}; line: 1, column: 1]","trace":"java.lang.IllegalArgumentException: com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class net.opentsdb.query.pojo.Query$Builder] from String value ('time'); no single-String constructor/factory method\n at [Source: \"time\":{\"start\":\"1h-ago\",\"end\":\"10m-ago\",\"downsampler\":{\"interval\":\"15m\",\"aggregator\":\"max\"}}; line: 1, column: 1]\n
...

I have tried most combinations for the JSON string without any success. Where am I going wrong? Also I notice on the web page there is a missing } in the example:

"time":{ "start":"1h-ago", "end":"10m-ago", "downsampler":{"interval":"15m","aggregator":"max"}

Regards,
Chris

Marcin Januszkiewicz

unread,
Jul 18, 2016, 4:42:59 AM7/18/16
to OpenTSDB
You're not actually sending a correct request. See the 'Complete Example' part of the doc page.
Reply all
Reply to author
Forward
0 new messages