All Products
Search
Document Center

Object Storage Service:ExtendBucketWorm

Last Updated:Sep 13, 2023

Extends the retention period of objects in an Object Storage Service (OSS) bucket whose retention policy is locked.

Note

If the retention policy ID specified in the request does not exist, OSS returns HTTP status code 404.

Usage notes

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

  • 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.
  • 24 hours after the retention policy is enabled: If the retention policy is not locked, the policy becomes invalid.

If a bucket contains objects that are within the protection period, you cannot delete the bucket or its retention policy. To delete the retention policy of a bucket, the bucket must be empty. Only the bucket owner can delete the retention policy.

Request elements

Element

Type

Required

Example

Description

ExtendWormConfiguration

Container

Yes

N/A

The root node.

Child nodes: RetentionPeriodInDays

wormId

String

Yes

1666E2CFB2B3418****

The ID of the retention policy that is automatically generated when the InitiateBucketWorm operation is called.

RetentionPeriodInDays

Positive integer

Yes

366

The number of days for which objects must be retained.

Valid values: 1 to 25550.

Examples

  • Sample requests

    POST /?wormId=1666E2CFB2B3418****&wormExtend HTTP/1.1
    Date: Thu, 15 May 2014 11:18:32 GMT
    Host: BucketName.oss.aliyuncs.com
    Authorization: OSS nxj7dtlhcyl5hp****:COS3OQkfQPnKmYZTEHYv2**** 
    
    <ExtendWormConfiguration>
      <RetentionPeriodInDays>366</RetentionPeriodInDays>
    </ExtendWormConfiguration>
  • Sample responses

    HTTP/1.1 200 OK
    Server: AliyunOSS
    Date: Thu, 15 May 2014 11:18:32 GMT
    Content-Length: 0
    Connection: keep-alive
    x-oss-request-id: 5C06A3B67B8B5A3DA422299D
    x-oss-server-time: 122