Deletes all lifecycle rules of a bucket. After deletion, objects in the bucket are not automatically deleted.
Prerequisites
Before you begin, make sure you have:
An OSS bucket with lifecycle rules configured
The
oss:DeleteBucketInventorypermission. For more information, see Attach a custom policy to a RAM user.
Usage notes
This command deletes all lifecycle rules of the specified bucket. To review existing rules before deletion, run
ossutil api get-bucket-lifecycle --bucket <bucket-name>.After lifecycle rules are deleted, objects in the bucket are not automatically deleted.
Command syntax
ossutil api delete-bucket-lifecycle --bucket <value> [flags]| Parameter | Type | Description |
|---|---|---|
--bucket | string | The name of the bucket. |
For a full list of supported flags, see Command-line options.
Examples
Delete all lifecycle rules of examplebucket:
ossutil api delete-bucket-lifecycle --bucket examplebucketWhat's next
get-bucket-lifecycle — View the lifecycle rules of a bucket.
put-bucket-lifecycle — Create or update lifecycle rules for a bucket.