Included procedures for creating and managing containers and objects

Included sections 'Create and manage containers' and 'Manage objects' in the
CLI chapter of the End User guide.
Closes-Bug: #1282291

Change-Id: I23a488305ea50ff1a4df8958dda98b66898ff976
This commit is contained in:
Deepti Navale
2014-02-27 14:01:31 +10:00
parent 742681de0e
commit c99f033001
2 changed files with 91 additions and 11 deletions

View File

@@ -31,8 +31,7 @@
<?hard-pagebreak?>
<xi:include href="section_cli_nova_config-drive.xml"/>
<?hard-pagebreak?>
<xi:include
href="../common/section_cli_neutron_manage_networks.xml"/>
<xi:include href="../common/section_cli_neutron_manage_networks.xml"/>
<?hard-pagebreak?>
<xi:include href="section_cli_swift_howto.xml"/>
<?hard-pagebreak?>

View File

@@ -4,6 +4,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
xml:id="managing-openstack-object-storage-with-swift-cli">
<title>Manage objects and containers</title>
<?dbhtml stop-chunking?>
<para>The OpenStack Object Storage Service provides the
<command>swift</command> client, which is a command-line
interface (CLI). Use this client to list objects and
@@ -15,14 +16,22 @@
re-authenticates if the current token expires during
processing, retries operations multiple times, and provides a
processing concurrency of 10.</para>
<para>Users have roles on accounts. For example, a user with the
admin role has full access to all containers and objects in an
account. You can set access control lists (ACLs) at the
container level and support lists for read and write access,
which you set with the <literal>X-Container-Read</literal> and
<literal>X-Container-Write</literal> header,
respectively.</para>
<para>To give a user read access, use the <command>swift
<section xml:id="cli_create_containers">
<title>Create and manage containers</title>
<procedure>
<step>
<para>To create a container:
</para>
<screen><prompt>$</prompt> <userinput>swift post <replaceable>CONTAINER</replaceable></userinput></screen>
<para>Replace <replaceable>CONTAINER</replaceable> with the name of your container.</para>
<para>Users have roles on accounts. For example, a user with the
admin role has full access to all containers and objects in an
account. You can set access control lists (ACLs) at the
container level and support lists for read and write access,
which you set with the <literal>X-Container-Read</literal> and
<literal>X-Container-Write</literal> header,
respectively.</para>
<para>To give a user read access, use the <command>swift
post</command> command with the <parameter>-r</parameter>
parameter. To give a user write access, use the
<parameter>-w</parameter> parameter.</para>
@@ -37,4 +46,76 @@
<para>The following command gives object access to all referring
domains:</para>
<screen><prompt>$</prompt> <userinput>swift post -r '.r:*'</userinput></screen>
</section>
</step>
<step>
<para>To list all containers:
</para>
<screen><prompt>$</prompt> <userinput>swift list</userinput></screen>
</step>
<step>
<para>To check the status of containers:
</para>
<screen><prompt>$</prompt> <userinput>swift stat</userinput>
<computeroutput>Account: AUTH_7b5970fbe7724bf9b74c245e77c03bcg
Containers: 2
Objects: 3
Bytes: 268826
Accept-Ranges: bytes
X-Timestamp: 1392683866.17952
Content-Type: text/plain; charset=utf-8</computeroutput></screen>
<para>You can also use the <command>swift stat</command> command with the
<replaceable>ACCOUNT</replaceable> or <replaceable>CONTAINER</replaceable>
names as parameters.</para>
<screen><prompt>$</prompt> <userinput>swift stat <replaceable>CONTAINER</replaceable></userinput>
<computeroutput>Account: AUTH_7b5970fbe7724bf9b74c245e77c03bcg
Container: storage1
Objects: 2
Bytes: 240221
Read ACL:
Write ACL:
Sync To:
Sync Key:
Accept-Ranges: bytes
X-Timestamp: 1392683866.20180
Content-Type: text/plain; charset=utf-8</computeroutput></screen>
</step>
</procedure>
</section>
<section xml:id="cli_manage_objects">
<title>Manage objects</title>
<procedure>
<step>
<para>To upload an object to a container:
</para>
<screen><prompt>$</prompt> <userinput>swift upload <replaceable>CONTAINER</replaceable> <replaceable>OBJECT_FILENAME</replaceable></userinput></screen>
<para>To upload in chunks, for large files:
</para>
<screen><prompt>$</prompt> <userinput>swift upload -S <replaceable>CHUNK_SIZE</replaceable> <replaceable>CONTAINER</replaceable> <replaceable>OBJECT_FILENAME</replaceable></userinput></screen>
</step>
<step>
<para>To check the status of the object:</para>
<screen><prompt>$</prompt> <userinput>swift stat <replaceable>CONTAINER</replaceable> <replaceable>OBJECT_FILENAME</replaceable></userinput>
<computeroutput>Account: AUTH_7b5970fbe7724bf9b74c245e77c03bcg
Container: storage1
Object: images
Content Type: application/octet-stream
Content Length: 211616
Last Modified: Tue, 18 Feb 2014 00:40:36 GMT
ETag: 82169623d55158f70a0d720f238ec3ef
Meta Orig-Filename: images.jpg
Accept-Ranges: bytes
X-Timestamp: 1392684036.33306</computeroutput></screen>
</step>
<step>
<para>To list objects in a container:
</para>
<screen><prompt>$</prompt> <userinput>swift list <replaceable>CONTAINER</replaceable> <replaceable>OBJECT_FILENAME</replaceable></userinput></screen>
</step>
<step>
<para>To download an object from a container:
</para>
<screen><prompt>$</prompt> <userinput>swift download <replaceable>CONTAINER</replaceable> <replaceable>OBJECT_FILENAME</replaceable></userinput></screen>
</step>
</procedure>
</section>
</section>