From c99f033001ed4e2151f41944151a0d6c2813e76d Mon Sep 17 00:00:00 2001 From: Deepti Navale Date: Thu, 27 Feb 2014 14:01:31 +1000 Subject: [PATCH] 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 --- doc/user-guide/ch_cli.xml | 3 +- doc/user-guide/section_cli_swift_howto.xml | 99 ++++++++++++++++++++-- 2 files changed, 91 insertions(+), 11 deletions(-) diff --git a/doc/user-guide/ch_cli.xml b/doc/user-guide/ch_cli.xml index cbcc52ef6f..8571a79cd1 100644 --- a/doc/user-guide/ch_cli.xml +++ b/doc/user-guide/ch_cli.xml @@ -31,8 +31,7 @@ - + diff --git a/doc/user-guide/section_cli_swift_howto.xml b/doc/user-guide/section_cli_swift_howto.xml index f61cf7606b..90cb667207 100644 --- a/doc/user-guide/section_cli_swift_howto.xml +++ b/doc/user-guide/section_cli_swift_howto.xml @@ -4,6 +4,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="managing-openstack-object-storage-with-swift-cli"> Manage objects and containers + The OpenStack Object Storage Service provides the swift 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. - 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 X-Container-Read and - X-Container-Write header, - respectively. - To give a user read access, use the swift +
+ Create and manage containers + + + To create a container: + + $ swift post CONTAINER + Replace CONTAINER with the name of your container. + 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 X-Container-Read and + X-Container-Write header, + respectively. + To give a user read access, use the swift post command with the -r parameter. To give a user write access, use the -w parameter. @@ -37,4 +46,76 @@ The following command gives object access to all referring domains: $ swift post -r '.r:*' -
+ + + To list all containers: + + $ swift list + + + To check the status of containers: + + $ swift stat +Account: AUTH_7b5970fbe7724bf9b74c245e77c03bcg +Containers: 2 +Objects: 3 +Bytes: 268826 +Accept-Ranges: bytes +X-Timestamp: 1392683866.17952 +Content-Type: text/plain; charset=utf-8 + You can also use the swift stat command with the + ACCOUNT or CONTAINER + names as parameters. + $ swift stat CONTAINER +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 + + + +
+ Manage objects + + + To upload an object to a container: + + $ swift upload CONTAINER OBJECT_FILENAME + To upload in chunks, for large files: + + $ swift upload -S CHUNK_SIZE CONTAINER OBJECT_FILENAME + + + To check the status of the object: + $ swift stat CONTAINER OBJECT_FILENAME +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 + + + To list objects in a container: + + $ swift list CONTAINER OBJECT_FILENAME + + + To download an object from a container: + + $ swift download CONTAINER OBJECT_FILENAME + + +
+ \ No newline at end of file