14 configuration options · available in Rust, Python, Node.js, Java
use opendal::Operator;
let op = Operator::via_iter("gcs", [
("bucket".to_string(), "my-bucket".to_string()),
])?;
use opendal::Operator;
let op = Operator::via_iter("gcs", [
// --- General ---
// root URI, all operations happens under `root`
// ("root".to_string(), "/".to_string()),
// bucket name
("bucket".to_string(), "my-bucket".to_string()),
// endpoint URI of GCS service,
// default is `https://storage.googleapis.com`
// ("endpoint".to_string(), "https://storage.googleapis.com".to_string()),
// Scope for gcs.
// ("scope".to_string(), "...".to_string()),
// --- Credentials ---
// Service Account for gcs.
// ("service_account".to_string(), "...".to_string()),
// Credentials string for GCS service OAuth2 authentication.
// ("credential".to_string(), "...".to_string()),
// Local path to credentials file for GCS service OAuth2 authentication.
// ("credential_path".to_string(), "...".to_string()),
// Skip signature will skip loading credentials and signing requests.
// ("skip_signature".to_string(), "true".to_string()),
// Disable attempting to load credentials from the GCE metadata server when
// running within Google Cloud.
// ("disable_vm_metadata".to_string(), "true".to_string()),
// Disable loading configuration from the environment.
// ("disable_config_load".to_string(), "true".to_string()),
// A Google Cloud OAuth2 token.
//
// Takes precedence over `credential` and `credential_path`.
// ("token".to_string(), "...".to_string()),
// --- Behavior ---
// The predefined acl for GCS.
// ("predefined_acl".to_string(), "...".to_string()),
// The default storage class used by gcs.
// ("default_storage_class".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.
| Key | Type | Required | Description |
|---|---|---|---|
rootdefault / | string | no | root URI, all operations happens under root |
buckete.g. my-bucket | string | yes | bucket name |
endpointdefault https://storage.googleapis.com | string | no | endpoint URI of GCS service,
default is https://storage.googleapis.com |
scope | string | no | Scope for gcs. |
| Key | Type | Required | Description |
|---|---|---|---|
service_account | string | no | Service Account for gcs. |
credential | string | no | Credentials string for GCS service OAuth2 authentication. |
credential_path | string | no | Local path to credentials file for GCS service OAuth2 authentication. |
skip_signature | bool | no | Skip signature will skip loading credentials and signing requests. |
disable_vm_metadata | bool | no | Disable attempting to load credentials from the GCE metadata server when running within Google Cloud. |
disable_config_load | bool | no | Disable loading configuration from the environment. |
token | string | no | A Google Cloud OAuth2 token.
Takes precedence over credential and credential_path. |
| Key | Type | Required | Description |
|---|---|---|---|
predefined_acl | string | no | The predefined acl for GCS. |
default_storage_class | string | no | The default storage class used by gcs. |
| Key | Type | Required | Description |
|---|---|---|---|
allow_anonymousdeprecated | bool | no | Allow opendal to send requests without signing when credentials are not
loaded. Deprecated since 0.57.0: Please use skip_signature instead of allow_anonymous |