Setting Cross-Cloud Replication Rules

Last Updated At: 2025-10-21 09:10:00

Feature Description

The PUT Bucket CrossCloudReplication API is used to create, update, and delete cross-cloud replication rules for the source bucket. If the bucket has been configured with cross-cloud replication rules, this request will update the corresponding rules.

Request

First, obtain the cross-cloud replication request domain name. In a private cloud environment, log in to the platform machine and run the following command to obtain it:

Request Example

POST /capi HTTP/1.1
Host: ocloud-cos-lazarus.xxxx.fsphere.cn
Accept: */*
Content-Type: application/json
request body

Request Body

Users can set specific configuration information for cross-cloud replication in the request body. The configuration information includes the enabling status of cross-cloud replication rules, replication content, the bucket name of the destination bucket, AK/SK, and other information.

{
  "Action": "PutBucketCrossCloudReplication",
  "Params": {
    "Bucket": "test-1-1255000000",
    "Region": "region",
    "Configuration": [
      {
        "Destination": {
          "Bucket": "test-2-1255000000",
          "Endpoint": "http://cos.region.domain",
          "SecretID": "AKIDQDXxxxxxxxxxxxxxxxxxxqc5ltHpjJf",
          "SecretKey": "nyxljpwoxxxxxxxxxxxxxxxxxxTRwkgLU"
        },
        "DestinationPrefix": "test",
        "SourcePrefix": "test/",
        "Status": "Enabled",
        "PrefixType": true
      }
    ]
  }
}

The specific content is described as follows:

Field Name Description Type Required
Action Operation type for cross-cloud replication rules. String Yes
Params Configuration information on cross-cloud replication rules. Dict Yes

Field information contained in Params.

Field Name Description Type Required
Bucket Source bucket name. String Yes
Region Source bucket region information. String Yes
Configuration Specific rule configuration information. Array Yes

Field information contained in Configuration.

Field Name Description Type Required
Destination Destination bucket configuration information. Dict Yes
DestinationPrefix Prefix information configured for the destination bucket. String Yes
SourcePrefix Prefix information configured for the source bucket. Dict Yes
PrefixType Allowlist/Blocklist type configured for the source bucket. true indicates that the blocklist is enabled (which means not copying objects with the prefix specified by SourcePrefix), and false indicates that the allowlist is enabled (which means copying only objects with the prefix specified by SourcePrefix). bool Yes
Status Whether the cross-cloud replication rule is enabled. String Yes

Field information contained in Destination.

Field Name Description Type Required
Bucket Destination bucket name. String Yes
Endpoint Destination bucket access domain name, excluding the bucket name. String Yes
SecretID Destination bucket AK information. String Yes
SecretKey Destination bucket SK information. String Yes

Response

Response Header

HTTP/1.1 200 OK
Date: Tue, 23 Sep 2025 07:58:40 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 810
Connection: keep-alive

Response Body

{
  "RequestId": "",
  "Code": "ok",
  "Message": "",
  "Data": [
    {
      "Status": "Enabled",
      "Destination": {
        "Endpoint": "http://cos.region.domain",
        "Bucket": "test-2-1255000000",
        "SecretID": "AKIDQDXnxxxxxxxxxxxxxxxqc5ltHpjJf",
        "SecretKey": "nyxljpwolxxxxxxxxxxxxx50pTRwkgLU",
        "SecretToken": ""
      },
      "SourcePrefix": "test/",
      "DestinationPrefix": "test/",
      "Concurrency": 0,
      "RequestLimit": 0,
      "TrafficLimit": 0,
      "PrefixType": false
    }
  ]
}