All Products
Search
Document Center

Object Storage Service:Delete an unlocked retention policy.

Last Updated:Aug 01, 2024

Deletes an unlocked retention policy.

Usage notes

  • To delete an unlocked retention policy, you must have the oss:AbortBucketWorm permission. For more information, see Attach a custom policy to a RAM user.

  • By default, a time-based retention policy is in the InProgress state after the policy is created for a bucket. The policy remains in this state for 24 hours. Within the 24 hours, the retention policy protects the data in the bucket.

    • 24 hours after the retention policy is enabled: If the retention policy is not locked, the policy becomes invalid.

    • In the 24-hour window after the retention policy is enabled: If the retention policy is not locked, the bucket owner and authorized users can delete this policy. If the retention policy is locked, the protection period of the policy cannot be shortened and the policy cannot be deleted. The protection period can only be prolonged.

  • If a bucket contains objects that are within the protection period, you cannot delete the bucket or its retention policy. If a bucket is deleted, the retention policy of the bucket is also deleted. Only the bucket owner can delete a bucket when the bucket is empty.

Command syntax

ossutil api abort-bucket-worm --bucket value [flags]

Parameter

Type

Description

--bucket

string

The name of the bucket.

Note

For more information, see Command-line options.

Examples

Delete the unlocked retention policy that is configured for the examplebucket bucket.

ossutil api abort-bucket-worm --bucket examplebucket