openstack-manuals/doc/common/section_swift_cli_commands.xml
Stephen Gordon e827a0d412 CLI references are shared guides
Move CLI sections to common as they are shared between user guide, admin
user guide, and config reference guide. Update the appendix (which was
already in common) to refer to the new location.

Change-Id: Id51aacea15ce70a90e1a49203665b2797d374e48
2013-09-17 15:34:19 -04:00

70 lines
3.9 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="swift_commands">
<title>swift commands</title>
<para>The swift client is the command-line interface for the
OpenStack Object Storage API.</para>
<para>For help on a specific swift command, enter:</para>
<screen><prompt>$</prompt> <userinput>swift <option>help</option> <replaceable>COMMAND</replaceable></userinput></screen>
<example>
<title>Usage</title>
<screen><prompt>$</prompt> <userinput><command>swift</command> <replaceable>COMMAND</replaceable> <option>[options]</option> <option>[args]</option></userinput></screen>
</example>
<example>
<title>Commands</title>
<screen><computeroutput> stat [container] [object]
Displays information for the account, container, or object depending on the
args given (if any).
list [options] [container]
Lists the containers for the account or the objects for a container. -p or
--prefix is an option that will only list items beginning with that prefix.
-l produces output formatted like 'ls -l' and --lh like 'ls -lh'.
-d or --delimiter is option (for container listings only) that will roll up
items with the given delimiter (see http://docs.openstack.org/
api/openstack-object-storage/1.0/content/list-objects.html)
upload [options] container file_or_directory [file_or_directory] [...]
Uploads to the given container the files and directories specified by the
remaining args. -c or --changed is an option that will only upload files
that have changed since the last upload. -S &lt;size> or --segment-size &lt;size>
will upload the files in segments no larger than size. -C &lt;container> or
--segment-container &lt;container> will specify the location of the segments
to &lt;container>. --leave-segments are options as well (see --help for more).
post [options] [container] [object]
Updates meta information for the account, container, or object depending on
the args given. If the container is not found, it will be created
automatically; but this is not true for accounts and objects. Containers
also allow the -r (or --read-acl) and -w (or --write-acl) options. The -m
or --meta option is allowed on all and used to define the user meta data
items to set in the form Name:Value. This option can be repeated. Example:
post -m Color:Blue -m Size:Large
download --all OR download container [options] [object] [object] ...
Downloads everything in the account (with --all), or everything in a
container, or a list of objects depending on the args given. For a single
object download, you may use the -o [--output] &lt;filename> option to
redirect the output to a specific file or if "-" then just redirect to
stdout.
delete [options] --all OR delete container [options] [object] [object] ...
Deletes everything in the account (with --all), or everything in a
container, or a list of objects depending on the args given. Segments of
manifest objects will be deleted as well, unless you specify the
--leave-segments option.</computeroutput></screen>
</example>
<example>
<title>Examples</title>
<screen><prompt>$</prompt> <userinput>swift -A https://auth.api.rackspacecloud.com/v1.0 -U user -K key stat</userinput></screen>
<screen><prompt>$</prompt> <userinput>swift --os-auth-url https://api.example.com/v2.0 --os-tenant-name tenant \
--os-usernameuser --os-password password list</userinput></screen>
<screen><prompt>$</prompt> <userinput>swift --os-auth-token 6ee5eb33efad4e45ab46806eac010566 \
--os-storage-url https://10.1.5.2:8080/v1/AUTH_ced809b6a4baea7aeab61a \
list</userinput></screen>
<screen><prompt>$</prompt> <userinput>swift list --lh</userinput></screen>
</example>
</section>