Configures transfer acceleration for a bucket. Transfer acceleration improves the speed of OSS access by users worldwide and is suitable for long-distance data transfers and upload and downloads of large objects.
Usage notes
Only the owner of a bucket or RAM users to which the oss:PutBucketTransferAcceleration permission is granted can initiate requests to configure transfer acceleration for the bucket.
After you enable transfer acceleration for a bucket, you can use an accelerate endpoint in addition to the default endpoint to access the bucket. The access speed is accelerated only when you use the accelerate endpoint.
You are charged for the transfer acceleration fees when you use the accelerate endpoint to access a bucket. For more information, see Transfer acceleration fees.
For more information about transfer acceleration, see Transfer acceleration.
Command syntax
ossutil api put-bucket-transfer-acceleration --bucket value --transfer-acceleration-configuration value [flags]
Parameter | Type | Description |
--bucket | string | The name of the bucket. |
--transfer-acceleration-configuration | string | The container that stores the transfer acceleration configurations. |
The put-bucket-transfer-acceleration command is the equivalent of the PutBucketTransferAcceleration operation. For more information about the API operation, see PutBucketTransferAcceleration.
--transfer-acceleration-configuration
The --transfer-acceleration-configuration option supports XML and JSON formats.
XML format:
<TransferAccelerationConfiguration> <Enabled>boolean</Enabled> </TransferAccelerationConfiguration>
JSON format:
{ "Enabled": boolean }
For more information, see Command-line options.
Examples
Configure transfer acceleration for a bucket named examplebucket.
Use an XML configuration file (transfer-acceleration-configuration.xml in this example)
<?xml version="1.0" encoding="UTF-8"?> <TransferAccelerationConfiguration> <Enabled>true</Enabled> </TransferAccelerationConfiguration>
ossutil api put-bucket-transfer-acceleration --bucket examplebucket --transfer-acceleration-configuration file://transfer-acceleration-configuration.xml
Use a JSON configuration file (transfer-acceleration-configuration.json in this example)
{ "Enabled": "true" }
ossutil api put-bucket-transfer-acceleration --bucket examplebucket --transfer-acceleration-configuration file://transfer-acceleration-configuration.json
Use JSON parameters in the command line
ossutil api put-bucket-transfer-acceleration --bucket examplebucket --transfer-acceleration-configuration "{\"Enabled\":\"true\"}"