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:GetBucketObjectWormConfigurationpermission 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 |
string |
Enabled |
Indicates whether ObjectWorm is enabled. Parent node: |
|
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: Child node: |
|
DefaultRetention |
container |
N/A |
A container for the details of the default retention policy. Parent node: Child nodes: |
|
Mode |
string |
COMPLIANCE |
The default retention mode. The value Parent node: |
|
Days |
Positive integer |
1 |
The default retention period in days. This element and the Parent node: |
|
Years |
Positive integer |
1 |
The default retention period in years. This element and the Parent node: |
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>