You can call the PutBucketDataAccelerator operation to create an OSS accelerator or modify its configuration.
Usage notes
The OSS accelerator API can only be called in an internal network environment in the same region as OSS. You must use the corresponding accelerator domain name. For example, you can use an ECS instance in the Ulanqab region, which is the same region as OSS, to operate the OSS accelerator using the API. The following table lists the supported zones and corresponding 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 Policy 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 | The identifier parameter for OSS accelerator API operations. This parameter can have any value. |
Request body
Name | Type | Required | Example | Description |
DataAcceleratorConfiguration | Container | Yes | N/A | The container for accelerator configuration Child nodes:
Parent node: None |
AvailableZone | string | Yes |
| The zone of the accelerator. Currently supported zones:
|
Quota | Positive integer | Yes | 100 | The capacity of the accelerator in GB. The accelerator capacity cannot be modified again within one hour after creation or modification. |
AcceleratePaths | Container | Yes | N/A | The container for acceleration policy configuration Child nodes:
Parent node:
|
Path | Container | No | N/A | The container for acceleration path configuration Child nodes:
Parent node:
|
Name | string | Yes |
| The specified acceleration path prefix Child nodes: None Parent node: |
CachePolicy | string | Yes |
| The acceleration policy for the path. Available acceleration policies:
Child nodes: None Parent node: |
DefaultCachePolicy | string | Yes |
| The default acceleration policy for the entire bucket. This policy takes effect only when no Path is configured. Available acceleration policies:
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 | Too many acceleration paths are configured. |
InvalidCachePathPolicy | 400 | The acceleration policy is invalid. |
InvalidQuota | 400 | The accelerator capacity is invalid. |
DataAcceleratorQuotaFrozen | 403 | The accelerator capacity is locked and cannot be modified. |
DataAcceleratorAvailableZoneNotSupported | 400 | The accelerator cannot be created in this zone. |