Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Query which returns runtime error

    Code Block
    titleRequest
    curl -v http://localhost:19002/status/bd7a2b0e-0277-11e6-b512-3e1d05defe78 -X GET
    Code Block
    titleResponse
    < 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)"
      }
    }
  2. Query which is still executing

    Code Block
    titleRequest
    curl -v http://localhost:19002/status/bd7a2b0e-0277-11e6-b512-3e1d05defe78 -X GETGET 

     

    Code Block
    titleResponse
    < HTTP/1.1 200 OK
    Content-Type: application/json
    {
      "status": "running"
    } 
  3. Query which successfully completes and return URI to its results. Reffer to Query endpoint Example 7 to see the original request.

    Code Block
    titleRequest
    curl -v http://localhost:19002/status/bd7a2b0e-0277-11e6-b512-3e1d05defe78 -X GET

     

    Code Block
    titleResponse
    < 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
      }
    } 

...

  1.   

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:

  1. Synchronous query results. Refer to Query endpoint Example 6 to see the original request.

    Code Block
    titleRequest
    curl -v http://localhost:19002/results/071cde2e-0277-11e6-b512-3e1d05defe78 -X GET
     
    GET 
    Code Block
    titleResponse
    < 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"
    }
    

     

  2. Asynchronous query results. Refer to Query endpoint Example 7 & Status endpoint Example 3 to see the original requests.

    Code Block
    titleRequest
    curl -v http://localhost:19002/results/c7e7daed-28cd-472f-890d-62e02909e5e9 -X GET
     
    Code Block
    titleResponse
    < 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"
    } ]