Help Center> Object Storage Service> API Reference> APIs> Advanced Bucket Settings> Setting the Direct Reading Policy for Archive Objects in a Bucket

Setting the Direct Reading Policy for Archive Objects in a Bucket

Functions

The direct reading function of Archive objects means that a user can directly perform operations on the Archive objects without restoring them.

By default, the direct reading function is disabled in a bucket.

This API enables or disables the direct reading function for Archive objects of a bucket.

  • When the function is Enabled:
    • You can directly perform operations on the Archive objects of a bucket regardless of whether they have been restored.
    • If the Archive objects are not restored, your operations on them will be charged separately.
  • When the function is Disabled:
    • You need to restore the Archive objects before you perform any operation on them.

To perform this operation, you must have the PutDirectColdAccessConfiguration permission. By default, only the bucket owner can perform this operation. The bucket owner can grant the permission to other users by configuring the bucket policy or user policy.

The direct reading function is available only in the following regions: CN North-Beijing1, CN North-Beijing4, CN East-Shanghai2, CN South-Guangzhou, CN Southwest-Guiyang1.

Request Syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
PUT /?directcoldaccess HTTP/1.1 
Host: examplebucket.obs.cn-north-4.myhuaweicloud.com
Date: date
Authorization: authorization
Content-SHA256: SHA256
Content-Length: length

<DirectColdAccessConfiguration>     
    <Status>status</Status> 
</DirectColdAccessConfiguration>

Request Parameters

This request contains no parameter.

Request Headers

Table 1 lists the request header.

Table 1 Request headers

Header

Description

Mandatory

Content-SHA256

Base64-encoded 256-bit SHA256 digest of the message according to SHA.

Type: string

Example: ogX9qClMrVJUBiUSIKDFM0qO41jJM0I5SCN55/OtMyI=

Yes

Request Elements

This request contains elements to configure the direct reading status for Archive objects in XML format. Table 2 lists the request elements.

Table 2 Request elements required to configure the direct reading status for Archive objects

Element

Description

Mandatory

DirectColdAccessConfiguration

Root node for the configuration of the direct reading function for Archive objects

Ancestor: none

Yes

Status

Indicates the direct reading status of Archive objects of a bucket.

Type: enumeration

Ancestor: DirectColdAccessConfiguration

Value options: Enabled, Disabled

Yes

Response Syntax

1
2
3
4
HTTP/1.1 status_code
Date: date

Content-Length: length

Response Headers

The response to the request uses common headers. For details, see Table 1.

Response Elements

This response involves no elements.

Error Responses

No special error responses are returned. For details about error responses, see Table 2.

Sample Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
PUT /?directcoldaccess HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.cn-north-4.myhuaweicloud.com
Date: Fri, 26 Apr 2019 07:37:36 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:sc2PM13Wlfcoc/YZLK0MwsI2Zpo=
Content-SHA256: ogX9qClMrVJUBiUSIKDFM0qO41jJM0I5SCN55/OtMyI=
Content-Length: 92

<DirectColdAccessConfiguration>
    <Status>Enabled</Status>
</DirectColdAccessConfiguration>

Sample Response

1
2
3
4
5
6
HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: 0000016A58940244809DEF00122E6802
x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCStOlo1yxthHHo2GlS3WGgt1ekAIh3Vy
Date: Fri, 26 Apr 2019 07:37:36 GMT
Content-Length: 0