Class ServiceConfig.R2

java.lang.Object
org.apache.opendal.ServiceConfig.R2
All Implemented Interfaces:
ServiceConfig
Enclosing interface:
ServiceConfig

public static class ServiceConfig.R2 extends Object implements ServiceConfig
Configuration for service r2.
  • Field Details

    • accessKeyId

      public final String accessKeyId

      Access key ID.

      Set this field together with secret_access_key.

    • accountId

      public final String accountId

      Cloudflare account ID used to derive the R2 endpoint.

      Set exactly one of account_id and endpoint.

    • bucket

      @NonNull public final @NonNull String bucket

      Bucket name.

      This field is required.

    • disableConfigLoad

      public final Boolean disableConfigLoad

      Disable loading credentials from AWS environment variables and shared profile files.

      Set both access_key_id and secret_access_key when enabled.

    • endpoint

      public final String endpoint

      Explicit R2-compatible endpoint.

      Use this field for a proxy, gateway, or test server. Set exactly one of endpoint and account_id.

    • jurisdiction

      public final String jurisdiction

      R2 jurisdiction.

      Supported values are eu, fedramp, and us. This field requires account_id and cannot be used with endpoint.

    • root

      public final String root

      Root within the bucket.

      All operations happen under this root. The default is /.

    • secretAccessKey

      public final String secretAccessKey

      Secret access key.

      Set this field together with access_key_id.

    • sessionToken

      public final String sessionToken

      Session token for temporary credentials.

      This field requires access_key_id and secret_access_key.

  • Constructor Details

    • R2

      public R2()
  • Method Details

    • scheme

      public String scheme()
      Description copied from interface: ServiceConfig
      The scheme of the service.
      Specified by:
      scheme in interface ServiceConfig
      Returns:
      the scheme
    • configMap

      public Map<String,String> configMap()
      Description copied from interface: ServiceConfig
      Convert the structured config to a type erased config map.

      A map-valued field becomes one entry, under the field's option name, whose value is a JSON object string, such as assume_role_session_tags = {"Team":"data"}. The map's entries are not flattened into top-level entries. Its keys are sorted, an empty map becomes {}, and an unset field has no entry.

      Specified by:
      configMap in interface ServiceConfig
      Returns:
      the config map