Creates an OSS accelerator or modifies its configuration.
Usage notes
The OSS accelerator API can be called only from an internal network in the same region as OSS, and you must use the corresponding accelerator domain name. For example, you can call the API from an ECS instance in the Ulanqab region. The following table lists the supported zones and OSS accelerator domain names for each region.
|
Region |
Zone |
OSS accelerator domain name |
|
Beijing |
|
|
|
Shanghai |
|
|
|
Shenzhen |
|
|
|
Hangzhou |
|
|
|
Ulanqab |
|
|
|
Singapore |
|
|
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 |
|
PutBucketDataAccelerator |
|
Creates a bucket accelerator or modifies its configuration. |
Request syntax
PUT /?dataAccelerator HTTP/1.1
Date: GMT Date
Content-Length:ContentLength
Content-Type: application/xml
Authorization: SignatureValue
Host: BUCKETNAME.cn-wulanchabu-b-internal.oss-data-acc.aliyuncs.com
<DataAcceleratorConfiguration>
<AvailableZone>cn-wulanchabu-b</AvailableZone>
<Quota>200</Quota>
<AcceleratePaths>
<DefaultCachePolicy>write-back</DefaultCachePolicy>
<Path>
<Name>AccelerationPath</Name>
<CachePolicy>sync-warmup</CachePolicy>
</Path>
</AcceleratePaths>
</DataAcceleratorConfiguration>
Request headers
This operation uses common request headers. For more information, see Common Request Headers.
Request parameters
|
Name |
Type |
Required |
Example |
Description |
|
dataAccelerator |
string |
Yes |
None |
Identifier parameter for OSS accelerator API operations. Can be set to any value. |
Request body
|
Name |
Type |
Required |
Example |
Description |
|
DataAcceleratorConfiguration |
Container |
Yes |
N/A |
Container for the accelerator configuration. Child nodes:
Parent node: None |
|
AvailableZone |
string |
Yes |
|
Zone of the accelerator. Supported zones:
|
|
Quota |
Positive integer |
Yes |
100 |
Capacity of the accelerator, in GB. The capacity cannot be modified again within one hour after creation or modification. |
|
AcceleratePaths |
Container |
Yes |
N/A |
Container for the acceleration policy configuration. Child nodes:
Parent node:
|
|
Path |
Container |
No |
N/A |
Container for the acceleration path configuration. Child nodes:
Parent node:
|
|
Name |
string |
Yes |
|
Acceleration path prefix. Child nodes: None Parent node: |
|
CachePolicy |
string |
Yes |
|
Acceleration policy for the path. Valid values:
Child nodes: None Parent node: |
|
DefaultCachePolicy |
string |
Yes |
|
Default acceleration policy for the entire bucket. Takes effect only when no Path is configured. Valid values:
Child nodes: None Parent node: |
Response headers
This operation uses common response headers. For more information, see Common Response Headers.
Examples
Create an OSS accelerator
-
Request example
PUT /?dataAccelerator= HTTP/1.1 Date: Sun, 05 Sep 2021 23:00:00 GMT Content-Length: 556 Content-Type: application/xml Authorization: OSS4-HMAC-SHA256 Credential=**** Host: http://BUCKETNAME.cn-wulanchabu-b-internal.oss-data-acc.aliyuncs.com <DataAcceleratorConfiguration> <AvailableZone>cn-wulanchabu-b</AvailableZone> <Quota>200</Quota> <AcceleratePaths> <DefaultCachePolicy>write-back</DefaultCachePolicy> <Path> <Name>AccelerationPath</Name> <CachePolicy>sync-warmup</CachePolicy> </Path> </AcceleratePaths> </DataAcceleratorConfiguration> -
Response example
HTTP/1.1 200 OK Server: AliyunOSS Date: Fri, 27 Jun 2025 02:19:45 GMT Content-Length: 0 Connection: keep-alive x-oss-request-id: 685DFFC18AB8A63132C65285
Error codes
|
Error code |
HTTP status code |
Description |
|
TooManyAccelerationPolicyPaths |
400 |
The number of configured acceleration paths exceeds the limit. |
|
InvalidCachePathPolicy |
400 |
The specified acceleration policy is invalid. |
|
InvalidQuota |
400 |
The specified accelerator capacity is invalid. |
|
DataAcceleratorQuotaFrozen |
403 |
The accelerator capacity is frozen and cannot be modified. |
|
DataAcceleratorAvailableZoneNotSupported |
400 |
The specified zone does not support the accelerator. |