6.5 HP StoreAll OS User Guide

IMPORTANT: For metadata, you should not exceed 90 individual key/value pairs for any one
object and the total byte length of all key/value pairs can be approximately 3KB (3072 bytes).
To post metadata to an object:
curl -X POST -i -H "X-Auth-Token:<AUTHENTICATION TOKEN>"
<ENDPOINT>/<CONTAINER>/<file_name_in_container>
-H '<METADATA_KEY>:<METADATA_VALUE>'
NOTE: The metadata must be tagged with a key and value combination. The METADATA_KEY
must follow “X-Object-Meta. So for example, if you want to set the key to the object as “SportType,
then the format should be X-Object-Meta-SportType. See the following sample command.
Sample command:
curl -X POST -i -H "X-Auth-Token: a424c7f293bf4c919069fa3d710f576c"
http://10.21.12.24:8888/v1/AUTH_7b9a902423a582c9eda266dcf3ad69740455f3e86019620d40d7a3adcc3b2dc4/Container1/AustraliaOpen.jpeg
-H "X-Object-Meta-SportType:Tennis" -H "X-Object-Meta-Player:Martina"
Sample output:
HTTP/1.1 202 Accepted
Content-Length: 76
Content-Type: text/html; charset=UTF-8
Date: Tue, 21 Jan 2014 13:01:43 GMT
<html><h1>Accepted<p>The request is accepted for processing.</p></html>
Posting metadata to a container
Examples of metadata you could post to a container are:
The sync key assigned to a container
User information
Information categorizing the type of content that the container should hold
To post metadata to a container:
curl -i -X POST -H "X-Auth-Token:<AUTHENTICATION
TOKEN>"<ENDPOINT>/<CONTAINER> -H '<TYPE_OF_METADATA>:<METADATA_VALUE>'
Sample command:
For example the following command posts metadata about the Sync To and Sync Key.
curl -i -X POST -H 'X-Auth-Token:24d3fa30167f43af89a457dd2cc104c6' -H
'X-Container-Sync-To:http://10.9.34.67:8888/v1/AUTH_7b9a902423a582c9eda266dcf3ad69744037ce77e61f526b0739578e87695f32/tarcont'
-H 'X-Container-Sync-Key: sec123'
'http://10.21.20.8:8888/v1/AUTH_7b9a902423a582c9eda266dcf3ad697473909b181af608c0497bda5fa37ce321/srcont
Sample output:
HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Date: Wed, 30 Oct 2013 05:17:17 GMT
Downloading an object from a container
Use this command to download objects from a container.
To download an object from a container:
curl -o <LOCAL FILENAME> <ENDPOINT>/<CONTAINER>/<FILE DESGINATED FOR
DOWNLOAD> -H "X-Auth-Token:<AUTHENTICATION TOKEN>"
Sample command:
curl -o file1
http://10.10.104.114:8888/v1/AUTH_7b9a902423a582c9eda266dcf3ad6974a2b98e4b21ea7c9e1e8d38f76afdf1b4/container1/file1
-H "X-Auth-Token:e1c7e33615bd4fa3b345ea996b05c786"
In this example, file1 is downloaded to the user’s local directory.
Sample output:
148 Using Object Store