Learn R Programming

k5 (version 0.0.5)

aws_info: List all objects in an AWS bucket

Description

aws_info() uses aws.s3::get_bucket_df() to return a tibble of stored objects in a remote bucket, like fs::dir_info() returns information on a local directory.

aws_ls() also uses aws.s3::get_bucket_df() but only returns the filenames within the bucket as a named fs_path character vector, like fs::dir_ls()) returns files in a local directory.

Usage

aws_info(bucket = aws_bucket(), prefix = NULL, max = Inf, ...)

aws_ls(bucket = aws_bucket(), prefix = NULL, ...)

aws_bucket(bucket = getOption("aws.bucket"), set = FALSE)

Value

A list of objects on the AWS bucket.

Arguments

bucket

Character string with the name of the bucket. If you use the same bucket frequently, you can set a default through an option named that can be retrieved with aws_bucket().

prefix

Character string that limits the response to keys that begin with the specified prefix.

max

Number of objects to return.

...

Additional arguments passed to aws.s3::s3HTTP().

set

If TRUE, print instructions for setting the option.

Examples

Run this code
aws_info("1000genomes", max = 10)
aws_ls("irs-form-990", max = 1)

Run the code above in your browser using DataLab