Help Center/ Object Storage Service/ API Reference/ Bucket APIs/ Direct Reading/ Configuring Direct Reading for Archive Objects in a Bucket
Updated on 2026-04-16 GMT+08:00

Configuring Direct Reading for Archive Objects in a Bucket

Functions

Direct reading means that you can directly perform operations on Archive objects without restoring them. For more information about direct reading of Archive data, see Configuring Direct Reading.

Authorization Information

To call this API, you must be the bucket owner or have the permission to configure direct reading for Archive objects in a bucket. You are advised to use IAM or bucket policies for authorization. For details about OBS authorization methods, see Differences Between OBS Permissions Control Methods.

  • If you use IAM for authorization, you need to use either role/policy-based authorization or identity policy-based authorization and configure the required permissions:
    • If you use role/policy-based authorization (IAM v3 APIs in the old IAM version), you need to grant the obs:bucket:PutDirectColdAccessConfiguration permission. For details, see Creating a Custom IAM Policy.
    • If you use identity policy-based authorization (IAM v5 APIs in the new IAM version), you need to grant the obs:bucket:putDirectColdAccessConfiguration permission, as shown in the following table. For details, see Creating a Custom IAM Identity Policy.

      Action

      Access Level

      Resource Type (*: Required)

      Condition Key

      Alias

      Dependencies

      obs:bucket:putDirectColdAccessConfiguration

      Write

      bucket *

      -

      -

      -

      • obs:EpochTime
      • obs:SourceIp
      • obs:TlsVersion
      • obs:CustomDomain
  • If you use bucket policies for authorization, you need to grant the obs:bucket:PutDirectColdAccessConfiguration permission. For details, see Creating a Custom Bucket Policy.

Request Syntax

The following is an example request. Replace BucketName with your bucket name and RegionID with the ID of the region where your bucket resides. You can obtain the region ID by referring to Supported Regions.

PUT /?directcoldaccess HTTP/1.1 
Host: BucketName.obs.RegionID.myhuaweicloud.com 
Date: GMT Date
Authorization: SignatureValue
Content-SHA256: SHA256
Content-MD5: MD5
Content-Length: BodyLength

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

URI Parameters

Table 1 URI parameters

Parameter

Mandatory

Type

Description

/?directcoldaccess

Yes

String

Definition

An identifier that marks this API as related to the direct reading of Archive data.

Constraints

When calculating the signature, add /BucketName/?directcoldaccess to CanonicalizedResource. For details, see Using an Authorization Header.

Range

/?directcoldaccess

Default Value

N/A

Request Headers

Table 2 lists the request headers.

Table 2 Request headers

Parameter

Mandatory

Type

Description

Content-SHA256

Yes

String

Definition

SHA-256 digest string of the message body, that is, the string obtained after the 256-bit SHA-256 value of the message body is encoded using Base64

Example: ogX9qClMrVJUBiUSIKDFM0qO41jJM0I5SCN55/OtMyI=

Constraints

You can configure the Content-SHA256 header whose value is the Base64-encoded result of the 256-bit SHA256 of the message. Configure either Content-MD5 or Content-SHA256.

Range

N/A

Default Value

N/A

Content-MD5

Yes

String

Definition

Base64-encoded 128-bit MD5 value of the request body calculated according to RFC 1864

Example: n58IG6hfM7vqI4K0vnWpog==

Constraints

You can configure the Content-SHA256 header whose value is the Base64-encoded result of the 256-bit SHA256 of the message. Configure either Content-MD5 or Content-SHA256.

Range

N/A

Default Value

N/A

Request Body

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

Table 3 Request body parameters for configuring direct reading for Archive objects in a bucket

Parameter

Mandatory (Yes/No)

Type

Description

DirectColdAccessConfiguration

Yes

Container

Definition

Root node for the configuration of the direct reading for Archive objects. DirectColdAccessConfiguration is the parent node of Status.

Constraints

N/A

Range

N/A

Default Value

N/A

Status

Yes

String

Definition

Indicates the direct reading status for a bucket.

Constraints

N/A

Range

  • Enabled: The direct reading policy is enabled for Archive objects.
  • Disabled: The direct reading policy is disabled for Archive objects.

Default Value

N/A

Response Syntax

HTTP/1.1 status_code
Date: GMT Date
Content-Length: BodyLength

Response Headers

This response uses common headers. For details, see Table 1.

Response Body

The response of this API does not contain a response body.

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
12
PUT /?directcoldaccess HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.region.myhuaweicloud.com
Date: Fri, 26 Apr 2019 07:37:36 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:sc2PM13Wlfcoc/YZLK0MwsI2Zpo=
Content-SHA256: ogX9qClMrVJUBiUSIKDFM0qO41jJM0I5SCN55/OtMyI=
Content-MD5: h4A//0EKGFKAwJkH231A==
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

References

  • For more information about direct reading of Archive data, see Direct Reading.
  • For details about the billing items involved in API operations, see Billing Items.