GetBucketObjectWormConfiguration

更新时间:
复制 MD 格式

Call GetBucketObjectWormConfiguration to retrieve the ObjectWorm configuration for a bucket, including its enablement status and default retention policy.

Usage notes

  • You must have the oss:GetBucketObjectWormConfiguration permission to call this operation.

  • If ObjectWorm is not enabled for the bucket, the call returns a 404 error.

Request syntax

GET /?objectWorm HTTP/1.1
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue

Response elements

Parameter

Type

Value

Description

ObjectWormConfiguration

container

N/A

A container for the ObjectWorm configuration for the bucket.

Child nodes: ObjectWormEnabled, Rule

ObjectWormEnabled

string

Enabled

Indicates whether ObjectWorm is enabled.

Parent node: ObjectWormConfiguration

Rule

container

N/A

A container for the default retention policy. This element is not returned if no default retention policy is configured.

Parent node: ObjectWormConfiguration

Child node: DefaultRetention

DefaultRetention

container

N/A

A container for the details of the default retention policy.

Parent node: Rule

Child nodes: Mode, Days, or Years

Mode

string

COMPLIANCE

The default retention mode. The value COMPLIANCE indicates compliance mode.

Parent node: DefaultRetention

Days

Positive integer

1

The default retention period in days. This element and the Years element are mutually exclusive.

Parent node: DefaultRetention

Years

Positive integer

1

The default retention period in years. This element and the Days element are mutually exclusive.

Parent node: DefaultRetention

Examples

  • Request example

    GET /?objectWorm HTTP/1.1
    Date: Thu, 17 Mar 2026 11:18:32 GMT
    Host: examplebucket.oss-cn-hangzhou.aliyuncs.com
    Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20260317/cn-hangzhou/oss/aliyun_v4_request,Signature=****
  • Response example

    HTTP/1.1 200 OK
    x-oss-request-id: 5374A2880232A65C2300****
    Date: Thu, 17 Mar 2026 11:18:32 GMT
    Content-Type: application/xml
    Transfer-Encoding: chunked
    Server: AliyunOSS
    
    <?xml version="1.0" encoding="UTF-8"?>
    <ObjectWormConfiguration>
      <ObjectWormEnabled>Enabled</ObjectWormEnabled>
      <Rule>
        <DefaultRetention>
          <Mode>COMPLIANCE</Mode>
          <Days>1</Days>
        </DefaultRetention>
      </Rule>
    </ObjectWormConfiguration>