All Products
Search
Document Center

Object Storage Service:put-bucket-archive-direct-read

Last Updated:Mar 20, 2026

The put-bucket-archive-direct-read command enables or disables real-time access to Archive objects in an OSS bucket.

Prerequisites

Before you begin, ensure that you have:

  • ossutil installed and configured

  • The oss:PutBucketArchiveDirectRead permission — required for RAM users and Security Token Service (STS) users. By default, an Alibaba Cloud account has this permission. For setup instructions, see Attach a custom policy to a RAM user

Command syntax

ossutil api put-bucket-archive-direct-read --bucket <value> --archive-direct-read-configuration <value> [flags]
ParameterTypeDescription
--bucketstringName of the bucket
--archive-direct-read-configurationstringConfiguration for real-time access to Archive objects
This command corresponds to the PutBucketArchiveDirectRead API operation. For supported global flags, see Command-line options.

--archive-direct-read-configuration

Pass the configuration as XML or JSON. To load the configuration from a file, prefix the file path with file://.

XML format:

<ArchiveDirectReadConfiguration>
    <Enabled>string</Enabled>
</ArchiveDirectReadConfiguration>

JSON format:

{
  "Enabled": "string"
}

Examples

All examples operate on examplebucket and set Enabled to "true" (a string, not a boolean) to turn on real-time access.

Enable using an XML file

  1. Create a file named archive-direct-read-configuration.xml with the following content:

       <?xml version="1.0" encoding="UTF-8"?>
       <ArchiveDirectReadConfiguration>
           <Enabled>true</Enabled>
       </ArchiveDirectReadConfiguration>
  2. Run the command:

       ossutil api put-bucket-archive-direct-read --bucket examplebucket --archive-direct-read-configuration file://archive-direct-read-configuration.xml

Enable using a JSON file

  1. Create a file named archive-direct-read-configuration.json with the following content:

       {
         "Enabled": "true"
       }
  2. Run the command:

       ossutil api put-bucket-archive-direct-read --bucket examplebucket --archive-direct-read-configuration file://archive-direct-read-configuration.json

Enable using inline JSON

The following command is equivalent to the file-based examples above and is useful for scripting or one-off configuration:

ossutil api put-bucket-archive-direct-read --bucket examplebucket --archive-direct-read-configuration "{\"Enabled\":\"true\"}"