You use the HTTP PUT method to store an object in a container. To store an object, you need the write permission for the container.
For a request to store an object, the request body consists of the data in a specified file. This data becomes the object content.
When you store an object, you specify a name for it. The object name does not need to be the same as the name of the file containing the original data. For information on naming objects, see Object names.
If versioning is enabled and you try to store an object with the same name as an existing object, HSwift replaces the old object with a newer version. If versioning is disabled and you try to store an object with the same name as an existing object, HCP returns a 409 (Conflict) status code and does not store the object. For information versioning, see Versioning.
You can add custom metadata to an object in the same request as you use to store the object. To do this, you use X-Object-Meta- headers. For information on custom metadata, see Custom metadata.
When you store an object, HCP returns the ETag for the object in the ETag response header. An ETag is an identifier for the content of an object. ETags are useful for making object-level operations conditional based on the object content. Operations that can be made conditional are storing an object, checking the existence of an object, copying an object, and retrieving an object.
When you store an object, you can use the ETag request header to ensure the integrity of the object data. The value you specify for this header must be the Base 64-encoded MD5 hash of the original file data.
When you include the ETag header in a request to store an object, HCP calculates the Base64-encoded MD5 hash of the data it receives and compares that to the header value. If the values don't match, HCP returns a 422 (Uprocessable Entity) status code and does not store the object.
You can use the Expect request header in a request to store an object to tell the application not to send the request body (the data) to HCP if the request headers are rejected. This prevents unnecessary network bandwidth usage.
© 2015 Hitachi Data Systems Corporation. All rights reserved.