Enables or disables transfer acceleration for a bucket. Transfer acceleration improves access speeds for users worldwide and is suited for long-distance data transfers and large object uploads and downloads.
Prerequisites
Before you begin, ensure that you have:
Bucket owner access, or a RAM user with the
oss:PutBucketTransferAccelerationpermission
Command syntax
ossutil api put-bucket-transfer-acceleration --bucket <value> --transfer-acceleration-configuration <value> [flags]| Parameter | Type | Required | Description |
|---|---|---|---|
--bucket | string | Yes | The name of the bucket. |
--transfer-acceleration-configuration | string | Yes | The transfer acceleration configuration. Accepts XML or JSON format. |
put-bucket-transfer-acceleration is the ossutil equivalent of the PutBucketTransferAcceleration API operation. For all supported flags, see Command-line options.
--transfer-acceleration-configuration format
The --transfer-acceleration-configuration parameter accepts XML and JSON formats. Set Enabled to true to enable transfer acceleration, or false to disable it.
XML format:
<TransferAccelerationConfiguration> <Enabled>Boolean</Enabled> </TransferAccelerationConfiguration>JSON format:
{ "Enabled": Boolean }
Examples
All examples configure transfer acceleration for a bucket named examplebucket.
Enable transfer acceleration
Using an XML configuration file:
<?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.xmlUsing a JSON configuration file:
{ "Enabled": "true" }ossutil api put-bucket-transfer-acceleration --bucket examplebucket --transfer-acceleration-configuration file://transfer-acceleration-configuration.jsonUsing inline JSON:
ossutil api put-bucket-transfer-acceleration --bucket examplebucket --transfer-acceleration-configuration "{\"Enabled\":\"true\"}"
After enabling transfer acceleration
After enabling transfer acceleration, the bucket has an accelerate endpoint in addition to its default endpoint. Access speed is accelerated only when using the accelerate endpoint.
Usage notes
Transfer acceleration fees apply when you access a bucket through the accelerate endpoint. For pricing details, see Transfer acceleration fees.
What's next
Transfer acceleration — Learn how transfer acceleration works and when to use it.