Skip to main content

tos-s3

7 configuration options · available in Rust, Java, Python, Node.js, Ruby

Quick start
use opendal::Operator;

let operator = Operator::via_iter("tos-s3", [
("bucket".to_string(), "example-bucket".to_string()),
("endpoint".to_string(), "https://tos-s3-cn-beijing.volces.com".to_string()),
("region".to_string(), "cn-beijing".to_string()),
])?;
All configuration options (copy & trim)
Full reference
use opendal::Operator;

let operator = Operator::via_iter("tos-s3", [
// --- General ---
// Root within the bucket. The default is `/`.
// ("root".to_string(), "/".to_string()),

// Bucket name.
("bucket".to_string(), "example-bucket".to_string()),

// HTTP(S) S3-compatible base endpoint for the selected TOS product and region.
("endpoint".to_string(), "https://tos-s3-cn-beijing.volces.com".to_string()),

// Signing region for the selected TOS S3 endpoint.
("region".to_string(), "cn-beijing".to_string()),
// --- Credentials ---
// TOS access key ID.
// ("access_key_id".to_string(), "...".to_string()),

// TOS secret access key.
// ("secret_access_key".to_string(), "...".to_string()),

// Disable loading credentials from AWS environment variables and shared profile files.
//
// Set both `access_key_id` and `secret_access_key` when enabled.
// ("disable_config_load".to_string(), "false".to_string()),
])?;

Every option is passed as a string key; OpenDAL parses it into the right type. For a map option, pass a string containing a JSON object whose values are strings, such as {"key":"value"}. Some services may require building the binding with the matching services-* feature enabled.

Configuration reference​

General4
KeyTypeRequiredDescription
rootdefault /stringnoRoot within the bucket. The default is /.
buckete.g. example-bucketstringyesBucket name.
endpointe.g. https://tos-s3-cn-beijing.volces.comstringyesHTTP(S) S3-compatible base endpoint for the selected TOS product and region.
regione.g. cn-beijingstringyesSigning region for the selected TOS S3 endpoint.
Credentials3
KeyTypeRequiredDescription
access_key_idstringnoTOS access key ID.
secret_access_keystringnoTOS secret access key.
disable_config_loaddefault falseboolnoDisable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

Entries reflect native capabilities declared by the tos-s3 backend. Language bindings expose different subsets of options and may simulate operations client-side, and protocol-compatible endpoints may support only a subset of the declared features.

