Skip to main content

POST /geode/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>/geode/v1/queries?id=<queryId>&q="<OQL-statement>"

Parameters

ParameterDescriptionExample Values
idRequired. Unique identifier for the named parameterized query.selectCustomers
qRequired. 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 /geode/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/geode/v1/queries/selectOrders

Error Codes

Status CodeDescription
400 BAD REQUESTQuery ID not specified or malformed OQL statement
401 UNAUTHORIZEDInvalid username or password
403 FORBIDDENInsufficient privileges for the operation
409 CONFLICTQueryId already assigned to another query
500 INTERNAL SERVER ERRORError encountered on the server. Check the HTTP response body for a stack trace. Possible cause:

• Query store does not exist