Book Image

OpenStack Essentials

By : Dan Radez
Book Image

OpenStack Essentials

By: Dan Radez

Overview of this book

Table of Contents (20 chapters)
OpenStack Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating and using object storage


The two main concepts when using Swift are containers and objects. Containers are groups of files that contain objects. Objects are simply files and must exist inside of a container. On the Swift command line, you cannot create an empty container. A container is created when the first object is uploaded to it. Make sure that your keystonerc file is sourced, and start by uploading a file to a container. Let's use the packstack.txt file used for installation as an example file to upload:

control# swift upload my_container packstack.txt
control# swift list
control# swift list my_container

You will notice that the list command is used to list both containers and objects. If you don't pass any arguments to the list command, you will get a list of containers. If you pass a container as an argument, you will get a list of the objects in that container. Next, upload the same file, but use its absolute path to upload it, as follows:

control# swift upload my_container...