9 configuration options · available in Rust, Python, Node.js, Java
use opendal::Operator;
let op = Operator::via_iter("tos", [
("bucket".to_string(), "...".to_string()),
])?;
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.
| Key | Type | Required | Description |
|---|---|---|---|
root | string | no | root of this backend.
All operations will happen under this root.
default to / if not set. |
bucket | string | yes | bucket name of this backend. required. |
endpoint | string | no | 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. |
region | string | no | 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. |
access_key_id | string | no | 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. |
secret_access_key | string | no | 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. |
security_token | string | no | security_token of this backend. This token will expire after sometime, it's recommended to set security_token by hand. |
disable_config_load | bool | no | Disable config load so that opendal will not load config from
environment.
For examples:
- envs like TOS_ACCESS_KEY_ID |
skip_signature | bool | no | Skip signature will skip loading credentials and signing requests. |