To get started using OpenStack Object Storage, we must first create a container. A container in this case is quite similar to a folder on Windows or Linux file directory. However, containers cannot be nested, though deep structures can be created in a fashion similar to the nested folder structure using both container and object names (pseudo folders) when we come to uploading the objects that are stored in these containers. Names we assigned containers and objects are analogous to labels that allow us to interpret as folder structures through the use of a /
character in these labels.
Ensure that you are logged on to a correctly configured OpenStack client as described in Chapter 2, The OpenStack Client, and can access the OpenStack environment as a user with the swiftoperator
privileges.
We will use the developer
user created in the Common OpenStack identity tasks recipe in Chapter 2, The OpenStack Client, with the cookbook4
password; we have also granted this user with the swiftoperator
privileges.
Refer to Chapter 2, The OpenStack Client, for details of setting up your environment to use OpenStack command-line client.
To create a Swift container
on our environment, follow these steps:
openstack container create books
openstack container list
This will give an output like the following:
openstack container set books --property title=cookbooks
openstack container show books
This will give the following output:
/
delimiter in the container name:openstack container create books/chapter1
This will return output like the following:
container show
command by including the full pseudo-folder name:openstack container show books/chapter1
This will give the information like the following:
In OpenStack Object Storage, users with the admin
or swiftoperator
privileges can utilize the Object Storage service. To do so, we first must create containers, where the objects will be stored. Containers may not be nested, though we may create pseudo-folders using the /
delimiter in the container name. To create a container, follow this command-line syntax:
openstack container create container_name
To list available containers, use the following command:
openstack container list
We can also set metadata on each container. Use the following command for setting additional info on a container:
openstack container set container_name --property key=value
Multiple pairs of metadata may be set on each container.
To view container details, execute this command:
openstack container show <container_name>
3.128.206.48