Sample Usage of MapR Object Store Using AWS CLI

You can create a bucket and upload a file, move an object from one bucket to another, deletes an object from a bucket, delete the bucket, list all files in the bucket, and show all files on the file system using the AWS CLI.

# Create a bucket and upload a file
aws s3 mb s3://mybucket/ --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
echo "HelloS3World" > /tmp/helloS3world.txt
aws s3 cp /tmp/hellpS3world.txt s3://mybucket/helloS3world.txt --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
# Move an object from one bucket to another
aws s3 mv s3://firstbucket/helloS3world.txt s3://mybucket/helloS3world.txt --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
# Delete an object from a bucket
aws s3 rm s3://mybucket/helloS3world.txt --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
# Delete the bucket
aws s3 rb s3://mybucket/ --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
# List all files in the bucket
aws s3 ls s3://mybucket/ --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
# Show all files on the filesystem
ls -al /mapr/demo.mapr.com/apps/s3/$(hostname)/mybucket/
Note: The public SSL certificate is generated with the installing of the MapR Object Store at /opt/mapr/objectstore-client/objectstore-client-1.0.0/conf/certs/public.crt.