aliyun-oss-rs
aliyun-oss-rs is an unofficial Rust SDK for Alibaba Cloud Object Storage Service (OSS).
It provides a simple, chainable API with minimal abstractions. Async is enabled by default; a sync feature is available for selected APIs.
Install
Add the dependency in your Cargo.toml:
# Async by default
= { = "0.1.1" }
Enable synchronous APIs if needed:
= { = "0.1.1", = ["sync"] }
Quick Start (Async)
use OssClient;
async
Need to work with STS credentials? Use
OssClient::with_security_token(token)(or the corresponding bucket/object helpers) before sending requests.
Common Operations (Async)
List objects in a bucket:
use OssClient;
async
Upload a file from disk:
use OssClient;
async
Download to a local file:
use OssClient;
async
Generate a pre-signed URL:
use OssClient;
use ;
async
Synchronous notes:
- When enabling
features = ["sync"], several bucket-level APIs offer*_syncvariants (e.g.get_bucket_location_sync). - For object operations that remain async-only, prefer using async directly for now;
the
syncfeature set will continue to expand over time.
Implemented APIs
-
Basic
- List buckets (
ListBuckets) - List regions (
DescribeRegions)
- List buckets (
-
Bucket operations
- Create bucket (
PutBucket) - Delete bucket (
DeleteBucket) - List objects in bucket (
ListObjectsV2) - Get bucket information (
GetBucketInfo) - Get bucket statistics (
GetBucketStat) - Delete multiple objects (
DeleteMultipleObjects) - List unfinished multipart uploads (
ListMultipartUploads) - Get bucket ACL (
GetBucketAcl) - Set bucket ACL (
PutBucketAcl) - Get bucket location (
GetBucketLocation) - Get bucket logging (
GetBucketLogging) - Set bucket logging (
PutBucketLogging) - Delete bucket logging (
DeleteBucketLogging) - Manage bucket CORS (
Get/Put/DeleteBucketCors) - Manage lifecycle rules (
Get/Put/DeleteBucketLifecycle) - Configure referer protection (
Get/Put/DeleteBucketReferer) - Configure static website hosting (
Get/Put/DeleteBucketWebsite) - Manage bucket policies (
Get/Put/DeleteBucketPolicy) - Manage default encryption (
Get/Put/DeleteBucketEncryption) - Work with WORM retention (
Initiate/Get/Complete/Extend/AbortBucketWorm) - Configure inventory reports (
Put/Get/Delete/ListBucketInventory)
- Create bucket (
-
Object operations
- Upload object (
PutObject) - Download object (
GetObject) - Query object with OSS Select (
SelectObject) - Copy object (
CopyObject) - Append object (
AppendObject) - Delete object (
DeleteObject) - Restore object (
RestoreObject) - Head object (
HeadObject) - Get object metadata (
GetObjectMeta) - Generate object URL (
GetObjectUrl) - Multipart upload
- Initiate multipart upload (
InitiateMultipartUpload) - Upload part (
UploadPart) - Upload part copy (
UploadPartCopy) - Complete multipart upload (
CompleteMultipartUpload) - Abort multipart upload (
AbortMultipartUpload) - List parts (
ListParts)
- Initiate multipart upload (
- Object ACL
- Get object ACL (
GetObjectAcl) - Set object ACL (
PutObjectAcl)
- Get object ACL (
- Tagging
- Get object tagging (
GetObjectTagging) - Set object tagging (
PutObjectTagging) - Delete object tagging (
DeleteObjectTagging)
- Get object tagging (
- Symlink
- Create symlink (
PutSymlink) - Get symlink (
GetSymlink)
- Create symlink (
- Upload object (
This project is a work in progress and not an official Alibaba Cloud product. Pull requests are welcome.