Skip to content

Managing Containers and Objects with the OpenStack CLI

Containers, sometimes called "buckets", are logical units used to organize and store objects (files).

OpenStack Swift Client

To install the command line tools, see OpenStack Python Client.

Note

For large object support (>5 GB per single file), see here.

Configure environment with OpenStack RC file

In order to authenticate to your ScienceCloud project, see instructions for how to download the OpenStack RC file from the web interface and source it in your shell.

Getting started with the Container and Object CLI

Here are some basic commands. For a full listing of commamnds and options, see the OpenStack documentation for Containers and Objects.

Additionally, you can run any command with the --help flag to see full options and examples.

openstack container --help
openstack object --help

And for more specific options for each function, run variations of these commands:

openstack container list --help
openstack object save --help

List all containers

openstack container list

Create a container

openstack container create <container>

List objects in a container

openstack object list <container>

Upload a file to a container

openstack object create <container> <filename>

Download an object from a container

In this case, <object> refers to the name of the file as stored in the container.

openstack object save <container> <object>

Delete an object from a container

Warning

Deleting objects is irreversible.

openstack object delete <container> <object>

Delete a container and objects inside it

Warning

Deleting a container and its objects is irreversible.

openstack container delete <container>

To delete a container and all objects inside it, use the --recursive flag.

openstack container delete --recursive <container>