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
func (obsClient ObsClient) DeleteBucket(bucketName string) (output *BaseModel, err error)
Method Definition If a Signed URL Is Used
func (obsClient ObsClient) DeleteBucketWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)
Request Parameter
Field |
Type |
Optional or Mandatory |
Description |
---|---|---|---|
bucketName |
string |
Mandatory |
Bucket name |
Returned Result
Field |
Type |
---|---|
output |
|
err |
error |
Sample Code
func main() { output, err := obsClient.DeleteBucket("bucketname") if err == nil { fmt.Printf("RequestId:%s\n", output.RequestId) } else { if obsError, ok := err.(obs.ObsError); ok { fmt.Println(obsError.Code) fmt.Println(obsError.Message) } else { fmt.Println(err) } } }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot