openstack-manuals/doc/user-guide/section_swift_cli_howto.xml
Andreas Jaeger 62810ddf28 Remove extra whitespace
Fixes output of tools/validate.py --force (except training-guide and
generated files)

Change-Id: I720846d97ab150915b26fb56926f0971d1808a2a
2013-09-13 04:09:26 +02:00

53 lines
2.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0"
xml:id="managing-openstack-object-storage-with-swift-cli">
<title>Managing OpenStack Object Storage with CLI
Swift</title>
<para>In the Object Store (swift) project there is a tool that
can perform a variety of tasks on your storage cluster
named swift. This client utility can be used for adhoc
processing, to gather statistics, list items, update
metadata, upload, download and delete files. It is based
on the native swift client library client.py.
Incorporating client.py into swift provides many benefits
such as seamlessly re-authorizing if the current token
expires in the middle of processing, retrying operations
up to five times and a processing concurrency of 10. All
of these things help make the swift tool robust and great
for operational use.</para>
<section xml:id="swift-acls">
<title>Swift ACLs</title>
<para>Swift ACLs work with users and accounts. Users have
roles on accounts - such as '.admin', which allows
full access to all containers and objects under the
account. ACLs are set at the container level and
support lists for read and write access, which are set
with the X-Container-Read and X-Container-Write header
respectively.</para>
<para>The swift client can be used to set the acls, using
the post subcommand with the option '-r' for the read
ACL, and '-w' for the write ACL. This example allows
the user 'testuser' to read objects in the container:
<programlisting>
$ swift post -r 'testuser'
</programlisting>
This could instead be a list of users.</para>
<para>If you are using the StaticWeb middleware to allow
OpenStack Object Storage to serve public web content,
you should also be aware of the ACL syntax for
managing allowed referrers. The syntax is '.r:'
followed by a list of allowed referrers. For example,
this command allows all referring domains access to
the object:
<programlisting>
$ swift post -r '.r:*'
</programlisting>
</para>
</section>
</section>