# NOT RUN {
# The following example deletes objects from a bucket. The request
# specifies object versions. S3 deletes specific object versions and
# returns the key and versions of deleted objects in the response.
svc$delete_objects(
Bucket = "examplebucket",
Delete = list(
Objects = list(
list(
Key = "HappyFace.jpg",
VersionId = "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b"
),
list(
Key = "HappyFace.jpg",
VersionId = "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd"
)
),
Quiet = FALSE
)
)
# The following example deletes objects from a bucket. The bucket is
# versioned, and the request does not specify the object version to
# delete. In this case, all versions remain in the bucket and S3 adds a
# delete marker.
svc$delete_objects(
Bucket = "examplebucket",
Delete = list(
Objects = list(
list(
Key = "objectkey1"
),
list(
Key = "objectkey2"
)
),
Quiet = FALSE
)
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab