Skip to main content

b2

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

Quick start
use opendal::Operator;

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

let op = Operator::via_iter("b2", [
// root of this backend.
//
// All operations will happen under this root.
// ("root".to_string(), "...".to_string()),

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

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

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

// bucket id of this backend.
//
// required.
("bucket_id".to_string(), "...".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

General5
KeyTypeRequiredDescription
rootstringnoroot of this backend. All operations will happen under this root.
application_key_idstringnokeyID of this backend. - If application_key_id is set, we will take user's input first. - If not, we will try to load it from environment.
application_keystringnoapplicationKey of this backend. - If application_key is set, we will take user's input first. - If not, we will try to load it from environment.
bucketstringyesbucket of this backend. required.
bucket_idstringyesbucket id of this backend. required.