Delete Bucket
Updated at:2025-11-03
Delete bucket
The following code can be used to delete a bucket:
Plain Text
1 bos_pool_create(&p, NULL);
2 options = bos_request_options_create(p);
3 init_test_request_options(options, is_cname);
4 bos_str_set(&bucket, TEST_BUCKET_NAME);
5 s = bos_delete_bucket(options, &bucket, &resp_headers);
Note:
- Before deletion, ensure that all objects and any unfinished multipart uploads in the bucket have been fully removed. Otherwise, the deletion will fail.
- Before deleting a bucket, verify that Cross-Region Replication (CRR) is not enabled for the bucket, and that it is neither the source nor target bucket in any CRR rules. Otherwise, the deletion will fail.
