Appendix C: Setting Client Tools

Appendix C: Setting Client Tools

Standard client tools can be used to browse objects in VPSA Object Storage. This Appendix will help configuring Object Storage Client Tools to work against VPSA Object Storage. In order to access the VPSA Object Storage the client tool must be configured with the user’s authentication credentials.

The Needed parameters can be found in the Object Storage User Information page. Information about the user currently logged in to the Object Storage GUI is displayed by clicking the user name on the GUI upper right corner.

image86

Cloudberry Explorer for OpenStack (v3 authentication)

Use the logged-in User Information properties to set the authentication fields of Cloudberry Explorer

image81

CyberDuck

Use the logged-in User Information properties to set the authentication field of CyberDuck client

image82

S3 Browser and Cloudberry Explorer for S3

Use the logged-in User Information properties to set the authentication fields of S3 Browser / Cloudberry Explorer for S3

image83

S3cmd

The credentials can be retrieved from the VPSA Object Storage logged in “User Information” properties.

/etc/.s3cfg

[default]
access_key = <S3 Access Key>
secret_key = <S3 Secret Key>
host_base = vsa-00000001-cloud-01.zadarazios.com
host_bucket = vsa-00000001-cloud-01.zadarazios.com
use_https = True

Note

  • access_key is the user S3 Access Key
  • secret_key is the user S3 Access Key
  • host_base is the HTTPS path to the VPSA Object Storage being accessed

cURL (swift API)

take the User Token and Account URL from the logged-in User Information properties.

image84

Use the User Token and the Account URL to execute object operations such as creating a container.

$ curl -H "x-auth-token: <user_token>" -X PUT <account_url>/test-bucket1/

Note that the above token is valid for 24 hours, and must be renewed when expires.

The preferred option to identify/renew the API token via an API call is to use a Swift command not the ZIOS command indicated in the Zadara Storage ZIOS REST API User Guide here: http://zios-api.zadarastorage.com


In order to get the token programatically use this Swift API:

$ curl -k -d '{"auth":{"passwordCredentials":{"username": "xxx", "password": "yyy"}, "tenantName":"zzz"}}' -H 'Content-type: application/json' https://<zios-domain-address>:5000/v2.0/tokens

and use the returen token for subsequent APIs.


AWS Command Line Interface

Update the default/create new profile for the VPSA Object Storage within aws configuration file.

~/.aws/config

[profile zadara]
s3 =
    signature_version = s3v4

Note

It is possible to use both AWS v4/v2 signatures with S3-compatible storage such as Zadara VPSA Object Storage.

~/.aws/credentials

[zadara]
aws_access_key_id = <S3 Access Key>
aws_secret_access_key = <S3 Secret Key>

The credentials can be retrieved from the VPSA Object Storage logged in “User Information” properties.

Example of usage:

$ aws s3 --profile=zadara --endpoint-url=https://vsa-00000001-cloud-01.zadarazios.com --region=US ls s3://zadara-test

2018-04-01 19:00 mytestfile1
2018-04-01 19:10 mytestfile2
2018-04-01 19:20 mytestfile3

Note

  • profile is the name of the credentials and config profile specified above (in this case, “zadara”)
  • endpoint-url is the HTTPS path to the VPSA Object Storage being accessed
  • region should match the Region defined in the VPSA Object Storage settings page

boto3 python library

Update the default/create new profile for the VPSA Object Storage within aws configuration file.

~/.aws/config

[profile zadara]
s3 =
    signature_version = s3v4

Note

It is possible to use both AWS v4/v2 signatures with S3-compatible storage such as Zadara VPSA Object Storage.

~/.aws/credentials

[zadara]
aws_access_key_id = <S3 Access Key>
aws_secret_access_key = <S3 Secret Key>

The credentials can be retrieved from the VPSA Object Storage logged in “User Information” properties.

In your python code:

#!/usr/bin/env python

import boto3

session = boto3.session.Session(profile_name='zadara')

s3_client = session.client(
    service_name='s3',
    region_name='US',
    endpoint_url='https://vsa-00000001-cloud-01.zadarazios.com',
)

print('Buckets')
print(s3_client.list_buckets())

print('')

print('Objects')
print(s3_client.list_objects(Bucket='test'))

Note

  • profile_name is the name of the credentials and config profile specified above (in this case, “zadara”)
  • endpoint_url is the HTTPS path to the VPSA Object Storage being accessed
  • region should match the Region defined in the VPSA Object Storage settings page