bosh-ali-storage-cli

command module
v0.0.0-...-c303a62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Ali Storage CLI

The Ali Storage CLI is for uploading, fetching and deleting content to and from an Ali OSS. It is highly inspired by the https://github.com/cloudfoundry/bosh-s3cli.

Usage

Given a JSON config file (config.json)...

{
  "access_key_id":             "<string> (required)",
  "access_key_secret":         "<string> (required)",
  "endpoint":                  "<string> (required)",
  "bucket_name":               "<string> (required)"
}
# Command: "put"
# Upload a blob to the blobstore.
./bosh-ali-storage-cli -c config.json put <path/to/file> <remote-blob>

# Command: "get"
# Fetch a blob from the blobstore.
# Destination file will be overwritten if exists.
./bosh-ali-storage-cli -c config.json get <remote-blob> <path/to/file>

# Command: "delete"
# Remove a blob from the blobstore.
./bosh-ali-storage-cli -c config.json delete <remote-blob>

# Command: "exists"
# Checks if blob exists in the blobstore.
./bosh-ali-storage-cli -c config.json exists <remote-blob>

# Command: "sign"
# Create a self-signed url for a blob in the blobstore.
./bosh-ali-storage-cli -c config.json sign <remote-blob> <get|put> <seconds-to-expiration>
Using signed urls with curl
# Uploading a blob:
curl -X PUT -T path/to/file <signed url>

# Downloading a blob:
curl -X GET <signed url>

Running integration tests

To run the integration tests:

  • Export the following variables into your environment:
    export ACCESS_KEY_ID=<your Alibaba access key id>
    export ACCESS_KEY_SECRET=<your Alibaba access key secret>
    export ENDPOINT=<your Alibaba OSS endpoint>
    export BUCKET_NAME=<your Alibaba OSS bucket>
    
  • go build && go test ./integration/...

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
clientfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL