beautypg.com

Durability – HP StoreAll Storage User Manual

Page 198

background image

Download a file using HTTP protocol:

curl -u http://IP_address:port/urlpath/pathname -o

destination path for download>//

Download a file using HTTPS protocol:

curl --cacert -u

https://IP_address:port/urlpath/pathname -o

for download>//

For more information on operations that can be performed for HTTP-StoreAll REST API share in
file-compatible mode, see

“HTTP-REST API file-compatible mode shares” (page 217)

.

Durability

Operations like file upload and delete are first performed in filesystem memory buffers before they
are flushed to disk. Applications that have critical requirements and need to ensure all buffers were
flushed to disk before an HTTP successful response is returned (OK, CREATED or NO CONTENT)
should add the header "Sync-Requested: 1" in the request. Using "Sync-Requested: 1"
will make operations more time and resource consuming.

There is also an option to force the flush in the entire filesystem. This allows applications make all
needed uploads/delete operations as a batch without the header, but after commands completion,
a new request can be made to flush all filesystem segments. This can be done adding the
"Sync-Requested: 1"

header in a PUT request to the HTTP share url path. If this header is

requested, the HTTP response will return the "Sync-Result" header. The value which follows
that response key represents the errno value (defined in the standard Linux header files errno_base.h
and errno.h), where 0 (zero) means that sync was done successfully and any other value indicates
sync did not complete and durability is not guaranteed.

Examples:

Upload a file:

curl -i -T myfile.txt -H "Sync-Requested: 1"

"http://10.10.21.209/myshare/dir0/f1.txt"

HTTP/1.1 100 Continue

HTTP/1.1 201 Created Date: Fri, 19 Jul 2013 16:54:17 GMT Server:

Apache/2.2.14

(Unix) mod_ssl/2.2.14 OpenSSL/0.9.8n DAV/2

Sync-Result: 0

Location: http://10.10.21.209/myshare/dir0/f1.txt

Content-Length: 192

Content-Type: text/html; charset=ISO-8859-1 ...

Delete a file:

curl -i -X DELETE -H "Sync-Requested: 1"

"http://10.10.21.209/myshare/dir0/file.txt"

HTTP/1.1 204

No Content Date: Fri, 19 Jul 2013 16:55:59 GMT Server: Apache/2.2.14

(Unix) mod_ssl/2.2.14 OpenSSL/0.9.8n DAV/2

Sync-Result: 0

Content-Length: 0

Content-Type: text/plain

Sync entire share:

198 Using HTTP