Description Returns result for query as JSON. The response is a JSON object that contains some result metadata along with either an embedded result or an opaque handle that can be used to navigate to the result (see the decription of the mode parameter for more details).
Parameters
Command (immediate result delivery)
$ curl -v --data-urlencode "statement=select 1;" \ --data pretty=true \ --data client_context_id=xyz \ http://localhost:19002/query/service
Sample response
> POST /query/service HTTP/1.1 > Host: localhost:19002 > User-Agent: curl/7.43.0 > Accept: */* > Content-Length: 57 > Content-Type: application/x-www-form-urlencoded > < HTTP/1.1 200 OK < transfer-encoding: chunked < connection: keep-alive < content-type: application/json; charset=utf-8 < { "requestID": "5f72e78c-482a-45bf-b174-6443c8273025", "clientContextID": "xyz", "signature": "*", "results": [ { "$1" : 1 } ] , "status": "success", "metrics": { "elapsedTime": "20.263371ms", "executionTime": "19.889389ms", "resultCount": 1, "resultSize": 15 } }
Command (deferred result delivery)
$ curl -v --data-urlencode "statement=select 1;" \ --data mode=deferred \ http://localhost:19002/query/service
Sample response
> POST /query/service HTTP/1.1 > Host: localhost:19002 > User-Agent: curl/7.43.0 > Accept: */* > Content-Length: 37 > Content-Type: application/x-www-form-urlencoded > < HTTP/1.1 200 OK < transfer-encoding: chunked < connection: keep-alive < content-type: application/json; charset=utf-8 < { "requestID": "6df7afb4-5f83-49b6-8c4b-f11ec84c4d7e", "signature": "*", "handle": "http://localhost:19002/query/service/result/7-0", "status": "success", "metrics": { "elapsedTime": "12.270570ms", "executionTime": "11.948343ms", "resultCount": 0, "resultSize": 0 } }
Command (async result delivery)
$ curl -v --data-urlencode "statement=select 1;" \ --data mode=async \ http://localhost:19002/query/service
Sample response
> POST /query/service HTTP/1.1 > Host: localhost:19002 > User-Agent: curl/7.43.0 > Accept: */* > Content-Length: 34 > Content-Type: application/x-www-form-urlencoded > < HTTP/1.1 200 OK < transfer-encoding: chunked < connection: keep-alive < content-type: application/json; charset=utf-8 < { "requestID": "c5858420-d821-4c0c-81a4-2364386827c2", "signature": "*", "status": "running", "handle": "http://localhost:19002/query/service/status/9-0", "metrics": { "elapsedTime": "9.727006ms", "executionTime": "9.402282ms", "resultCount": 0, "resultSize": 0 } }
Description Returns status of an async query request. The response is a JSON object that has a similar structure to the responses for the /query/service endpoint. Possible status values for the status are running, success, timeout, failed, and fatal. If the status value is success, the response also contains a handle to the result. URLs for this endpoint are usually not constructed by the application, they are simply extracted from the handle field of the response to a request to the /query/service endpoint.
Command
This example shows a request/reponse for the (opaque) status handle that was returned by the async result delivery example.
$ curl -v http://localhost:19002/query/service/status/9-0
Sample response
> GET /query/service/status/9-0 HTTP/1.1 > Host: localhost:19002 > User-Agent: curl/7.43.0 > Accept: */* > < HTTP/1.1 200 OK < transfer-encoding: chunked < connection: keep-alive < content-type: application/json; charset=utf-8 < { "status": "success", "handle": "http://localhost:19002/query/service/result/9-0" }
Description Returns result set for an async or deferred query request. The response is a plain result without a wrapping JSON object. URLs for this endpoint are usually not constructed by the application, they are simply extracted from the handle field of the response to a request to the /query/service or the /query/service/status endpoint.
Command
This example shows a request/reponse for the (opaque) result handle that was returned by the deferred result delivery example.
$ curl -v http://localhost:19002/query/service/result/7-0
Sample response
> GET /query/service/result/7-0 HTTP/1.1 > Host: localhost:19002 > User-Agent: curl/7.43.0 > Accept: */* > < HTTP/1.1 200 OK < transfer-encoding: chunked < connection: keep-alive < content-type: application/json < [ { "$1": 1 } ]