6.5 HP StoreAll OS User Guide

curl -X PUT http[s]://<IP_address>:<port>/,<urlpath>/ --header
"Sync-Requested: 1"
The HTTP response will return the "Sync-Result" header in the response with the value that represents
the errno, where 0 (zero) means that sync was done successfully and any other value indicates
sync did not complete and durability is not guaranteed.
Custom metadata assignment
The API provides commands to define a custom metadata attribute for an existing file or directory
in an HTTP share and to delete an existing custom metadata attribute.
For information about retrieving or querying existing custom metadata already applied to files,
see “Metadata queries” (page 218).
Upload custom metadata (add or replace)
This command adds or modifies one or more custom metadata attributes for an existing file or
directory on the HTTP share. If the specified attribute does not exist for the file, it is added to the
custom metadata list for that file or directory. If an attribute already exists, the current value is
replaced with the client’s value.
Custom metadata applied to a directory does not also apply to files or directories in that directory,
only to the directory itself.
Up to 15 metadata attributes can be assigned in one command. However, there is no defined limit
on the number of metadata attributes that can be assigned to a file. To assign more than 15
attributes, send multiple PUT requests for the same file.
The ability to add or replace custom metadata depends on the permissions of the directory and
file being updated. The custom metadata can be changed if the user has permission to navigate
to the directory containing the file (depending on the “x” permission bits of the directory and all
of its parents) and the user has write permission on the file, and write and read permission on the
directory.
Although attributes and values may be up to 80 characters each, HTTP request messages have a
practical limit of about 2000 bytes which supersedes these maximums.
If the file does not exist, a 404 Not Found HTTP error is returned.
The HTTP command is sent in the form of an HTTP PUT request.
HTTP syntax
The HTTP request line format is:
NOTE: Enter the following commands on a single line.
PUT command
PUT /<urlpath>[/<pathname>]?[version=2&]assign=<attribute1>='<value1>'
[,<attribute2>='<value2>'] HTTP/1.1
curl command
The equivalent curl command format is:
curl -g -X PUT "http[s]://<IP_address>:<port>/<urlpath>[/<pathname>]?
assign=<attribute1>=<value1>[,<attribute2=value2>"]
See “Using HTTP” (page 174) for information about the IP address, port, and URL path.
224 HTTP-REST API file-compatible mode shares