Removes (deletes) multiple objects from a MinIO bucket. You can either:
Provide an explicit vector of object keys via
objects, orSelect objects by listing
prefixand filtering with a regexpattern.
Usage
minio_remove_objects(
bucket,
objects = NULL,
prefix = NULL,
pattern = NULL,
dry_run = FALSE,
quiet = TRUE,
error_on_missing = TRUE,
use_https = TRUE,
region = ""
)Arguments
- bucket
Character. Name of the MinIO bucket.
- objects
Character vector or
NULL. Explicit object keys to remove.- prefix
Character or
NULL. Prefix used to list candidate objects whenobjectsisNULL.- pattern
Character or
NULL. Regex pattern applied to object keys (after prefix listing). IfNULL, all objects underprefixare selected.- dry_run
Logical. If
TRUE, does not delete anything; only returns the deletion plan. Defaults toFALSE.- quiet
Logical. If
TRUE, suppresses progress messages. Defaults toTRUE.- error_on_missing
Logical. If
TRUE(default), missing objects cause an error (consistent withminio_remove_object). IfFALSE, missing objects are recorded and skipped.- use_https
Logical. Whether to use HTTPS when connecting to MinIO.
- region
Character. Region string required by
aws.s3.
Value
A data.frame with columns: object, removed, error.
In dry_run = TRUE, removed is always FALSE and error is NA.
Details
Deletions are performed by calling minio_remove_object for each object.
Examples
if (FALSE) { # \dontrun{
# Remove explicit objects
res <- minio_remove_objects(
bucket = "assets",
objects = c("tmp/a.csv", "tmp/b.csv")
)
# Remove by prefix + regex pattern
res <- minio_remove_objects(
bucket = "assets",
prefix = "tmp/",
pattern = "\\\\.csv$"
)
# Dry-run
plan <- minio_remove_objects(
bucket = "assets",
prefix = "tmp/",
dry_run = TRUE
)
} # }
