summaryrefslogtreecommitdiffstats
path: root/doc/legacy/docbook/admin_UFO.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/legacy/docbook/admin_UFO.xml')
-rw-r--r--doc/legacy/docbook/admin_UFO.xml1588
1 files changed, 1588 insertions, 0 deletions
diff --git a/doc/legacy/docbook/admin_UFO.xml b/doc/legacy/docbook/admin_UFO.xml
new file mode 100644
index 00000000000..03be14dc9dc
--- /dev/null
+++ b/doc/legacy/docbook/admin_UFO.xml
@@ -0,0 +1,1588 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- This document was created with Syntext Serna Free. --><!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "Administration_Guide.ent">
+%BOOK_ENTITIES;
+]>
+<chapter id="chap-Administration_Guide-UFO">
+ <title>Managing Unified File and Object Storage</title>
+ <para>Unified File and Object Storage (UFO) unifies NAS and object storage technology. It
+provides a system for data storage that enables users to access the same data, both as an object and as a
+file, thus simplifying management and controlling storage costs.
+
+</para>
+ <para>Unified File and Object Storage is built upon Openstack&apos;s Object Storage Swift. Open Stack Object Storage allows users to store and retrieve files and content through a simple Web Service (REST: Representational State Transfer) interface as objects and GlusterFS, allows users to store and retrieve files using Native Fuse and NFS mounts. It uses GlusterFS as a backend file system for Open Stack Swift. It also leverages on Open Stack Swift&apos;s web interface for storing and retrieving files over the web combined with GlusterFS features like scalability and high availability, replication, elastic volume management for data management at disk level.</para>
+ <para>Unified File and Object Storage technology enables enterprises to adopt and deploy
+cloud storage solutions. It allows users to access and modify data as objects from a
+REST interface along with the ability to access and modify files from NAS interfaces including NFS
+and CIFS. In addition to decreasing cost and making it faster and easier to access object data,
+it also delivers massive scalability, high availability and replication of object storage.
+Infrastructure as a Service (IaaS) providers can utilize GlusterFS Unified File and Object Storage technology to enable their own cloud
+storage service. Enterprises can use this technology to accelerate the process of preparing file-based
+applications for the cloud and simplify new application development for cloud computing
+environments.
+
+</para>
+ <para>OpenStack Object Storage is scalable object storage system and it is not a traditional file system. You will not be able to mount this system like traditional SAN or NAS
+volumes and perform POSIX compliant operations. </para>
+ <para><figure>
+ <title>Unified File and Object Storage Architecture</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/UFO_Architecture.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure></para>
+ <section>
+ <title>Components of Object Storage</title>
+ <para>The major components of Object Storage are:
+ </para>
+ <para><emphasis role="bold">Proxy Server</emphasis>
+
+</para>
+ <para>All REST requests to the UFO are routed through the Proxy Server.
+
+
+</para>
+ <para><emphasis role="bold">Objects and Containers </emphasis></para>
+ <para>An object is the basic storage entity and any optional metadata that represents the data
+you store. When you upload data, the data is stored as-is (with no compression or encryption).
+
+</para>
+ <para>A container is a storage compartment for your data and provides a way for you to organize
+your data. Containers can be visualized as directories in a Linux system. Data must be stored in a container and hence objects are created within a container.
+
+</para>
+ <para>It implements objects as files and directories under the container. The object name is a &apos;/&apos; separated path and UFO maps it to directories until the last name in the path, which is marked as a file. With this approach, objects can be accessed as files and directories from native GlusterFS (FUSE) or NFS mounts by providing the &apos;/&apos; separated path.</para>
+ <para><emphasis role="bold">Accounts and Account Servers</emphasis></para>
+ <para>The OpenStack Object Storage system is designed to be used by many different storage
+consumers. Each user is associated with one or more accounts and must identify themselves using an authentication system. While authenticating, users must provide the name of the account for which the authentication is requested.
+
+</para>
+ <para>UFO implements accounts as GlusterFS volumes. So, when a user is granted read/write permission on an account, it means that that user has access to all the data available on that GlusterFS volume.
+
+
+
+
+</para>
+ <para><emphasis role="bold">Authentication and Access Permissions</emphasis>
+
+</para>
+ <para>You must authenticate against an authentication service to receive OpenStack Object
+Storage connection parameters and an authentication token. The token must be passed
+in for all subsequent container or object operations. One authentication service that you
+can use as a middleware example is called <literal>tempauth</literal>.</para>
+ <para>By default, each user has their own storage account and has full access to that
+account. Users must authenticate with their credentials as described above, but once
+authenticated they can manage containers and objects within that account. If a user wants to access the content from another account, they must have API access key or a session token provided by their authentication system.</para>
+ </section>
+ <section>
+ <title>Advantages of using GlusterFS Unified File and Object Storage</title>
+ <para>The following are the advantages of using GlusterFS UFO:</para>
+ <itemizedlist>
+ <listitem>
+ <para>No limit on upload and download files sizes as compared to Open Stack Swift which limits the object size to 5GB.</para>
+ </listitem>
+ <listitem>
+ <para>A unified view of data across NAS and Object Storage technologies.</para>
+ </listitem>
+ <listitem>
+ <para>Using GlusterFS&apos;s UFO has other advantages like the following: </para>
+ <para><itemizedlist>
+ <listitem>
+ <para>High availability</para>
+ </listitem>
+ <listitem>
+ <para>Scalability</para>
+ </listitem>
+ <listitem>
+ <para>Replication</para>
+ </listitem>
+ <listitem>
+ <para>Elastic Volume management</para>
+ </listitem>
+ </itemizedlist></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Preparing to Deploy Unified File and Object Storage</title>
+ <para>This section provides information on pre-requisites and list of dependencies that will be installed
+during the installation of Unified File and Object Storage.
+</para>
+ <section>
+ <title>Pre-requisites </title>
+ <para>GlusterFS&apos;s Unified File and Object Storage needs <literal>user_xattr</literal> support from the underlying disk file system.
+Use the following command to enable <literal>user_xattr</literal> for GlusterFS bricks backend:
+</para>
+ <para><command># mount –o remount,user_xattr <replaceable>device name</replaceable></command></para>
+ <para>For example,
+</para>
+ <para><command># mount –o remount,user_xattr /dev/hda1 </command>
+</para>
+ </section>
+ <section>
+ <title>Dependencies </title>
+ <para>The following packages are installed on GlusterFS when you install Unified File and Object
+Storage:
+
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>curl
+
+
+
+
+
+
+
+
+
+
+
+
+
+</para>
+ </listitem>
+ <listitem>
+ <para>memcached</para>
+ </listitem>
+ <listitem>
+ <para>openssl</para>
+ </listitem>
+ <listitem>
+ <para>xfsprogs</para>
+ </listitem>
+ <listitem>
+ <para>python2.6</para>
+ </listitem>
+ <listitem>
+ <para>pyxattr</para>
+ </listitem>
+ <listitem>
+ <para>python-configobj
+</para>
+ </listitem>
+ <listitem>
+ <para>python-setuptools
+
+</para>
+ </listitem>
+ <listitem>
+ <para>python-simplejson
+
+</para>
+ </listitem>
+ <listitem>
+ <para>python-webob
+
+</para>
+ </listitem>
+ <listitem>
+ <para>python-eventlet
+
+</para>
+ </listitem>
+ <listitem>
+ <para>python-greenlet
+
+</para>
+ </listitem>
+ <listitem>
+ <para>python-pastedeploy
+
+</para>
+ </listitem>
+ <listitem>
+ <para>python-netifaces
+</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ <section>
+ <title>Installing and Configuring Unified File and Object Storage</title>
+ <para>This section provides instructions on how to install and configure Unified File and Object Storage in your storage
+environment.</para>
+ <section id="chap-ation_Guide-Dir_Quota-Enable">
+ <title>Installing Unified File and Object Storage</title>
+ <para>To install Unified File and Object Storage:</para>
+ <orderedlist>
+ <listitem>
+ <para>Download <filename>rhel_install.sh</filename> install script from <ulink url="http://download.gluster.com/pub/gluster/glusterfs/3.2/UFO/"/> .
+</para>
+ </listitem>
+ <listitem>
+ <para>Run
+ <filename>rhel_install.sh</filename> script using the following command:
+</para>
+ <para><command># sh rhel_install.sh</command></para>
+ </listitem>
+ <listitem>
+ <para>Download <filename>swift-1.4.5-1.noarch.rpm</filename> and <filename>swift-plugin-1.0.-1.el6.noarch.rpm</filename> files from <ulink url="http://download.gluster.com/pub/gluster/glusterfs/3.2/UFO/"/>.</para>
+ </listitem>
+ <listitem>
+ <para>Install <filename>swift-1.4.5-1.noarch.rpm</filename> and <filename>swift-plugin-1.0.-1.el6.noarch.rpm</filename> using the following commands:</para>
+ <para><command># rpm -ivh swift-1.4.5-1.noarch.rpm</command></para>
+ <para><command># rpm -ivh swift-plugin-1.0.-1.el6.noarch.rpm</command></para>
+ <para><note>
+ <para>You must repeat the above steps on all the machines on which you want to install Unified File and Object Storage. If you install the Unified File and Object Storage on multiple servers, you can use a load balancer like pound, nginx, and so on to distribute the request across the machines.</para>
+ </note></para>
+ </listitem>
+ </orderedlist>
+ </section>
+ <section>
+ <title>Adding Users</title>
+ <para>The authentication system allows the administrator to grant different levels of access to different users based on the requirement. The following are the types of user permissions:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>admin user
+ </para>
+ </listitem>
+ <listitem>
+ <para>normal user</para>
+ </listitem>
+ </itemizedlist>
+ <para>Admin user has read and write permissions on the account. By default, a normal user has no read or write permissions. A normal user can only authenticate itself to get a Auth-Token. Read or write permission are provided through ACLs by the admin users.</para>
+ <para>Add a new user by adding the following entry in <filename>/etc/swift/proxy-server.conf</filename> file:</para>
+ <para><command>user_&lt;account-name&gt;_&lt;user-name&gt; = &lt;password&gt; [.admin]</command></para>
+ <para>For example, </para>
+ <para><command>user_test_tester = testing .admin</command>
+</para>
+ <note>
+ <para>During installation, the installation script adds few sample users to the <filename>proxy-server.conf</filename> file. It is highly recommended that you remove all the default sample user entries from the configuration file.
+</para>
+ </note>
+ <para>For more information on setting ACLs, see <xref linkend="chap-Administration_Guide-Working_UFO-Setting_ACLs"/>.</para>
+ </section>
+ <section>
+ <title>Configuring Proxy Server</title>
+ <para>The Proxy Server is responsible for connecting to the rest of the OpenStack Object Storage architecture. For each request, it looks up the location of the account, container, or object in the ring and route the request accordingly. The public API is also exposed through the proxy server. When objects are streamed to or from an object server, they are streamed directly through the proxy server to or from the user – the proxy server does not spool them.
+</para>
+ <para>The configurable options pertaining to proxy server are stored in <filename>/etc/swift/proxy-server.conf</filename>. The following is the sample <filename>proxy-server.conf</filename> file:</para>
+ <para><programlisting>[app:proxy-server]
+use = egg:swift#proxy
+allow_account_management=true
+account_autocreate=true
+
+[filter:tempauth]
+use = egg:swift#tempauth user_admin_admin=admin.admin.reseller_admin
+user_test_tester=testing.admin
+user_test2_tester2=testing2.admin
+user_test_tester3=testing3
+
+[filter:healthcheck]
+use = egg:swift#healthcheck
+
+[filter:cache]
+use = egg:swift#memcache</programlisting></para>
+ <para>By default, GlusterFS&apos;s Unified File and Object Storage is configured to support HTTP protocol and uses temporary authentication to authenticate the HTTP requests.</para>
+ </section>
+ <section>
+ <title>Configuring Authentication System</title>
+ <para>Proxy server must be configured to authenticate using <literal>
+ <literal>tempauth</literal>
+ </literal>. </para>
+ </section>
+ <section>
+ <title>Configuring Proxy Server for HTTPS</title>
+ <para>By default, proxy server only handles HTTP request. To configure the proxy server to process HTTPS requests, perform the following steps:</para>
+ <orderedlist>
+ <listitem>
+ <para>Create self-signed cert for SSL using the following commands:</para>
+ <para><programlisting>cd /etc/swift
+openssl req -new -x509 -nodes -out cert.crt -keyout cert.key</programlisting></para>
+ </listitem>
+ <listitem>
+ <para>Add the following lines to <filename>/etc/swift/proxy-server.conf </filename>under <replaceable>[DEFAULT]</replaceable></para>
+ <para><programlisting>bind_port = 443
+ cert_file = /etc/swift/cert.crt
+ key_file = /etc/swift/cert.key</programlisting></para>
+ </listitem>
+ <listitem>
+ <para>Restart the servers using the following commands:</para>
+ <para><programlisting>swift-init main stop
+swift-init main start</programlisting></para>
+ </listitem>
+ </orderedlist>
+ <para>The following are the configurable options:
+</para>
+ <table frame="all">
+ <title>proxy-server.conf Default Options in the [DEFAULT] section </title>
+ <tgroup cols="3">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry>Option </entry>
+ <entry>Default </entry>
+ <entry>Description </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>bind_ip </entry>
+ <entry>0.0.0.0 </entry>
+ <entry>IP Address for server to bind</entry>
+ </row>
+ <row>
+ <entry>bind_port </entry>
+ <entry>80 </entry>
+ <entry>Port for server to bind </entry>
+ </row>
+ <row>
+ <entry>swift_dir </entry>
+ <entry>/etc/swift </entry>
+ <entry>Swift configuration directory </entry>
+ </row>
+ <row>
+ <entry>workers </entry>
+ <entry>1</entry>
+ <entry>Number of workers to fork </entry>
+ </row>
+ <row>
+ <entry>user </entry>
+ <entry>swift </entry>
+ <entry>swift user</entry>
+ </row>
+ <row>
+ <entry>cert_file </entry>
+ <entry/>
+ <entry>Path to the ssl .crt </entry>
+ </row>
+ <row>
+ <entry>key_file </entry>
+ <entry/>
+ <entry>Path to the ssl .key </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table frame="all">
+ <title>proxy-server.conf Server Options in the [proxy-server] section </title>
+ <tgroup cols="3">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry>Option </entry>
+ <entry>Default </entry>
+ <entry>Description </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>use </entry>
+ <entry/>
+ <entry>paste.deploy entry point for the container server. For most cases, this should be <literal>egg:swift#container</literal>. </entry>
+ </row>
+ <row>
+ <entry>log_name </entry>
+ <entry>proxy-server </entry>
+ <entry>Label used when logging </entry>
+ </row>
+ <row>
+ <entry>log_facility </entry>
+ <entry>LOG_LOCAL0 </entry>
+ <entry>Syslog log facility </entry>
+ </row>
+ <row>
+ <entry>log_level </entry>
+ <entry>INFO </entry>
+ <entry>Log level </entry>
+ </row>
+ <row>
+ <entry>log_headers </entry>
+ <entry>True </entry>
+ <entry>If True, log headers in each request </entry>
+ </row>
+ <row>
+ <entry>recheck_account_existence </entry>
+ <entry>60 </entry>
+ <entry>Cache timeout in seconds to send memcached for account existence </entry>
+ </row>
+ <row>
+ <entry>recheck_container_existence </entry>
+ <entry>60 </entry>
+ <entry>Cache timeout in seconds to send memcached for container existence </entry>
+ </row>
+ <row>
+ <entry>object_chunk_size </entry>
+ <entry>65536 </entry>
+ <entry>Chunk size to read from object servers </entry>
+ </row>
+ <row>
+ <entry>client_chunk_size </entry>
+ <entry>65536 </entry>
+ <entry>Chunk size to read from clients </entry>
+ </row>
+ <row>
+ <entry>memcache_servers </entry>
+ <entry>127.0.0.1:11211 </entry>
+ <entry>Comma separated list of memcached servers ip:port </entry>
+ </row>
+ <row>
+ <entry>node_timeout </entry>
+ <entry>10 </entry>
+ <entry>Request timeout to external services </entry>
+ </row>
+ <row>
+ <entry>client_timeout </entry>
+ <entry>60 </entry>
+ <entry>Timeout to read one chunk from a client </entry>
+ </row>
+ <row>
+ <entry>conn_timeout </entry>
+ <entry>0.5 </entry>
+ <entry>Connection timeout to external services </entry>
+ </row>
+ <row>
+ <entry>error_suppression_interval </entry>
+ <entry>60 </entry>
+ <entry>Time in seconds that must elapse since the last error for a node to be considered no longer error limited </entry>
+ </row>
+ <row>
+ <entry>error_suppression_limit </entry>
+ <entry>10 </entry>
+ <entry>Error count to consider a node error limited </entry>
+ </row>
+ <row>
+ <entry>allow_account_management </entry>
+ <entry>false </entry>
+ <entry>Whether account <literal>PUT</literal>s and <literal>DELETE</literal>s are even callable </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section>
+ <title>Configuring Object Server</title>
+ <para>The Object Server is a very simple blob storage server that can store, retrieve, and delete objects stored on local devices. Objects are stored as binary files on the file system with metadata stored in the file’s extended attributes (xattrs). This requires that the underlying file system choice for object servers support xattrs on files.
+
+</para>
+ <para>The configurable options pertaining Object Server are stored in the file <filename>/etc/swift/object-server/1.conf</filename>. The following is the sample <filename>object-server/1.conf</filename> file:</para>
+ <para><programlisting>[DEFAULT]
+devices = /srv/1/node
+mount_check = false
+bind_port = 6010
+user = root
+log_facility = LOG_LOCAL2
+
+[pipeline:main]
+pipeline = gluster object-server
+
+[app:object-server]
+use = egg:swift#object
+
+[filter:gluster]
+use = egg:swift#gluster
+
+[object-replicator]
+vm_test_mode = yes
+
+[object-updater]
+[object-auditor]</programlisting></para>
+ <para>The following are the configurable options:
+</para>
+ <table frame="all">
+ <title>object-server.conf Default Options in the [DEFAULT] section </title>
+ <tgroup cols="3">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry>Option </entry>
+ <entry>Default </entry>
+ <entry>Description </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>swift_dir </entry>
+ <entry>/etc/swift </entry>
+ <entry>Swift configuration directory </entry>
+ </row>
+ <row>
+ <entry>devices </entry>
+ <entry>/srv/node </entry>
+ <entry>Mount parent directory where devices are mounted </entry>
+ </row>
+ <row>
+ <entry>mount_check </entry>
+ <entry>true </entry>
+ <entry>Whether or not check if the devices are mounted to prevent accidentally writing to the root device </entry>
+ </row>
+ <row>
+ <entry>bind_ip </entry>
+ <entry>0.0.0.0 </entry>
+ <entry>IP Address for server to bind</entry>
+ </row>
+ <row>
+ <entry>bind_port </entry>
+ <entry>6000 </entry>
+ <entry>Port for server to bind</entry>
+ </row>
+ <row>
+ <entry>workers </entry>
+ <entry>1 </entry>
+ <entry>Number of workers to fork </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table frame="all">
+ <title>object-server.conf Server Options in the [object-server] section </title>
+ <tgroup cols="3">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry>Option </entry>
+ <entry>Default </entry>
+ <entry>Description </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>use </entry>
+ <entry/>
+ <entry>paste.deploy entry point for the object server. For most cases, this should be <literal>egg:swift#object</literal>. </entry>
+ </row>
+ <row>
+ <entry>log_name </entry>
+ <entry>object-server </entry>
+ <entry>log name used when logging </entry>
+ </row>
+ <row>
+ <entry>log_facility </entry>
+ <entry>LOG_LOCAL0 </entry>
+ <entry>Syslog log facility </entry>
+ </row>
+ <row>
+ <entry>log_level </entry>
+ <entry>INFO </entry>
+ <entry>Logging level </entry>
+ </row>
+ <row>
+ <entry>log_requests </entry>
+ <entry>True </entry>
+ <entry>Whether or not to log each request </entry>
+ </row>
+ <row>
+ <entry>user </entry>
+ <entry>swift </entry>
+ <entry>swift user</entry>
+ </row>
+ <row>
+ <entry>node_timeout </entry>
+ <entry>3</entry>
+ <entry>Request timeout to external services </entry>
+ </row>
+ <row>
+ <entry>conn_timeout </entry>
+ <entry>0.5</entry>
+ <entry>Connection timeout to external services </entry>
+ </row>
+ <row>
+ <entry>network_chunk_size </entry>
+ <entry>65536 </entry>
+ <entry>Size of chunks to read or write over the network </entry>
+ </row>
+ <row>
+ <entry>disk_chunk_size </entry>
+ <entry>65536 </entry>
+ <entry>Size of chunks to read or write to disk </entry>
+ </row>
+ <row>
+ <entry>max_upload_time </entry>
+ <entry>65536 </entry>
+ <entry>Maximum time allowed to upload an object </entry>
+ </row>
+ <row>
+ <entry>slow </entry>
+ <entry>0</entry>
+ <entry>If &gt; 0, Minimum time in seconds for a <literal>PUT</literal> or <literal>DELETE</literal> request to complete </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section>
+ <title>Configuring Container Server</title>
+ <para>The Container Server’s primary job is to handle listings of objects. The listing is done by querying the GlusterFS mount point with path. This query returns a list of all files and directories present under that container.
+</para>
+ <para>The configurable options pertaining to container server are stored in <filename>/etc/swift/container-server/1.conf</filename> file. The following is the sample <filename>container-server/1.conf</filename> file:</para>
+ <para><programlisting>[DEFAULT]
+devices = /srv/1/node
+mount_check = false
+bind_port = 6011
+user = root
+log_facility = LOG_LOCAL2
+
+[pipeline:main]
+pipeline = gluster container-server
+
+[app:container-server]
+use = egg:swift#container
+
+[filter:gluster]
+use = egg:swift#gluster
+
+[container-replicator]
+[container-updater]
+[container-auditor]</programlisting></para>
+ <para>The following are the configurable options:</para>
+ <table frame="all">
+ <title>container-server.conf Default Options in the [DEFAULT] section </title>
+ <tgroup cols="3">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry>Option </entry>
+ <entry>Default </entry>
+ <entry>Description </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>swift_dir </entry>
+ <entry>/etc/swift </entry>
+ <entry>Swift configuration directory </entry>
+ </row>
+ <row>
+ <entry>devices </entry>
+ <entry>/srv/node </entry>
+ <entry>Mount parent directory where devices are mounted </entry>
+ </row>
+ <row>
+ <entry>mount_check </entry>
+ <entry>true </entry>
+ <entry>Whether or not check if the devices are mounted to prevent accidentally writing to the root device </entry>
+ </row>
+ <row>
+ <entry>bind_ip </entry>
+ <entry>0.0.0.0 </entry>
+ <entry>IP Address for server to bind</entry>
+ </row>
+ <row>
+ <entry>bind_port </entry>
+ <entry>6001 </entry>
+ <entry>Port for server to bind</entry>
+ </row>
+ <row>
+ <entry>workers </entry>
+ <entry>1 </entry>
+ <entry>Number of workers to fork </entry>
+ </row>
+ <row>
+ <entry>user </entry>
+ <entry>swift </entry>
+ <entry>Swift user</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table frame="all">
+ <title>container-server.conf Server Options in the [container-server] section </title>
+ <tgroup cols="3">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry>Option </entry>
+ <entry>Default </entry>
+ <entry>Description </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>use </entry>
+ <entry/>
+ <entry>paste.deploy entry point for the container server. For most cases, this should be <literal>egg:swift#container</literal>. </entry>
+ </row>
+ <row>
+ <entry>log_name </entry>
+ <entry>container-server </entry>
+ <entry>Label used when logging </entry>
+ </row>
+ <row>
+ <entry>log_facility </entry>
+ <entry>LOG_LOCAL0 </entry>
+ <entry>Syslog log facility </entry>
+ </row>
+ <row>
+ <entry>log_level </entry>
+ <entry>INFO </entry>
+ <entry>Logging level </entry>
+ </row>
+ <row>
+ <entry>node_timeout </entry>
+ <entry>3 </entry>
+ <entry>Request timeout to external services </entry>
+ </row>
+ <row>
+ <entry>conn_timeout </entry>
+ <entry>0.5 </entry>
+ <entry>Connection timeout to external services </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section>
+ <title>Configuring Account Server</title>
+ <para>The Account Server is very similar to the Container Server, except that it is responsible for listing of containers rather than objects. In UFO, each gluster volume is an account.
+</para>
+ <para>The configurable options pertaining to account server are stored in <filename>/etc/swift/account-server/1.conf</filename> file. The following is the sample <filename>account-server/1.conf</filename> file: </para>
+ <para><programlisting>[DEFAULT]
+devices = /srv/1/node
+mount_check = false
+bind_port = 6012
+user = root
+log_facility = LOG_LOCAL2
+
+[pipeline:main]
+pipeline = gluster account-server
+
+[app:account-server]
+use = egg:swift#account
+
+[filter:gluster]
+use = egg:swift#gluster
+
+[account-replicator]
+vm_test_mode = yes
+
+[account-auditor]
+[account-reaper]</programlisting></para>
+ <para>The following are the configurable options:</para>
+ <table frame="all">
+ <title>account-server.conf Default Options in the [DEFAULT] section </title>
+ <tgroup cols="3">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry>Option </entry>
+ <entry>Default </entry>
+ <entry>Description </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>swift_dir </entry>
+ <entry>/etc/swift </entry>
+ <entry>Swift configuration directory </entry>
+ </row>
+ <row>
+ <entry>devices </entry>
+ <entry>/srv/node </entry>
+ <entry>mount parent directory where devices are mounted </entry>
+ </row>
+ <row>
+ <entry>mount_check </entry>
+ <entry>true </entry>
+ <entry>Whether or not check if the devices are mounted to prevent accidentally writing to the root device </entry>
+ </row>
+ <row>
+ <entry>bind_ip </entry>
+ <entry>0.0.0.0 </entry>
+ <entry>IP Address for server to bind</entry>
+ </row>
+ <row>
+ <entry>bind_port </entry>
+ <entry>6002 </entry>
+ <entry>Port for server to bind</entry>
+ </row>
+ <row>
+ <entry>workers </entry>
+ <entry>1 </entry>
+ <entry>Number of workers to fork </entry>
+ </row>
+ <row>
+ <entry>user </entry>
+ <entry>swift </entry>
+ <entry>Swift user</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table frame="all">
+ <title>account-server.conf Server Options in the [account-server] section </title>
+ <tgroup cols="3">
+ <colspec colname="c1"/>
+ <colspec colname="c2"/>
+ <colspec colname="c3"/>
+ <thead>
+ <row>
+ <entry>Option </entry>
+ <entry>Default </entry>
+ <entry>Description </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>use </entry>
+ <entry/>
+ <entry>paste.deploy entry point for the container server. For most cases, this should be <literal>egg:swift#container</literal>. </entry>
+ </row>
+ <row>
+ <entry>log_name </entry>
+ <entry>account-server </entry>
+ <entry>Label used when logging </entry>
+ </row>
+ <row>
+ <entry>log_facility </entry>
+ <entry>LOG_LOCAL0 </entry>
+ <entry>Syslog log facility </entry>
+ </row>
+ <row>
+ <entry>log_level </entry>
+ <entry>INFO </entry>
+ <entry>Logging level </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section>
+ <title>Starting and Stopping Server</title>
+ <para>You must start the server manually when system reboots and whenever you update/modify the configuration files.</para>
+ <itemizedlist>
+ <listitem>
+ <para>To start the server, enter the following command:</para>
+ <para><command># swift_init main start</command></para>
+ </listitem>
+ <listitem>
+ <para>To stop the server, enter the following command:</para>
+ <para><command># swift_init main stop</command></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ <section>
+ <title>Working with Unified File and Object Storage</title>
+ <para>This section describes the REST API for administering and managing Object Storage. All requests will
+be directed to the host and URL described in the <filename>X-Storage-URL HTTP</filename> header obtained during
+successful authentication.
+</para>
+ <section>
+ <title>Configuring Authenticated Access </title>
+ <para>Authentication is the process of proving identity to the system. To use the REST interface, you must
+obtain an authorization token using GET method and supply it with v1.0 as the path.
+</para>
+ <para>Each REST request against the Object Storage system requires the addition of a specific authorization
+token HTTP x-header, defined as X-Auth-Token. The storage URL and authentication token are
+returned in the headers of the response.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To authenticate, run the following command:
+</para>
+ <programlisting>GET auth/v1.0 HTTP/1.1
+Host: &lt;auth URL&gt;
+X-Auth-User: &lt;account name&gt;:&lt;user name&gt;
+X-Auth-Key: &lt;user-Password&gt;</programlisting>
+ <para>For example,
+</para>
+ <programlisting>GET auth/v1.0 HTTP/1.1
+Host: auth.example.com
+X-Auth-User: test:tester
+X-Auth-Key: testing
+
+HTTP/1.1 200 OK
+X-Storage-Url: https:/example.storage.com:443/v1/AUTH_test
+X-Storage-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554
+X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554
+Content-Length: 0
+Date: Wed, 10 jul 2011 06:11:51 GMT</programlisting>
+ <para>To authenticate access using cURL (for the above example), run the following
+command:
+</para>
+ <programlisting>curl -v -H &apos;X-Storage-User: test:tester&apos; -H &apos;X-Storage-Pass:testing&apos; -k
+https://auth.example.com:443/auth/v1.0</programlisting>
+ <para>The X-Auth-Url has to be parsed and used in the connection and request line of all subsequent
+requests to the server. In the example output, users connecting to server will send most
+container/object requests with a host header of example.storage.com and the request line&apos;s version
+and account as v1/AUTH_test.
+
+</para>
+ </listitem>
+ </itemizedlist>
+ <note>
+ <para>The authentication tokens are valid for a 24 hour period.
+</para>
+ </note>
+ </section>
+ <section>
+ <title>Working with Accounts </title>
+ <para>This section describes the list of operations you can perform at the account level of the URL.
+</para>
+ <section>
+ <title>Displaying Container Information </title>
+ <para>You can list the objects of a specific container, or all containers, as needed using GET command. You
+can use the following optional parameters with GET request to refine the results:
+</para>
+ <para><informaltable frame="none">
+ <tgroup cols="2">
+ <colspec colnum="1" colname="c0" colsep="0"/>
+ <colspec colnum="2" colname="c1" colsep="0"/>
+ <thead>
+ <row>
+ <entry>Parameter </entry>
+ <entry>Description </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>limit </entry>
+ <entry>Limits the number of results to at most <emphasis role="italic">n</emphasis> value. </entry>
+ </row>
+ <row>
+ <entry>marker </entry>
+ <entry>Returns object names greater in value than the specified marker. </entry>
+ </row>
+ <row>
+ <entry>format </entry>
+ <entry>Specify either json or xml to return the respective serialized response. </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable></para>
+ <para><emphasis role="bold">To display container information </emphasis></para>
+ <itemizedlist>
+ <listitem>
+ <para>List all the containers of an account using the following command:
+</para>
+ <para><programlisting>GET /&lt;apiversion&gt;/&lt;account&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;authentication-token-key&gt;</programlisting></para>
+ <para>For example,
+</para>
+ <programlisting>GET /v1/AUTH_test HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+
+HTTP/1.1 200 Ok
+Date: Wed, 13 Jul 2011 16:32:21 GMT
+Server: Apache
+Content-Type: text/plain; charset=UTF-8
+Content-Length: 39
+
+songs
+movies
+documents
+reports</programlisting>
+ </listitem>
+ </itemizedlist>
+ <para>To display container information using cURL (for the above example), run the following
+command:
+</para>
+ <para><programlisting>curl -v -X GET -H &apos;X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test -k</programlisting></para>
+ </section>
+ <section>
+ <title>Displaying Account Metadata Information </title>
+ <para>You can issue HEAD command to the storage service to view the number of containers and the total
+bytes stored in the account.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To display containers and storage used, run the following command:
+</para>
+ <programlisting>HEAD /&lt;apiversion&gt;/&lt;account&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;authentication-token-key&gt;</programlisting>
+ <para>For example,
+</para>
+ <programlisting>HEAD /v1/AUTH_test HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+
+HTTP/1.1 204 No Content
+Date: Wed, 13 Jul 2011 16:52:21 GMT
+Server: Apache
+X-Account-Container-Count: 4
+X-Account-Total-Bytes-Used: 394792</programlisting>
+ <para>To display account metadata information using cURL (for the above example), run the following
+command:
+</para>
+ <programlisting>curl -v -X HEAD -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test -k</programlisting>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ <section>
+ <title>Working with Containers </title>
+ <para>This section describes the list of operations you can perform at the container level of the URL.
+</para>
+ <section>
+ <title> Creating Containers </title>
+ <para>You can use PUT command to create containers. Containers are the storage folders for your data.
+The URL encoded name must be less than 256 bytes and cannot contain a forward slash &apos;/&apos; character.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To create a container, run the following command:
+</para>
+ <programlisting>PUT /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt;/ HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;authentication-token-key&gt;</programlisting>
+ <para>For example,
+</para>
+ <programlisting>PUT /v1/AUTH_test/pictures/ HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+HTTP/1.1 201 Created
+
+Date: Wed, 13 Jul 2011 17:32:21 GMT
+Server: Apache
+Content-Type: text/plain; charset=UTF-8</programlisting>
+ <para>To create container using cURL (for the above example), run the following command:
+</para>
+ <programlisting>curl -v -X PUT -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/pictures -k</programlisting>
+ <para>The status code of 201 (Created) indicates that you have successfully created the container. If a
+container with same is already existed, the status code of 202 is displayed.
+</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Displaying Objects of a Container </title>
+ <para>You can list the objects of a container using GET command. You can use the following optional
+parameters with GET request to refine the results:
+</para>
+ <para><informaltable frame="none">
+ <tgroup cols="2">
+ <colspec colnum="1" colname="c0" colsep="0"/>
+ <colspec colnum="2" colname="c1" colsep="0"/>
+ <thead>
+ <row>
+ <entry>Parameter </entry>
+ <entry>Description </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>limit </entry>
+ <entry>Limits the number of results to at most <emphasis role="italic">n</emphasis> value. </entry>
+ </row>
+ <row>
+ <entry>marker </entry>
+ <entry>Returns object names greater in value than the specified marker. </entry>
+ </row>
+ <row>
+ <entry>prefix </entry>
+ <entry>Displays the results limited to object names beginning with the substring x. beginning with the substring x. </entry>
+ </row>
+ <row>
+ <entry>path </entry>
+ <entry>Returns the object names nested in the pseudo path. </entry>
+ </row>
+ <row>
+ <entry>format </entry>
+ <entry>Specify either json or xml to return the respective serialized response. </entry>
+ </row>
+ <row>
+ <entry>delimiter </entry>
+ <entry>Returns all the object names nested in the container. </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable></para>
+ <para>To display objects of a container
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>List objects of a specific container using the following command:
+</para>
+ </listitem>
+ </itemizedlist>
+ <programlisting>GET /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt;[parm=value] HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;authentication-token-key&gt;</programlisting>
+ <para>For example,
+</para>
+ <programlisting>GET /v1/AUTH_test/images HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+
+HTTP/1.1 200 Ok
+Date: Wed, 13 Jul 2011 15:42:21 GMT
+Server: Apache
+Content-Type: text/plain; charset=UTF-8
+Content-Length: 139
+
+sample file.jpg
+test-file.pdf
+You and Me.pdf
+Puddle of Mudd.mp3
+Test Reports.doc</programlisting>
+ <para>To display objects of a container using cURL (for the above example), run the following
+command:
+</para>
+ <programlisting>curl -v -X GET-H &apos;X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/images -k</programlisting>
+ </section>
+ <section>
+ <title>Displaying Container Metadata Information </title>
+ <para>You can issue HEAD command to the storage service to view the number of objects in a container and
+the total bytes of all the objects stored in the container.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To display list of objects and storage used, run the following command:
+</para>
+ <programlisting>HEAD /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;authentication-token-key&gt;</programlisting>
+ <para>For example,</para>
+ <programlisting>HEAD /v1/AUTH_test/images HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+
+HTTP/1.1 204 No Content
+Date: Wed, 13 Jul 2011 19:52:21 GMT
+Server: Apache
+X-Account-Object-Count: 8
+X-Container-Bytes-Used: 472</programlisting>
+ <para>To display list of objects and storage used in a container using cURL (for the above example), run
+the following command:
+</para>
+ <programlisting>curl -v -X HEAD -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/images -k</programlisting>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Deleting Container </title>
+ <para>You can use DELETE command to permanently delete containers. The container must be empty
+before it can be deleted.
+</para>
+ <para>You can issue HEAD command to determine if it contains any objects.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To delete a container, run the following command:
+</para>
+ <programlisting>DELETE /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt;/ HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;authentication-token-key&gt;</programlisting>
+ <para>For example,</para>
+ <programlisting>DELETE /v1/AUTH_test/pictures HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+
+HTTP/1.1 204 No Content
+Date: Wed, 13 Jul 2011 17:52:21 GMT
+Server: Apache
+Content-Length: 0
+Content-Type: text/plain; charset=UTF-8</programlisting>
+ <para>To delete a container using cURL (for the above example), run the following command:
+</para>
+ <programlisting>curl -v -X DELETE -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/pictures -k</programlisting>
+ <para>The status code of 204 (No Content) indicates that you have successfully deleted the container. If
+that container does not exist, the status code 404 (Not Found) is displayed, and if the container is
+not empty, the status code 409 (Conflict) is displayed.
+</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Updating Container Metadata </title>
+ <para>You can update the metadata of container using POST operation, metadata keys should be prefixed
+with &apos;x-container-meta&apos;.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To update the metadata of the object, run the following command:
+</para>
+ <programlisting>POST /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;Authentication-token-key&gt;
+X-Container-Meta-&lt;key&gt;: &lt;new value&gt;
+X-Container-Meta-&lt;key&gt;: &lt;new value&gt;</programlisting>
+ <para>For example,
+</para>
+ <para><programlisting>POST /v1/AUTH_test/images HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+X-Container-Meta-Zoo: Lion
+X-Container-Meta-Home: Dog
+
+HTTP/1.1 204 No Content
+Date: Wed, 13 Jul 2011 20:52:21 GMT
+Server: Apache
+Content-Type: text/plain; charset=UTF-8</programlisting></para>
+ <para>To update the metadata of the object using cURL (for the above example), run the following
+command:
+</para>
+ <para><programlisting>curl -v -X POST -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/images -H &apos; X-Container-Meta-Zoo: Lion&apos; -H &apos;X-Container-Meta-Home: Dog&apos; -k</programlisting></para>
+ <para>The status code of 204 (No Content) indicates the container&apos;s metadata is updated successfully. If
+that object does not exist, the status code 404 (Not Found) is displayed.
+</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="chap-Administration_Guide-Working_UFO-Setting_ACLs">
+ <title> Setting ACLs on Container </title>
+ <para>You can set the container access control list by using POST command on container with <command>x- container-read</command> and<command> x-container-write</command> keys.
+</para>
+ <para>The ACL format is <command>[item[,item...]]</command>. Each item can be a group name to give access to or a
+referrer designation to grant or deny based on the HTTP Referer header.
+</para>
+ <para>The referrer designation format is:<command> .r:[-]value</command>.
+</para>
+ <para>The .r can also be <command>.ref, .referer, </command>or .<command>referrer</command>; though it will be shortened to.r for
+decreased character count usage. The value can be <command>*</command> to specify any referrer host is allowed access. The leading minus sign (-)
+indicates referrer hosts that should be denied access.
+</para>
+ <para>Examples of valid ACLs:
+</para>
+ <para><programlisting>.r:*
+.r:*,bobs_account,sues_account:sue
+bobs_account,sues_account:sue</programlisting></para>
+ <para>Examples of invalid ACLs:</para>
+ <para><programlisting>.r:
+.r:-</programlisting></para>
+ <para>By default, allowing read access via <command><command>.</command>r </command>will not allow listing objects in the container but allows
+retrieving objects from the container. To turn on listings, use the .<command>rlistings</command> directive. Also, <command>.r</command>
+designations are not allowed in headers whose names include the word write.
+</para>
+ <para>For example, to set all the objects access rights to &quot;public‟ inside the container using cURL (for the
+above example), run the following command:
+</para>
+ <para><programlisting>curl -v -X POST -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/images
+-H &apos;X-Container-Read: .r:*&apos; -k</programlisting></para>
+ </section>
+ </section>
+ <section>
+ <title> Working with Objects </title>
+ <para>An object represents the data and any metadata for the files stored in the system. Through the REST
+interface, metadata for an object can be included by adding custom HTTP headers to the request
+and the data payload as the request body. Objects name should not exceed 1024 bytes after URL
+encoding.
+</para>
+ <para>This section describes the list of operations you can perform at the object level of the URL.
+</para>
+ <section>
+ <title>Creating or Updating Object </title>
+ <para>You can use PUT command to write or update an object&apos;s content and metadata.
+</para>
+ <para>You can verify the data integrity by including an MD5checksum for the object&apos;s data in the ETag
+header. ETag header is optional and can be used to ensure that the object&apos;s contents are stored
+successfully in the storage system.
+</para>
+ <para>You can assign custom metadata to objects by including additional HTTP headers on the PUT request.
+The objects created with custom metadata via HTTP headers are identified with the<command>X-Object- Meta</command>- prefix.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To create or update an object, run the following command:
+</para>
+ <para><programlisting>PUT /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt;/&lt;object&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;authentication-token-key&gt;
+ETag: da1e100dc9e7becc810986e37875ae38
+Content-Length: 342909
+X-Object-Meta-PIN: 2343</programlisting></para>
+ <para>For example,</para>
+ <para><programlisting>PUT /v1/AUTH_test/pictures/dog HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+ETag: da1e100dc9e7becc810986e37875ae38
+
+HTTP/1.1 201 Created
+Date: Wed, 13 Jul 2011 18:32:21 GMT
+Server: Apache
+ETag: da1e100dc9e7becc810986e37875ae38
+Content-Length: 0
+Content-Type: text/plain; charset=UTF-8</programlisting></para>
+ <para>To create or update an object using cURL (for the above example), run the following command:
+</para>
+ <para><programlisting>curl -v -X PUT -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/pictures/dog -H &apos;Content-
+Length: 0&apos; -k</programlisting></para>
+ <para>The status code of 201 (Created) indicates that you have successfully created or updated the object.
+If there is a missing content-Length or Content-Type header in the request, the status code of 412
+(Length Required) is displayed. (Optionally) If the MD5 checksum of the data written to the storage
+system does not match the ETag value, the status code of 422 (Unprocessable Entity) is displayed.
+</para>
+ </listitem>
+ </itemizedlist>
+ <section>
+ <title>Chunked Transfer Encoding </title>
+ <para>You can upload data without knowing the size of the data to be uploaded. You can do this by
+specifying an HTTP header of Transfer-Encoding: chunked and without using a Content-Length
+header.
+</para>
+ <para>You can use this feature while doing a DB dump, piping the output through gzip, and then piping the
+data directly into Object Storage without having to buffer the data to disk to compute the file size.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To create or update an object, run the following command:
+ </para>
+ <para><programlisting>PUT /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt;/&lt;object&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;authentication-token-key&gt;
+Transfer-Encoding: chunked
+X-Object-Meta-PIN: 2343</programlisting></para>
+ <para>For example,
+</para>
+ <para><programlisting>PUT /v1/AUTH_test/pictures/cat HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+Transfer-Encoding: chunked
+X-Object-Meta-PIN: 2343
+19
+A bunch of data broken up
+D
+into chunks.
+0</programlisting>
+
+</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ <section>
+ <title>Copying Object </title>
+ <para>You can copy object from one container to another or add a new object and then add reference to
+designate the source of the data from another container.
+</para>
+ <para><emphasis role="bold">To copy object from one container to another </emphasis></para>
+ <itemizedlist>
+ <listitem>
+ <para>To add a new object and designate the source of the data from another container, run the
+following command:
+</para>
+ <para><programlisting>COPY /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt;/&lt;sourceobject&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt; authentication-token-key&gt;
+Destination: /&lt;container&gt;/&lt;destinationobject&gt;</programlisting></para>
+ <para>For example,
+</para>
+ <para><programlisting>COPY /v1/AUTH_test/images/dogs HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+Destination: /photos/cats
+
+HTTP/1.1 201 Created
+Date: Wed, 13 Jul 2011 18:32:21 GMT
+Server: Apache
+Content-Length: 0
+Content-Type: text/plain; charset=UTF-8</programlisting></para>
+ <para>To copy an object using cURL (for the above example), run the following command:
+</para>
+ <para><programlisting>curl -v -X COPY -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos; -H &apos;Destination: /photos/cats&apos; -k https://example.storage.com:443/v1/AUTH_test/images/dogs</programlisting></para>
+ <para>The status code of 201 (Created) indicates that you have successfully copied the object. If there is a
+missing content-Length or Content-Type header in the request, the status code of 412 (Length
+Required) is displayed.
+</para>
+ <para>You can also use PUT command to copy object by using additional header <command>X-Copy-From: container/obj</command>.
+</para>
+ </listitem>
+ <listitem>
+ <para>To use PUT command to copy an object, run the following command:
+</para>
+ <para><programlisting>PUT /v1/AUTH_test/photos/cats HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+X-Copy-From: /images/dogs
+
+HTTP/1.1 201 Created
+Date: Wed, 13 Jul 2011 18:32:21 GMT
+Server: Apache
+Content-Type: text/plain; charset=UTF-8</programlisting></para>
+ <para>To copy an object using cURL (for the above example), run the following command:
+</para>
+ <para><programlisting>curl -v -X PUT -H &apos;X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+-H &apos;X-Copy-From: /images/dogs&apos; –k
+https://example.storage.com:443/v1/AUTH_test/images/cats</programlisting></para>
+ <para>The status code of 201 (Created) indicates that you have successfully copied the object.
+</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Displaying Object Information </title>
+ <para>You can issue GET command on an object to view the object data of the object.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To display the content of an object run the following command:</para>
+ <para><programlisting>GET /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt;/&lt;object&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;Authentication-token-key&gt;</programlisting></para>
+ <para>For example,
+</para>
+ <para><programlisting>GET /v1/AUTH_test/images/cat HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+
+HTTP/1.1 200 Ok
+Date: Wed, 13 Jul 2011 23:52:21 GMT
+Server: Apache
+Last-Modified: Thu, 14 Jul 2011 13:40:18 GMT
+ETag: 8a964ee2a5e88be344f36c22562a6486
+Content-Length: 534210
+[.........]</programlisting></para>
+ <para>To display the content of an object using cURL (for the above example), run the following
+command:
+</para>
+ <para><programlisting>curl -v -X GET -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/images/cat -k</programlisting></para>
+ <para>The status code of 200 (Ok) indicates the object‟s data is displayed successfully. If that object does
+not exist, the status code 404 (Not Found) is displayed.
+</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Displaying Object Metadata </title>
+ <para>You can issue HEAD command on an object to view the object metadata and other standard HTTP
+headers. You must send only authorization token as header.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To display the metadata of the object, run the following command:
+</para>
+ </listitem>
+ </itemizedlist>
+ <para><programlisting>HEAD /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt;/&lt;object&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;Authentication-token-key&gt;</programlisting></para>
+ <para>For example,
+</para>
+ <para><programlisting>HEAD /v1/AUTH_test/images/cat HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+
+HTTP/1.1 204 No Content
+Date: Wed, 13 Jul 2011 21:52:21 GMT
+Server: Apache
+Last-Modified: Thu, 14 Jul 2011 13:40:18 GMT
+ETag: 8a964ee2a5e88be344f36c22562a6486
+Content-Length: 512000
+Content-Type: text/plain; charset=UTF-8
+X-Object-Meta-House: Cat
+X-Object-Meta-Zoo: Cat
+X-Object-Meta-Home: Cat
+X-Object-Meta-Park: Cat</programlisting></para>
+ <para>To display the metadata of the object using cURL (for the above example), run the following
+command:
+</para>
+ <para><programlisting>curl -v -X HEAD -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/images/cat -k</programlisting></para>
+ <para>The status code of 204 (No Content) indicates the object‟s metadata is displayed successfully. If that
+object does not exist, the status code 404 (Not Found) is displayed.
+</para>
+ </section>
+ <section>
+ <title>Updating Object Metadata </title>
+ <para>You can issue POST command on an object name only to set or overwrite arbitrary key metadata. You
+cannot change the object‟s other headers such as Content-Type, ETag and others using POST
+operation. The POST command will delete all the existing metadata and replace it with the new
+arbitrary key metadata.
+</para>
+ <para>You must prefix <emphasis role="bold">X-Object-Meta-</emphasis> to the key names.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To update the metadata of an object, run the following command:</para>
+ <para><programlisting>POST /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt;/&lt;object&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;Authentication-token-key&gt;
+X-Object-Meta-&lt;key&gt;: &lt;new value&gt;
+X-Object-Meta-&lt;key&gt;: &lt;new value&gt;</programlisting>
+</para>
+ <para>For example,
+</para>
+ <para><programlisting>POST /v1/AUTH_test/images/cat HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+X-Object-Meta-Zoo: Lion
+X-Object-Meta-Home: Dog
+
+HTTP/1.1 202 Accepted
+Date: Wed, 13 Jul 2011 22:52:21 GMT
+Server: Apache
+Content-Length: 0
+Content-Type: text/plain; charset=UTF-8</programlisting></para>
+ <para>To update the metadata of an object using cURL (for the above example), run the following
+command:
+</para>
+ <para><programlisting>curl -v -X POST -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/images/cat -H &apos; X-Object-
+Meta-Zoo: Lion&apos; -H &apos;X-Object-Meta-Home: Dog&apos; -k</programlisting></para>
+ <para>The status code of 202 (Accepted) indicates that you have successfully updated the object‟s
+metadata. If that object does not exist, the status code 404 (Not Found) is displayed.
+
+</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Deleting Object </title>
+ <para>You can use DELETE command to permanently delete the object.
+</para>
+ <para>The DELETE command on an object will be processed immediately and any subsequent operations
+like GET, HEAD, POST, or DELETE on the object will display 404 (Not Found) error.
+</para>
+ <itemizedlist>
+ <listitem>
+ <para>To delete an object, run the following command:
+</para>
+ <para><programlisting>DELETE /&lt;apiversion&gt;/&lt;account&gt;/&lt;container&gt;/&lt;object&gt; HTTP/1.1
+Host: &lt;storage URL&gt;
+X-Auth-Token: &lt;Authentication-token-key&gt;</programlisting></para>
+ <para>For example,
+</para>
+ <para><programlisting>DELETE /v1/AUTH_test/pictures/cat HTTP/1.1
+Host: example.storage.com
+X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
+
+HTTP/1.1 204 No Content
+Date: Wed, 13 Jul 2011 20:52:21 GMT
+Server: Apache
+Content-Type: text/plain; charset=UTF-8</programlisting></para>
+ <para>To delete an object using cURL (for the above example), run the following command:
+</para>
+ <para><programlisting>curl -v -X DELETE -H &apos;X-Auth-Token:
+AUTH_tkde3ad38b087b49bbbac0494f7600a554&apos;
+https://example.storage.com:443/v1/AUTH_test/pictures/cat -k</programlisting></para>
+ <para>The status code of 204 (No Content) indicates that you have successfully deleted the object. If that
+object does not exist, the status code 404 (Not Found) is displayed.
+</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ </section>
+</chapter>