DELETE Bucket
API Description
You can use this API to delete a bucket. The bucket to be deleted must be empty (containing no objects, noncurrent object versions, or part fragments).
Method Definition
1. ObsClient->deleteBucket(array $parameter) 2. ObsClient->deleteBucketAsync(array $parameter, callable $callback)
Request Parameter
|
Field |
Type |
Optional or Mandatory |
Description |
|---|---|---|---|
|
Bucket |
string |
Mandatory |
Bucket name |
Returned Result
|
Field |
Type |
Description |
|---|---|---|
|
HttpStatusCode |
integer |
HTTP status code |
|
Reason |
string |
Reason description |
|
RequestId |
string |
Request ID returned by the OBS server |
Sample Code
try{
$resp = $obsClient -> deleteBucket([
'Bucket' => 'bucketname'
]);
printf("RequestId:%s\n", $resp['RequestId']);
}catch (Obs\Common\ObsException $obsException){
printf("ExceptionCode:%s\n", $obsException->getExceptionCode());
printf("ExceptionMessage:%s\n", $obsException->getExceptionMessage());
}
Last Article: HEAD Bucket
Next Article: GET Objects
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.