Apache Geode CHANGELOG

PUT /geode/v1/{region}/{key}?op=REPLACE

Update (replace) data with key(s) if and only if the key(s) exists in region. The Key(s) must be present in the Region for the update to occur.

Resource URL

http://<hostname_or_http-service-bind-address>:<http-service-port>/geode/v1/{region}/{key}?op=REPLACE
http://<hostname_or_http-service-bind-address>:<http-service-port>/geode/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 //geode/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/2014",
     "deliveryDate":  "02/20/2014",
     "contact":  "Jelly Bean",
     "email":  "jelly.bean@example.com",
     "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 Geode server. Check the HTTP response body for a stack trace of the exception.