(Swift 2) Wasabi Delete Bucket Objects
Demonstrates how to delete one or more objects in a bucket.
func chilkatTest() {
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = CkoHttp()
var success: Bool
// Insert your access key here:
http.AwsAccessKey = "access-key"
// Insert your secret key here:
http.AwsSecretKey = "secret-key"
// Use the endpoint matching the bucket's region.
http.AwsEndpoint = "s3.us-west-1.wasabisys.com"
var bucketName: String? = "chilkattest"
var objectName1: String? = "seahorse.jpg"
var objectName2: String? = "seahorse2.jpg"
let sa = CkoStringArray()
sa.Append(objectName1)
sa.Append(objectName2)
var resp: CkoHttpResponse? = http.S3_DeleteMultipleObjects(bucketName, objectNames: sa)
if http.LastMethodSuccess == false {
print("\(http.LastErrorText)")
return
}
print("Response status code = \(http.LastStatus.intValue)")
// Display the XML response.
print("\(resp!.BodyStr)")
resp = nil
}
|