Book Image

OpenStack Object Storage Essentials (Update)

Book Image

OpenStack Object Storage Essentials (Update)

Overview of this book

Table of Contents (18 chapters)
OpenStack Object Storage (Swift) Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Swift CLI Commands
Index

The pseudo-hierarchical directories


In OpenStack Swift, object storage can simulate a hierarchical directory structure in containers by including a / (forward slash) character in the object's name.

Let's upload a file (AMERICA/USA/Newyork.txt) to the Continent container using the following command:

# swift upload Continent AMERICA/USA/Newyork.txt

Now let's list the Continent container, which has a few pseudo-hierarchical folders, using the following commands:

# swift list Continent
AMERICA/USA/Newyork.txt
ASIA/ASIA.txt
ASIA/China/China.txt
ASIA/INDIA/India.txt
Australia/Australia.txt
continent.txt

We can use / as the delimiter parameter to limit the displayed results. We can also use the prefix parameter along with the delimiter parameter to view the objects in the pseudo-directory along with the pseudo-directories within it. The following are a couple of examples showing the use of these parameters:

# swift list Continent --delimiter /
AMERICA/
ASIA/
Australia/
continent.txt

# swift list...