LATEST VERSION: 9.1.0 - CHANGELOG
Pivotal GemFire® v9.1

POST /gemfire-api/v1/queries?id=<queryId>&q=<OQL-statement>

Create (prepare) the specified parameterized query and assign the corresponding ID for lookup.

Resource URL

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

Parameters

Parameter Description Example Values
id Required. Unique identifier for the named parameterized query. selectCustomers
q Required. OQL query statement. Use doublequotes to surround the OQL query statement.
"SELECT o FROM /orders o WHERE o.quantity > $1 AND o.totalprice > $2"

Note: For this release, you cannot specify the query string inside the request body (as JSON). You must specify the query as a URL parameter.

Example Request

POST /gemfire-api/v1/queries?id=selectOrders&q="SELECT o FROM /orders o WHERE o.quantity > $1 AND o.totalprice > $2"
Accept: application/json

Example Success Response

Response Payload: null

201 CREATED
Location: http://localhost:8080/gemfire-api/v1/queries/selectOrders

Error Codes

Status Code Description
400 BAD REQUEST Query ID not specified or malformed OQL statement
401 UNAUTHORIZED Invalid Username or Password
403 FORBIDDEN Insufficient privileges for operation
409 CONFLICT QueryId already assigned to another query
500 INTERNAL SERVER ERROR Error encountered at Geode server. Check the HTTP response body for a stack trace of the exception.
  • Query store does not exist!