Skip to main content

tos

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

Quick start
use opendal::Operator;

let op = Operator::via_iter("tos", [
("bucket".to_string(), "...".to_string()),
])?;
All configuration options (copy & trim)
Full reference
use opendal::Operator;

let op = Operator::via_iter("tos", [
// root of this backend.
//
// All operations will happen under this root.
//
// default to `/` if not set.
// ("root".to_string(), "...".to_string()),

// bucket name of this backend.
//
// required.
("bucket".to_string(), "...".to_string()),

// endpoint of this backend.
//
// Endpoint must be full uri, e.g.
// - TOS: `https://tos-cn-beijing.volces.com`
// - TOS with region: `https://tos-{region}.volces.com`
//
// If user inputs endpoint without scheme like "tos-cn-beijing.volces.com", we
// will prepend "https://" before it.
// ("endpoint".to_string(), "...".to_string()),

// Region represent the signing region of this endpoint.
//
// Required if endpoint is not provided.
//
// - If region is set, we will take user's input first.
// - If not, we will try to load it from environment.
// - If still not set, default to `cn-beijing`.
// ("region".to_string(), "...".to_string()),

// access_key_id of this backend.
//
// - If access_key_id is set, we will take user's input first.
// - If not, we will try to load it from environment.
// ("access_key_id".to_string(), "...".to_string()),

// secret_access_key of this backend.
//
// - If secret_access_key is set, we will take user's input first.
// - If not, we will try to load it from environment.
// ("secret_access_key".to_string(), "...".to_string()),

// security_token of this backend.
//
// This token will expire after sometime, it's recommended to set security_token
// by hand.
// ("security_token".to_string(), "...".to_string()),

// Disable config load so that opendal will not load config from
// environment.
//
// For examples:
// - envs like `TOS_ACCESS_KEY_ID`
// ("disable_config_load".to_string(), "true".to_string()),

// Skip signature will skip loading credentials and signing requests.
// ("skip_signature".to_string(), "true".to_string()),

])?;

Every option is passed as a string key; OpenDAL parses it into the right type. Some services may require building the binding with the matching services-* feature enabled.

Configuration reference

General9
KeyTypeRequiredDescription
rootstringnoroot of this backend. All operations will happen under this root. default to / if not set.
bucketstringyesbucket name of this backend. required.
endpointstringnoendpoint of this backend. Endpoint must be full uri, e.g. - TOS: https://tos-cn-beijing.volces.com - TOS with region: https://tos-{region}.volces.com If user inputs endpoint without scheme like "tos-cn-beijing.volces.com", we will prepend "https://" before it.
regionstringnoRegion represent the signing region of this endpoint. Required if endpoint is not provided. - If region is set, we will take user's input first. - If not, we will try to load it from environment. - If still not set, default to cn-beijing.
access_key_idstringnoaccess_key_id of this backend. - If access_key_id is set, we will take user's input first. - If not, we will try to load it from environment.
secret_access_keystringnosecret_access_key of this backend. - If secret_access_key is set, we will take user's input first. - If not, we will try to load it from environment.
security_tokenstringnosecurity_token of this backend. This token will expire after sometime, it's recommended to set security_token by hand.
disable_config_loadboolnoDisable config load so that opendal will not load config from environment. For examples: - envs like TOS_ACCESS_KEY_ID
skip_signatureboolnoSkip signature will skip loading credentials and signing requests.