The command put-bucket-archive-direct-read is used to enable or disable real-time access to Archive objects for OSS buckets.
Usage notes
By default, an Alibaba Cloud account has the permissions to enable or disable real-time access to Archive objects for OSS buckets. Performing the preceding operations as a RAM user or by using Security Token Service (STS) requires oss:PutBucketArchiveDirectRead
permissions. For more information, 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 | Configurations for real-time access to Archive objects |
The put-bucket-archive-direct-read command corresponds to the PutBucketArchiveDirectRead operation. For more information about the parameters in the PutBucketArchiveDirectRead operation, see PutBucketArchiveDirectRead.
--archive-direct-read-configuration
The --archive-direct-read-configuration option supports both XML and JSON formats. If the value of the option contains the 'file://'' prefix, configuration parameters are read from the specified file.
XML format:
<ArchiveDirectReadConfiguration> <Enabled>string</Enabled> </ArchiveDirectReadConfiguration>
JSON format:
{ "Enabled": "string" }
For more information about supported global command-line options, see Command-line options.
Examples
Enable real-time access to Archive objects for examplebucket
.
Create a configuration file named archive-direct-read-configuration.xml and add the following code:
<?xml version="1.0" encoding="UTF-8"?> <ArchiveDirectReadConfiguration> <Enabled>true</Enabled> </ArchiveDirectReadConfiguration>
Sample command:
ossutil api put-bucket-archive-direct-read --bucket examplebucket --archive-direct-read-configuration file://archive-direct-read-configuration.xml
Create a configuration file named archive-direct-read-configuration.json and add the following code:
{ "Enabled": "true" }
Sample command:
ossutil api put-bucket-archive-direct-read --bucket examplebucket --archive-direct-read-configuration file://archive-direct-read-configuration.json
Configure parameters in the following command in the JSON format:
ossutil api put-bucket-archive-direct-read --bucket examplebucket --archive-direct-read-configuration "{\"Enabled\":\"true\"}"