Deletes a bucket using the ossutil CLI.
Prerequisites
Before you begin, make sure that:
The bucket is empty. Object Storage Service (OSS) does not allow deleting a non-empty bucket.
You are the bucket owner. Only the bucket owner has permission to delete a bucket.
You have the required permission. By default, Alibaba Cloud accounts have full permissions. RAM users and RAM roles have no permissions by default. Grant the
oss:DeleteBucketaction via RAM Policy or Bucket Policy.
Permissions
| API | Action | Description |
|---|---|---|
DeleteBucket | oss:DeleteBucket | Deletes a bucket. |
Syntax
ossutil api delete-bucket --bucket <bucket-name> [flags]| Parameter | Type | Required | Description |
|---|---|---|---|
--bucket | string | Yes | The name of the bucket. |
Note: For all available flags, see Command-line options.
Examples
Delete a bucket named examplebucket:
ossutil api delete-bucket --bucket examplebucket