How to Use Basic awscli Commands with Storm Object Storage

Storm Object Storage delivers a durable, secure, highly available solution for storage needs of virtually any size. With object storage access occurs via API calls to the object storage cluster, which replaces the need to rely on additional servers for dedicated storage.

Here we use the client awscli to interact with Storm Object Storage. If you don’t have awscli installed then you can follow these instructions: How to Install an Object Storage Command Line Interface (awscli)

Storm Object Storage 101: Command Line
Pre-Flight Check
  • These instructions are intended specifically for using Storm Object Storage.
  • I’ll be working from a Liquid Web Core Managed CentOS 7 server with awscli installed, and I’ll be logged in as root.

Create a Bucket

aws --endpoint-url https://objects.liquidweb.services s3api create-bucket --bucket examplebucket

The bucket is, generally speaking, the container that will hold your data. In this case we’ve specified the bucket to be named examplebucket.

Buckets are used to control access and organize data; they cannot be nested as directories can. They also have to be completely unique across the entire Object Storage cluster. So, even though you may not have a bucket called examplebucket, if someone else does you will receive the following error upon trying to create that bucket:

A client error (BucketAlreadyExists) occurred when calling the CreateBucket operation: Unknown

Be sure to choose a unique name for your bucket!

Upload a File

aws --endpoint-url https://objects.liquidweb.services s3 cp example_file_source.txt s3://examplebucket/example_file_target.txt

This command will upload the file example_file_source.txt (which is in the directory where the command is executed) to the bucket examplebucket with the file name example_file_target.txt. The source file name and the destination file name can be the same, or you can specify a new file name via this command.

Upload Contents of a Directory

aws --endpoint-url https://objects.liquidweb.services s3 sync . s3://examplebucket

This command will upload all of the contents in the directory where the command is executed to the bucket examplebucket.

List Contents of a Bucket

aws --endpoint-url https://objects.liquidweb.services s3 ls examplebucket

This command will list all of the contents in the bucket examplebucket.

List Contents of a Directory Within a Bucket

aws --endpoint-url https://objects.liquidweb.services s3 ls examplebucket/exampledir/

This command will list all of the contents in the directory exampledir which is in the bucket examplebucket.

Be Sociable, Share!
Here's $75, Launch a New VPS Today. Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7 Heroic Support.