PUT /gemfire-api/v1/{region}/{key}?op=REPLACE

This topic describes the PUT command in VMware Tanzu GemFire to update (replace) data with keys if and only if the keys exists in a region. The keys must be present in the region for the update to occur.

Resource URL

http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/{region}/{key}?op=REPLACE
http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/{region}/{key1},{key2},...{keyN}?op=REPLACE

Parameters

Parameter Description Example Values
op When you specify REPLACE for this parameter, data is only updated if the specified key or keys are already present in the region. REPLACE
@type Specified in the response body. Use this to declare the domain object type of the entry value. com.mycompany.ObjectName

Example Request

Request Payload: application/json
PUT //gemfire-api/v1/orders/2?op=REPLACE

Accept: application/json
Content-Type: application/json
{
     "@type":  "org.apache.geode.web.rest.domain.Order",
     "purchaseOrderNo": 1121,
     "customerId": 1012,
     "description":  "Order for XYZ Corp",
     "orderDate":  "02/10/2020",
     "deliveryDate":  "02/20/2020",
     "contact":  "Jelly Bean",
     "email":  "[email protected]",
     "phone":  "01-2048096",
     "totalPrice": 225,
     "items": [
        {
             "itemNo": 1,
             "description":  "Product-100",
             "quantity": 12,
             "unitPrice": 5,
             "totalPrice": 60
        }
    ]
}

Example Success Response

Response Payload: null

200 OK

Error Codes

Status Code Description
400 BAD REQUEST Returned if the supplied key is not present in the region.
404 NOT FOUND Returned if the region is not found.
500 INTERNAL SERVER ERROR Error encountered at Tanzu GemFire server. Check the HTTP response body for a stack trace of the exception.
check-circle-line exclamation-circle-line close-line
Scroll to top icon