Is there a list of Swift commands I can use with my cluster?

Amanda -

Sure! If you want to get information about accounts, containers and objects in your cluster or just upload, download or delete files (objects), you can install the Swift Command Line Client on your computer.

Alternatively, you can use curl; Swift’s API reference has a chapter on how to use cURL with Swift.

See our technical docs on python-swiftclient for how to install the Swift Command Line Client.

Once you have the Swift Command Line Client installed, you can use it to connect to your cluster.

In the examples below, Cluster API IP address is 192.168.1.10, the User is user and the Key is password.

Check status of cluster (need to be superuser):

$ swift -A http://192.168.1.10/auth/v1.0 -U user -K password stat

List all items in a container called photos:

$ swift -A http://192.168.1.10/auth/v1.0 -U user -K password list photos

List available containers in an account:

$ swift -A http://192.168.1.10/auth/v1.0 -U user -K password list

Create a container called ‘documents’:

$ swift -A http://192.168.1.10/auth/v1.0 -U user -K password post documents

Upload the file ‘test.txt’ to the ‘documents’ container:

$ swift -A http://192.168.1.10/auth/v1.0 -U user -K password upload documents test.txt

Download the ‘image.jpg’ file from the ‘photos’ container:

$ swift -A http://192.168.1.10/auth/v1.0 -U user -K password download photos image.jpg

Delete the file ‘test.txt’ from a container called ‘documents’:

$ swift -A http://192.168.1.10/auth/v1.0 -U user -K password delete documents test.tx
Have more questions? Submit a request

Comments

Powered by Zendesk