Configures transfer acceleration for a bucket. After transfer acceleration is enabled, users worldwide can access objects more quickly. This feature is applicable to scenarios that involve long-distance data transfer and the upload or download of large objects that are gigabytes or terabytes in size.
Usage notes
-
After you enable transfer acceleration for a bucket, an accelerate endpoint becomes available in addition to the default endpoint. Access speed is accelerated only when you use the accelerate endpoint.
-
Transfer acceleration fees are incurred when you use the accelerate endpoint to access a bucket. For more information, see Transfer acceleration fees.
For more information about transfer acceleration, see Access OSS using transfer acceleration.
Permissions
By default, an Alibaba Cloud account has full permissions. RAM users or RAM roles under an Alibaba Cloud account do not have any permissions by default. The Alibaba Cloud account or account administrator must grant operation permissions through RAM policies or Bucket Policy.
|
API |
Action |
Description |
|
PutBucketTransferAcceleration |
oss:PutBucketTransferAcceleration |
Configures transfer acceleration for a bucket. |
Request structure
PUT /?transferAcceleration HTTP/1.1
Date: GMT Date
Content-Length: ContentLength
Content-Type: application/xml
Host: BucketName.oss.aliyuncs.com
Authorization: SignatureValue
Request parameters
|
Parameter |
Type |
Required |
Example |
Description |
|
TransferAccelerationConfiguration |
Container |
Yes |
N/A |
The container that stores the transfer acceleration configuration. |
|
Enabled |
String |
Yes |
true |
Specifies whether to enable transfer acceleration for the bucket. Valid values:
Important
Transfer acceleration takes effect within 30 minutes after it is enabled. |
For more information about common request headers in PutBucketTransferAcceleration requests, such as Authorization and Content-Length, see Common request headers.
Response headers
The response contains only common response headers, such as x-oss-request-id and Date. For more information, see Common response headers.
Examples
-
Sample requests
The following request enables transfer acceleration for a bucket named examplebucket:
PUT /?transferAcceleration HTTP/1.1 Date: Fri, 30 Apr 2021 13:08:38 GMT Content-Length: 443 Content-Type: application/xml Host: examplebucket.oss.aliyuncs.com Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,AdditionalHeaders=content-length,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e <TransferAccelerationConfiguration> <Enabled>true</Enabled> </TransferAccelerationConfiguration> -
Sample responses
HTTP/1.1 200 OK x-oss-request-id: 534B371674A4D890**** Date: Thu, 17 Apr 2025 13:08:38 GMT Content-Length: 443 Connection: keep-alive Server: AliyunOSS
OSS SDKs
You can use OSS SDKs for the following programming languages to call this operation:
ossutil
For information about the ossutil command that corresponds to the PutBucketTransferAcceleration operation, see put-bucket-transfer-acceleration.
Error codes
|
Error code |
HTTP status code |
Description |
|
AccessDenied |
404 |
You are not authorized to perform this operation. Only users who are granted the oss:PutBucketTransferAcceleration permission can configure transfer acceleration for the bucket. |
|
MalformedXML |
400 |
The request body is not valid XML. For example, the Enabled field is set to a value other than true or false. |