LATEST VERSION: 8.2.6 - CHANGELOG
Pivotal GemFire® v8.2

GET /gemfire-api/v1/queries/adhoc?q=<OQL-statement>

GET /gemfire-api/v1/queries/adhoc?q=<OQL-statement>

Run an unnamed (unidentified), ad-hoc query passed as a URL parameter.

Resource URL

http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/queries/adhoc?q=<OQL-statement>

Parameters

Parameter Description Example Values
q Required. OQL query statement.
Note: Since the query string is passed in the URL, the OQL must be URL-encoded. Some HTTP clients such as Web browsers will automatically encode URLs; however, if you are not using one of those clients, you will need to URL encode the query string yourself.
SELECT o FROM /orders o WHERE o.quantity > 2 AND o.totalprice > 110.00

(or URL encoded: SELECT%20o%20FROM%20%2Forders%20o%20WHERE%20o.quantity%20%3E%202%20AND%20o.totalprice%20%3E%20110.00)

SELECT * FROM /customers

(or URL encoded: SELECT%20*%20FROM%20/customers)

Example Request

curl -i "http://localhost:8080/gemfire-api/v1/queries/adhoc?q=select%20*%20%20from%20/customers"

Example Success Response

Response Payload: application/json

200 OK
Content-Length: <#-of-bytes>
Content-Type: application/json
[
    {
        "firstName":  "John",
         "lastName":  "Doe",
         "customerId": 101,
    },
    {
         "firstName":  "Jane",
         "lastName":  "Doe",
         "customerId": 102,
    },
    {
       ....
    }
]

Error Codes

Status Code Description
500 INTERNAL SERVER ERROR Error encountered at GemFire server. Check the HTTP response body for a stack trace of the exception. Some possible exceptions include:
  • Query is not permitted on this type of region!
  • Query execution time is exceeded max query execution time (gemfire.Cache.MAX_QUERY_EXECUTION_TIME) configured!
  • Data referenced in from clause is not available for querying!
  • Query execution gets canceled due to low memory conditions and the resource manager critical heap percentage has been set!
  • Server has encountered while executing Adhoc query!