How to Use Object Storage CLI Clients

How to Access and Use Your Object Storage Tenant for S3 CLI Client

  1. Configure the aws client credentials
root@local:~### aws configure --profile webscale

AWS Access Key ID [None]: <Your AWS Access Key ID>
AWS Secret Access Key [None]: <Your AWS Secret Access Key>
Default region name [None]:
Default output format [None]: json

Then you can verify that credentials were configured correctly by showing the content of ~/.aws/credentials The output should match the entered value

root@local:~### cat ~/.aws/credentials
[webscale]
aws_access_key_id = <Your AWS Access Key ID>
aws_secret_access_key = <Your AWS Secret Access Key>
  1. Make a new bucket to store your objects test-bucket
root@local:~### aws s3 mb s3://test-bucket --profile webscale --endpoint-url https://api-object.bluvalt.com:8082

make_bucket: test-bucket
  1. Upload an object to the newly created bucket testfile
root@local:~### aws s3 cp ~/testfile s3://test-bucket/ --profile webscale --endpoint-url https://api-object.bluvalt.com:8082

upload: ~/testfile to s3://test-bucket/testfile
  1. List objects in your newly created bucket
root@local:~### aws s3 ls s3://test-bucket --profile webscale --endpoint-url https://api-object.bluvalt.com:8082

2019-03-27 10:38:35        412 testfile
  1. Download an object from your bucket
root@local:~### aws s3 cp s3://test-bucket/testfile /root/testfile1 --profile webscale --endpoint-url https://api-object.bluvalt.com:8082

download: s3://test-bucket/testfile to root/testfile1
root@local:~### ls
testfile  testfile1
  1. Delete an object from your bucket
root@local:~### aws s3 rm s3://test-bucket/testfile  --profile webscale --endpoint-url https://api-object.bluvalt.com:8082

delete: s3://test-bucket/testfile
  1. Delete a bucket from your tenant with its objects
lomani@LOMANI-PC:~$ aws s3 rb --force s3://cache-test --profile webscale --endpoint-url https://api-object.bluvalt.com:8082
delete: s3://test-bucket/testfile1
delete: s3://test-bucket/testfile2
remove_bucket: test-bucket

How to Access and Use Your Object Storage Tenant for Swift CLI Client

  1. Show the status of your Tenant
root@local:~# swift -A https://api-object.bluvalt.com:8083/auth/v1.0 -U <Tenant ID>:<User Name> -K <YourPassword> stat

     Account: <Tenant ID>
  Containers: 0
     Objects: 0
       Bytes: 0
Accept-Ranges: bytes
  Connection: KEEP-ALIVE
 X-Timestamp: 1553604253.000000
  X-Trans-Id: 628221237

Here as we can see, the Tenant has no container and no object as it’s newly created. 2. Create a new Container to store objects Test-Container

root@local:~# swift -A https://api-object.bluvalt.com:8083/auth/v1.0 -U <Tenant ID>:<User Name> -K <YourPassword> post Test-Container
  1. List your Tenant containers
root@local:~# swift -A https://api-object.bluvalt.com:8083/auth/v1.0 -U <Tenant ID>:<User Name> -K <YourPassword>  list

Test-Container
  1. Upload an object to your container Test-File
root@local:~# swift -A https://api-object.bluvalt.com:8083/auth/v1.0 -U <Tenant ID>:<User Name> -K <YourPassword> upload Test-Container Test-File

Test-File
  1. Download an object from your container
root@local:~# swift -A https://api-object.bluvalt.com:8083/auth/v1.0 -U <Tenant ID>:<User Name> -K <YourPassword> download Test-Container Test-File
hosts [auth 0.273s, headers 0.428s, total 0.440s, 0.002 MB/s]
root@local:~# ls

Test-File
  1. Delete an object from your container
root@local:~# swift -A https://api-object.bluvalt.com:8083/auth/v1.0 -U <Tenant ID>:<User Name> -K <YourPassword> delete Test-Container Test-File