Creating/Updating an Object

A PUT operation will store the message body of an HTTP PUT request in the ScaleOut StateServer service at the specified URL. The If-Match (RFC2616 sec. 14.24) and If-None-Match (RFC2616 sec. 14.26) HTTP headers can be used with a PUT for optimistic concurrency control.

Request

PUT /data/{Namespace}/{ObjectKey}
Request Headers
Content-Type
(Optional) The media type to associate with the object being stored.
If-Match

(Optional) If the value of this header is set to an asterisk ("*") then the PUT request will only succeed if an object already exists at the specified URL. If the object does not already exist then an HTTP 404 status (Not Found) will be returned.

If the value of this header is set to an entity tag ("ETag") value that was returned from an earlier call then an optimistic update will be performed—the update will only succeed if the object already exists and has not been modified since the ETag value was retrieved from a prior call. If the object has been modified by another caller, the provided ETag value will be out-of-date and the update will fail with an HTTP 412 status (Precondition Failed).

If-None-Match
(Optional) If the value of this header is set to an asterisk ("*") then the PUT request will only succeed if an object does not already exist at the specified URL. If an object already exists then an HTTP 412 status (Precondition Failed) will be returned.
[Note] Note

If neither a If-Match nor a If-None-Match header is provided in a PUT request then the object at the URL will be either created or updated with the contents of the request’s body, regardless of whether the object already does or does not exist. No concurrency control will be performed.

Soss-TimeoutSec
(Optional) Specifies the lifetime of the object in seconds. The default is an infinite timeout (0).
Soss-TimeoutType

(Optional) Specifies one of three valid timeout types. The default is an Absolute timeout:

  • Absolute: The object uses an absolute timeout (default).
  • Sliding: The object uses a sliding timeout that is reset every time an object is accessed (either updated or retrieved).
  • ResetOnUpdate: The object’s timeout is reset when the object is updated, but it is not reset if the object is retrieved.
Soss-EnableLRU

(Optional) Specifies whether the object is subject to LRU (least-recently used) eviction in low memory situations. The default is subject to eviction, or the namespace’s default value if present in the configuration file:

  • true: The object is subject to LRU eviction.
  • false: The object is not subject to LRU eviction.
Soss-EnableReplication

(Optional) Specifies whether the object is eligible for GeoServer push replication. The default is eligible for replication, or the namespace’s default value if present in the configuration file:

  • true: The object is eligible for GeoServer replication.
  • false: The object is not eligible for GeoServer replication.

Response

If successful, the response will contain an empty message body. If an unexpected error occurs, the response’s message body will contain detailed error information in a JSON document (see Errors for more information).

Response Status Codes
201
Success (HTTP Created). The PUT request resulted in the creation of a new object.
204
Success (HTTP No Content). The PUT request successfully updated an object that already existed in the ScaleOut service.
400
Bad Request. One or more parameters were invalid.
404
Not Found. An update-only PUT operation was attempted (using an If-Match header in the request), but an object did not already exist at the specified URL.
412
Precondition failed. An optimistic update failed because the ETag value provided in the request’s If-Match header was out-of-date, or a create-only operation failed (using a "If-None-Match: *" header) because an object already exists at the specified URL.
Response Headers
ETag
An opaque, quoted entity tag value that indicates the current version of the object that has just been created/updated by the caller. This value can be used in later requests to perform cache validation or optimistic updates to the object. (See RFC2616 sec. 14.19 for details on HTTP entity tags.)