...
Query which returns runtime error
Code Block title Request curl -v http://localhost:19002/status/bd7a2b0e-0277-11e6-b512-3e1d05defe78 -X GET
Code Block title Response < HTTP/1.1 500 Internal Server Error Content-Type: application/json { "status": "fatal", "error": { "code": 99, "msg": "Something happen during query execution", "stacktrace": "java.lang.RuntimeException: \n\r at java.lang.Thread.run(Thread.java:745)" } }
Query which is still executing
Code Block title Request curl -v http://localhost:19002/status/bd7a2b0e-0277-11e6-b512-3e1d05defe78 -X GETGET
Code Block title Response < HTTP/1.1 200 OK Content-Type: application/json { "status": "running" }
Query which successfully completes and return URI to its results. Reffer to Query endpoint Example 7 to see the original request.
Code Block title Request curl -v http://localhost:19002/status/bd7a2b0e-0277-11e6-b512-3e1d05defe78 -X GET
Code Block title Response < HTTP/1.1 200 OK Content-Type: application/json { "status": "success", "results": "http://localhost:19002/results/c7e7daed-28cd-472f-890d-62e02909e5e9" "metrics": { "executionTime": 100ms, "resultCount": 10 } }
...
Result Endpoint (/result)
...
Note that the Content-type of the result is set up appropriately to Accept in the initial request.
HTTP Request(GET) format:
http://localhost:19002/results/ID
...
Where ID is a UUID generated and returned by /query endpoint (include-results=false) or by /status endpoint when the asynchronous result is computed.
HTTP Response format:
The response includes only the results with appropriate Content-Type header.
Examples:
Synchronous query results. Refer to Query endpoint Example 6 to see the original request.
Code Block title Request curl -v http://localhost:19002/results/071cde2e-0277-11e6-b512-3e1d05defe78 -X GET
GET
Code Block title Response < HTTP/1.1 200 OK Content-Type: application/x-adm { "id": 1, "screen_name": "BarackObama", "message_text": "Four more years" } { "id": 2, "screen_name": "ElonMusk", "message_text": "I Would Like to Die on Mars, Just Not on Impact" }
Asynchronous query results. Refer to Query endpoint Example 7 & Status endpoint Example 3 to see the original requests.
Code Block title Request curl -v http://localhost:19002/results/c7e7daed-28cd-472f-890d-62e02909e5e9 -X GET
Code Block title Response < HTTP/1.1 200 OK Content-Type: application/json [ { "id": 1, "screen_name": "BarackObama", "message_text": "Four more years" }, { "id": 2, "screen_name": "ElonMusk", "message_text": "I Would Like to Die on Mars, Just Not on Impact" } ]