Stat9
CapabilitySupportDescription
stat NativeIndicates if the operator supports metadata retrieval operations.
stat_with_if_match NativeIndicates if conditional stat operations using If-Match are supported.
stat_with_if_none_match NativeIndicates if conditional stat operations using If-None-Match are supported.
stat_with_if_modified_since NativeIndicates if conditional stat operations using If-Modified-Since are supported.
stat_with_if_unmodified_since NativeIndicates if conditional stat operations using If-Unmodified-Since are supported.
stat_with_override_cache_control NativeIndicates if Cache-Control header override is supported during stat operations.
stat_with_override_content_disposition NativeIndicates if Content-Disposition header override is supported during stat operations.
stat_with_override_content_type NativeIndicates if Content-Type header override is supported during stat operations.
stat_with_version
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if versions stat operations are supported.
Read10
CapabilitySupportDescription
read NativeIndicates if the operator supports read operations.
read_with_if_match NativeIndicates if conditional read operations using If-Match are supported.
read_with_if_none_match NativeIndicates if conditional read operations using If-None-Match are supported.
read_with_if_modified_since NativeIndicates if conditional read operations using If-Modified-Since are supported.
read_with_if_unmodified_since NativeIndicates if conditional read operations using If-Unmodified-Since are supported.
read_with_override_cache_control NativeIndicates if Cache-Control header override is supported during read operations.
read_with_override_content_disposition NativeIndicates if Content-Disposition header override is supported during read operations.
read_with_override_content_type NativeIndicates if Content-Type header override is supported during read operations.
read_with_version
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if versions read operations are supported.
read_with_suffix NativeIndicates if suffix read operations are supported.
Write16
CapabilitySupportDescription
write NativeIndicates if the operator supports write operations.
write_can_multi
Conditional
When checksum_algorithm is not md5
Indicates if multiple write operations can be performed on the same object.
write_can_empty NativeIndicates if writing empty content is supported.
write_can_append NativeIndicates if append operations are supported.
write_can_copy_from
Conditional
When checksum_algorithm is not set
Indicates if an open, non-append writer can copy eligible byte ranges from existing objects without transferring the copied bytes through the client. Whole-object copy is a separate capability.
write_with_content_type NativeIndicates if Content-Type can be specified during write operations.
write_with_content_disposition NativeIndicates if Content-Disposition can be specified during write operations.
write_with_content_encoding
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if Content-Encoding can be specified during write operations.
write_with_content_language NativeIndicates if a write can store Content-Language and a subsequent stat can retrieve it.
write_with_cache_control NativeIndicates if Cache-Control can be specified during write operations.
write_with_if_match NativeIndicates if conditional write operations using If-Match are supported.
write_with_if_not_exists NativeIndicates if write operations can be conditional on object non-existence.
write_with_user_metadata NativeIndicates if custom user metadata can be attached during write operations.
write_multi_max_size
5 GiB
64-bit targets (usize::MAX on 32-bit)
Maximum size supported for multipart uploads. For example, AWS S3 supports up to 5GiB per part in multipart uploads.
write_multi_min_size
5 MiB
Minimum size required for multipart uploads (except for the last part). For example, AWS S3 requires at least 5MiB per part.
write_total_max_size
50,000 GiB
64-bit targets (unset on 32-bit)
Maximum total size supported for write operations. For example, Cloudflare D1 has a 1MB total size limit.
List6
CapabilitySupportDescription
list NativeIndicates if list operations are supported.
list_with_limit NativeIndicates if list operations support result limiting.
list_with_start_after
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if list operations support continuation from a specific point.
list_with_recursive
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if recursive listing is supported.
list_with_versions
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if listing with versions included is supported.
list_with_deleted
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if listing with deleted files included is supported.
Delete4
CapabilitySupportDescription
delete NativeIndicates if delete operations are supported.
delete_with_version
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if versions delete operations are supported.
delete_with_if_match NativeIndicates if conditional delete operations using If-Match are supported.
delete_max_size
1,000
Maximum size supported for single delete operations.
Copy10
CapabilitySupportDescription
copy NativeIndicates if copy operations are supported.
copy_with_if_not_exists NativeIndicates if conditional copy operations with if-not-exists are supported.
copy_with_if_match NativeIndicates if conditional copy operations with if-match are supported.
copy_with_source_version
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if copy operations from a specific source version are supported.
copy_with_user_metadata NativeIndicates if copy operations can replace the destination's user metadata.
copy_with_content_type NativeIndicates if copy operations can replace the destination's Content-Type.
copy_with_content_language NativeIndicates if copy operations can replace the destination's Content-Language.
copy_can_multi NativeIndicates if copy operations can be split into multiple server-side tasks.
copy_multi_max_size
5 GiB
64-bit targets (usize::MAX on 32-bit)
Maximum size supported for segmented copy tasks.
copy_multi_min_size
5 MiB
Minimum size required for segmented copy tasks.
Presign5
CapabilitySupportDescription
presign NativeIndicates if presigned URL generation is supported.
presign_read NativeIndicates if presigned URLs for read operations are supported.
presign_stat NativeIndicates if presigned URLs for stat operations are supported.
presign_write NativeIndicates if presigned URLs for write operations are supported.
presign_delete NativeIndicates if presigned URLs for delete operations are supported.
Other4
CapabilitySupportDescription
restore
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if restore operations are supported.
restore_with_version
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if restoring a specific version is supported.
restore_with_if_not_exists
Conditional
Standard S3 buckets (not S3 Express One Zone)
Indicates if conditional restore operations using if-not-exists are supported.
shared NativeIndicate if the operator supports shared access.