DeleteBucket
DeleteBucket用于删除某个桶,只能删除无对象的桶,如果桶非空,需要先删除桶内的对象。
请求语法
DELETE / HTTP/1.1
Host: bucketname.cos.chinac.com
Date: GMT Date
Authorization: SignatureValue
细节分析
- 如果Bucket不存在,返回404错误,错误码:NoSuchBucket
- 为了防止误删除的发生,COS不允许用户删除一个非空的Bucket。如果试图删除一个不为空的Bucket,返回409 Conflict错误,错误码:BucketNotEmpty
- 只有Bucket的拥有者才能删除这个Bucket。如果试图删除一个没有对应权限的Bucket,返回403 Forbidden错误。错误码:AccessDenied
示例
Request
DELETE / HTTP/1.1
HOST: test-bucket.cos.chinac.com
Date: Wed, 01 Mar 2012 21:34:55 GMT
Authorization: COS I_AM_ACCESS_ID:I_AM_SIGNATURE
Response
HTTP/1.1 200 OK
x-cos-request-id: 17b21e42ac11000001390ab891440240
Date: Wed, 01 Mar 2012 21:34:55 GMT
Connection: close
Server: COS