Using the S3 API with CDNShark Storage
CDNShark Storage speaks the S3 API, so you can use the AWS CLI, any AWS SDK, or tools like rclone and Cyberduck. You need three things from your bucket settings: the endpoint URL, the access key, and the secret key.
Configure credentials
export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
AWS CLI
# List objects
aws s3 ls s3://YOUR_BUCKET \
--endpoint-url https://storage.cdnshark.com
# Upload a file
aws s3 cp ./logo.png s3://YOUR_BUCKET/images/logo.png \
--endpoint-url https://storage.cdnshark.com
# Download a file
aws s3 cp s3://YOUR_BUCKET/images/logo.png ./logo.png \
--endpoint-url https://storage.cdnshark.com
Python (boto3)
import boto3
s3 = boto3.client(
"s3",
endpoint_url="https://storage.cdnshark.com",
aws_access_key_id="YOUR_ACCESS_KEY",
aws_secret_access_key="YOUR_SECRET_KEY",
region_name="auto",
)
s3.upload_file("logo.png", "YOUR_BUCKET", "images/logo.png")
Notes
- Use a path-style endpoint (
https://storage.cdnshark.com/YOUR_BUCKET) — virtual-host style may not be available on every client. - Set the region to
autoif your client requires one. - Supported operations include put, get, list, delete, and multipart uploads.