All Products
Search
Document Center

GetBucketReplication

Last Updated: Oct 11, 2021

Queries cross-region replication (CRR) rules configured for a bucket.

Request syntax

GET /?replication HTTP/1.1
Host: BucketName.oss-cn-hangzhou.aliyuncs.com 
Date: GMT Date
Authorization: SignatureValue

Response elements

Element

Type

Description

ReplicationConfiguration

Container

The container that stores CRR rules of a bucket.

Parent nodes: none

Child nodes: Rule

Rule

Container

The container that stores the CRR rule of a bucket.

Parent nodes: ReplicationConfiguration

Child nodes: Destination, HistoricalObjectReplication, Status, and ID

ID

String

The ID of the CRR rule.

Parent nodes: Rule

Child nodes: none

PrefixSet

Container

The container that stores Prefix. You can specify up to 10 prefixes in each CRR rule.

Parent nodes: Rule

Child nodes: Prefix

Prefix

String

The prefix of the object that is replicated to the destination bucket.

Parent nodes: PrefixSet

Child nodes: none

Action

String

The operations that are synchronized to the destination bucket.

You can set Action to one or more of the following operation types. Default value: ALL.

  • ALL: specifies that PUT, DELETE, and ABORT operations are synchronized to the destination bucket.

  • PUT: specifies that write operations are synchronized to the destination bucket, which includes PutObject, PostObject, AppendObject, CopyObject, PutObjectACL, InitiateMultipartUpload, UploadPart, UploadPartCopy, and CompleteMultipartUpload.

Parent nodes: Rule

Child nodes: none

Status

String

The status of the data replication task.

Valid values:

  • starting: Object Storage Service (OSS) creates a data replication task after a data replication rule is configured. In this case, the state of the task is starting.

  • doing: The state of a data replication task is doing after the data replication rule takes effect. In this case, the state of the task is being replicated.

  • closing: OSS clears a data replication task after the corresponding data replication rule is deleted. In this case, the state of the task is closing.

Parent nodes: Rule

Child nodes: none

Destination

Container

The container that stores the information about the destination bucket.

Parent nodes: Rule

Child nodes: Bucket and Location

Bucket

String

The destination bucket to which the data is replicated.

Parent nodes: Destination

Child nodes: none

Location

String

The region in which the destination bucket is located.

Parent nodes: Destination

Child nodes: none

TransferType

String

The data transfer type used to transfer data in data replication. Default value: internal. The TransferType element is contained in the response only when the value of TransferType is set to oss_acc in the request. Default value: internal.

Valid values:

  • internal: the default data transfer link used in OSS.

  • oss_acc: the link in which data transmission is accelerated. TransferType can be set to oss_acc only when you create a CRR rule.

HistoricalObjectReplication

String

Indicates whether historical data from the source bucket is replicated to the destination bucket before data replication is enabled. Default value: enabled.

Valid values:

  • enabled: indicates that historical data is replicated to the destination bucket.

  • disabled: indicates that historical data is not replicated to the destination bucket. Only data uploaded to the source bucket after data replication is enabled for the source bucket is replicated.

Parent nodes: Rule

Child nodes: none

SyncRole

String

The role used for CRR. The element is contained in the response only when the destination object is encrypted by using server-side encryption (SSE) that uses customer master keys (CMKs) managed by Key Management Service (KMS) for encryption (SSE-KMS).

Examples

  • Sample requests

GET /?replication HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com 
Date: Thu, 24 Sep 2015 15:39:15 GMT
Authorization: OSS qn6qrrqxo2oawuk53otfjbyc:CTkuxpLAi4XZ+WwIfNm0Fmgb****
  • Sample responses

HTTP/1.1 200 OK
x-oss-request-id: 534B371674E88A4D8906**** 
Date: Thu, 24 Sep 2015 15:39:15 GMT
Content-Length: 186
Content-Type: application/xml 
Connection: close
Server: AliyunOSS


<?xml version="1.0" ?>
<ReplicationConfiguration>
  <Rule>
    <ID>test_replication_1</ID>
    <PrefixSet>
      <Prefix>source_image</Prefix>
      <Prefix>video</Prefix>
    </PrefixSet>
    <Action>PUT</Action>
    <Destination>
      <Bucket>target-bucket</Bucket>
      <Location>oss-cn-beijing</Location>
      <TransferType>oss_acc</TransferType>
    </Destination>
    <Status>doing</Status>
    <HistoricalObjectReplication>enabled</HistoricalObjectReplication>
    <SyncRole>aliyunramrole</SyncRole>
  </Rule>
</ReplicationConfiguration>

Error codes

Error code

HTTP status code

Description

NoSuchBucket

404 NotFound

The error message returned because the specified bucket does not exist.

NoSuchReplicationConfiguration

404 NotFound

The error message returned because no data replication rules are configured for the specified bucket.