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:PutBucketArchiveDirectReadpermission — 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]| Parameter | Type | Description |
|---|---|---|
--bucket | string | Name of the bucket |
--archive-direct-read-configuration | string | Configuration 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
Create a file named
archive-direct-read-configuration.xmlwith the following content:<?xml version="1.0" encoding="UTF-8"?> <ArchiveDirectReadConfiguration> <Enabled>true</Enabled> </ArchiveDirectReadConfiguration>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
Create a file named
archive-direct-read-configuration.jsonwith the following content:{ "Enabled": "true" }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\"}"