Skip to contents

Virtual chunk references point outside the repository. A repository declares containers (URL prefixes plus how to reach them), and the reader must authorise each prefix it is willing to read, with credentials. Nothing is authorised by default: this is the "where" control.

Usage

ic_cred_s3(
  kind = c("from_env", "anonymous", "static"),
  access_key_id = NULL,
  secret_access_key = NULL,
  session_token = NULL
)

ic_cred_http()

ic_cred_local()

ic_cred_gcs(kind = c("from_env", "anonymous"))

ic_cred_azure(kind = c("from_env", "anonymous"))

ic_container(
  url_prefix,
  type = c("s3", "s3_compatible", "http", "local", "gcs", "in_memory"),
  region = NULL,
  endpoint_url = NULL,
  anonymous = FALSE,
  allow_http = FALSE,
  force_path_style = FALSE,
  path = NULL
)

Arguments

kind

for S3: "from_env", "anonymous" or "static"; for GCS and Azure: "from_env" or "anonymous".

access_key_id, secret_access_key, session_token

static S3 keys.

url_prefix

the prefix chunk locations must start with, e.g. "s3://bucket/path/", "https://host/path/", "file:///data/".

type

store type for the container.

region, endpoint_url, anonymous, allow_http, force_path_style

S3 options for type = "s3" or "s3_compatible".

path

for type = "local".

Value

a credential spec (a list), for authorize in ic_repo_open().

Examples

# a virtual chunk container: where chunk bytes may come from
ic_container("https://noaa-cdr-sea-surface-temp-optimum-interpolation-pds.s3.amazonaws.com/", "http")
#> $url_prefix
#> [1] "https://noaa-cdr-sea-surface-temp-optimum-interpolation-pds.s3.amazonaws.com/"
#> 
#> $store
#> $store$type
#> [1] "http"
#> 
#> $store$anonymous
#> [1] FALSE
#> 
#> $store$allow_http
#> [1] FALSE
#> 
#> $store$force_path_style
#> [1] FALSE
#> 
#> 
#> attr(,"class")
#> [1] "icechunk_container"
ic_container("s3://my-bucket/data/", "s3", region = "us-west-2")
#> $url_prefix
#> [1] "s3://my-bucket/data/"
#> 
#> $store
#> $store$type
#> [1] "s3"
#> 
#> $store$region
#> [1] "us-west-2"
#> 
#> $store$anonymous
#> [1] FALSE
#> 
#> $store$allow_http
#> [1] FALSE
#> 
#> $store$force_path_style
#> [1] FALSE
#> 
#> 
#> attr(,"class")
#> [1] "icechunk_container"
ic_container("file:///data/netcdf/", "local", path = "/data/netcdf")
#> $url_prefix
#> [1] "file:///data/netcdf/"
#> 
#> $store
#> $store$type
#> [1] "local"
#> 
#> $store$anonymous
#> [1] FALSE
#> 
#> $store$allow_http
#> [1] FALSE
#> 
#> $store$force_path_style
#> [1] FALSE
#> 
#> $store$path
#> [1] "/data/netcdf"
#> 
#> 
#> attr(,"class")
#> [1] "icechunk_container"
# credentials for storage
ic_cred_s3("anonymous")
#> <icechunk_cred> type=s3 kind=anonymous
if (FALSE) { # \dontrun{
ic_cred_s3("static", access_key_id = "AKIA...", secret_access_key = "...")
} # }