I want to delete multiple objects from S3 with AWS.jl.
Looping over S3.delete_object() works fine, but is not that fast.
using AWS
@service S3
bucket = "my_bucket"
keys = ["tmp/file1", "tmp/file2"]
for key in keys
S3.delete_object(bucket, key)
end
That's why I want to use S3.delete_objects() without a loop (as long as I have less than 1000 files to delete). But I don't know how to specify the delete parameter.
I tried that:
to_delete = Dict("Objects" => [Dict("Key" => "tmp/file1"), Dict("Key" => "tmp/file2")])
S3.delete_objects(bucket, to_delete)
But only receive an HTTP/1.1 403 Forbidden error. I'm pretty sure the credentials are fine, as it is working in R and Python.
Thans for help
S3.DeleteObjectsdoes not work, and the low levels3must be used. Maybe try xml with multiple<Object>elements.