Storm Object Storage 101: Command Line
I. How to Install an Object Storage Command Line Interface (AWS CLI) II. How to Configure AWS CLI for Use with Storm Object Storage III. How to Use Basic AWS CLI Commands with Storm Object Storage
- These instructions are intended specifically for using Storm Object Storage.
- I’ll be working from a Liquid Web Core Managed CentOS 7 server with AWS CLI installed, and I’ll be logged in as root.
Create a Bucket
aws --endpoint-url https://objects.liquidweb.services s3api create-bucket --bucket examplebucketThe 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.txtThis 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://examplebucketThis 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 examplebucketThis 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.