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

This topic describes the PUT command in VMware Tanzu GemFire to create or 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 double quotes 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 Tanzu GemFire server. Check the HTTP response body for a stack trace of the exception.
  • Query store does not exist!
check-circle-line exclamation-circle-line close-line
Scroll to top icon