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

Listing containers


This section describes how to obtain information about the containers present in an account.

Using the Swift client CLI

Execute the following request:

swift --os-auth-token=token --os-storage-url= 
http://storage.vedams.com/v1/AUTH_8e43ee201cbc4b70bd8bb2f8ae10f025 list

The response is as follows:

cities
countries

Using cURL

The following command shows you how to obtain the same container information using cURL. It shows that the account comprises of two containers and six objects.

Execute this request:

curl -X GET –i http://storage.vedams.com/v1/AUTH_8e43ee201cbc4b70bd8bb2f8ae10f025 -H 'X-Auth_token: token'

The response to the request is as follows:

HTTP/1.1 200 OK
X-Account-Container-Count: 2
X-Account-Object-Count: 6

cities
countries

Here, we see that the output has a header and a body, whereas in the previous example, we only had a header and no body in the output.