Skip to main content

cos

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

Quick start
use opendal::Operator;

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

let op = Operator::via_iter("cos", [
// Root of this backend.
// ("root".to_string(), "...".to_string()),

// Endpoint of this backend.
// ("endpoint".to_string(), "...".to_string()),

// Secret ID of this backend.
// ("secret_id".to_string(), "...".to_string()),

// Secret key of this backend.
// ("secret_key".to_string(), "...".to_string()),

// Security token (a.k.a. session token) of this backend.
//
// This is used for temporary credentials issued by Tencent Cloud STS
// (e.g. `GetFederationToken` / `AssumeRole`). When `security_token` is
// provided, it will be used together with `secret_id` and `secret_key`
// to sign requests, and the `x-cos-security-token` header will be
// attached automatically by the signer.
//
// If this field is not set, OpenDAL will also fall back to reading
// the token from environment variables `TENCENTCLOUD_TOKEN`,
// `TENCENTCLOUD_SECURITY_TOKEN` or `QCLOUD_SECRET_TOKEN` (unless
// `disable_config_load` is enabled).
// ("security_token".to_string(), "...".to_string()),

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

// Disable config load so that opendal will not load config from
// ("disable_config_load".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

General8
KeyTypeRequiredDescription
rootstringnoRoot of this backend.
endpointstringnoEndpoint of this backend.
secret_idstringnoSecret ID of this backend.
secret_keystringnoSecret key of this backend.
security_tokenstringnoSecurity token (a.k.a. session token) of this backend. This is used for temporary credentials issued by Tencent Cloud STS (e.g. GetFederationToken / AssumeRole). When security_token is provided, it will be used together with secret_id and secret_key to sign requests, and the x-cos-security-token header will be attached automatically by the signer. If this field is not set, OpenDAL will also fall back to reading the token from environment variables TENCENTCLOUD_TOKEN, TENCENTCLOUD_SECURITY_TOKEN or QCLOUD_SECRET_TOKEN (unless disable_config_load is enabled).
bucketstringnoBucket of this backend.
enable_versioningdeprecatedboolnoDeprecated: COS versioning capability is enabled by default.
Deprecated since 0.57.0: COS versioning capability is enabled by default and this option is no longer needed.
disable_config_loadboolnoDisable config load so that opendal will not load config from