gsutil is Google Cloud Storage's command line tool to access the cloud resources. gsutil has an in-built configuration to access Amazon S3 buckets. This configuration can be used to point the storage host to Wasabi servers as a means of allow you to use gsutil with Wasabi.
1. Install gsutil. Follow all the instructions provided on the documentation page
2. Edit the ~/.boto file to provide Wasabi Access keys and Wasabi endpoint
3. Under the [Credentials] section of the file make the below changes
Uncomment 'aws_access_key_id' , 'aws_secret_access_key', 's3_host' parameters and provide the below values:
# To add HMAC aws credentials for "s3://" URIs, edit and uncomment the
# following two lines:
aws_access_key_id = <WASABI-ACCESS-KEY>
aws_secret_access_key = <WASABI-SECRET-KEY>
# The ability to specify an alternate storage host and port
# is primarily for cloud storage service developers.
# Setting a non-default gs_host only works if prefer_api=xml.
s3_host = s3.wasabisys.com
#s3_port = <alternate storage host port>
4. Sample commands:
List files in bucket:
gsutil ls s3://<BUCKET-NAME>
Write file from local directory to bucket:
gsutil cp <LOCAL-DIRECTORY>/<FILE-NAME> s3://<BUCKET-NAME>
Read file from bucket to local directory:
gsutil cp s3://<BUCKET-NAME>/<PATH-TO-FILE>/<FILE-NAME> <LOCAL-DIRECTORY>/
Note that this example discusses the use of Wasabi's us-east-1 storage region. To use other Wasabi storage regions, please use the appropriate Wasabi service URL as described in this article.