Setting Up Bucket Data Synchronization
Updated at:2025-11-03
API description
This API is used to set up data synchronization. Each ID uniquely identifies a replication rule. The first submission for an ID creates a replication rule, while subsequent submissions overwrite it. If the original status is "enable," overwriting it to "disable" is not permitted. If the original status is "enable," resubmitting it as "enable" will restart the replication. Two replication rules cannot have identical configurations except for their IDs.
Description:
- The user must own the source bucket with FULL_CONTROL permission and have write access to the target bucket.
- Both the source bucket and the target bucket must exist.
- The source bucket and target bucket can be in the same region or different regions.
- The target bucket and source bucket can be under the same account or different accounts, but the source account must have the write permission for the destination bucket.
- The total configuration size must not exceed 128 KB, and the combined length of all rules under the current bucket must not exceed 200 KB Data synchronization currently does not support archive storage class files, and the archive storage class files will be ignored during synchronization.
- Users can configure up to 10 replication rules.
- A single rule can include up to 20 resources.
- The ID must consist of numbers, letters, hyphens (-), and underscores (_), and shall not exceed 20 characters
Request URI
PUT /v1/{bucketName}/?replication
| Parameter name | Parameter type | Required or not | Description | Example value | Parameter location |
|---|---|---|---|---|---|
| bucketName | String | Yes | Bucket name | "bucketName_example" | Path |
| id | String | Yes | Rule name of replication. The ID must consist of numbers, letters, hyphens (-), and underscores (_), and shall not exceed 20 characters. | "id_example" | Query |
Parameters of request body
Description of the data structure of request body fields
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| status | String | Yes | Is it effective | enabled |
| resource | List |
Yes | Effective prefix of replication. The resource configuration format is {$bucket_name/ |
|
| destination | Destination | Yes | Destination location configuration of replication | |
| replicateHistory | ReplicateHistory | No | Historical file replication: When enabled, all existing objects will be synchronously replicated to the destination bucket, sharing the same resource scope. | |
| replicateDeletes | String | Yes | Indicates whether the Delete synchronization function is enabled. The options are either enabled or disabled. | enabled |
| id | String | Yes | Rule name of replication. The ID must consist of numbers, letters, hyphens (-), and underscores (_), and shall not exceed 20 characters. | sample-bucket |
Description of the data structure of the Destination field
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| bucket | String | Yes | Destination Bucket name | dst-bucket-name |
| storageClass | String | No | Specifies the storage class of the destination object. If it matches the source Bucket's storage class, no configuration is needed. If a separate storage class is required, it can be STANDARD; for multi-AZ buckets, options include MAZ_STANDARD_IA and MAZ_STANDARD. | COLD |
Description of the data structure of the ReplicateHistory field
| Parameter name | Parameter type | Required or not | Description | Example value |
|---|---|---|---|---|
| storageClass | String | No | Specifies the storage class of the destination object. If it matches the source Bucket's storage class, no configuration is needed. If a separate storage class is required, it can be STANDARD; for multi-AZ buckets, options include MAZ_STANDARD_IA and MAZ_STANDARD. | COLD |
Response body parameters
Description of the data structure of response body fields
Request example
JSON
1PUT /v1/bucketName_example/?replication&id=id_example
2 <Common request headers>
3{
4 "resource" : [ "src-bucket-name/abc" ],
5 "destination" : {
6 "bucket" : "dst-bucket-name",
7 "storageClass" : "COLD"
8 },
9 "id" : "sample-bucket",
10 "replicateHistory" : {
11 "storageClass" : "COLD"
12 },
13 "replicateDeletes" : "enabled",
14 "status" : "enabled"
15}
Response example
JSON
1HTTP/1.1 200 OK
2 <Common response headers>
3{ }
Error code
Please refer to the general error codes
