Skip to main content

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

ParameterDescriptionExample Values
opWhen you specify REPLACE for this parameter, data is only updated if the specified key or keys are already present in the region.REPLACE
@typeSpecified 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 CodeDescription
400 BAD REQUESTReturned if the supplied key is not present in the region.
404 NOT FOUNDReturned if the region is not found.
500 INTERNAL SERVER ERRORError encountered at Geode server. Check the HTTP response body for a stack trace of the exception.