Queries data replication 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 parameters
|
Parameter |
Type |
Example |
Description |
|
ReplicationConfiguration |
Container |
N/A |
Container for data replication configurations. Parent nodes: none Child nodes: Rule |
|
Rule |
Container |
N/A |
Container for data replication rules. Parent nodes: ReplicationConfiguration Child nodes: Destination, HistoricalObjectReplication, Status, and ID |
|
ID |
String |
test_replication_1 |
ID of the data replication rule. Parent nodes: Rule Child nodes: none |
|
PrefixSet |
Container |
N/A |
Container for prefixes. Up to 10 prefixes per rule. Parent nodes: Rule Child nodes: Prefix |
|
Prefix |
String |
source1 |
Prefixes of objects replicated to the destination bucket. Parent nodes: PrefixSet Child nodes: none |
|
Action |
String |
PUT |
Operations synchronized to the destination bucket. Set to one or more operation types. Default: ALL.
Parent nodes: Rule Child nodes: none |
|
Status |
String |
doing |
Status of the data replication task. Valid values:
Parent nodes: Rule Child nodes: none |
|
Destination |
Container |
N/A |
Container for destination bucket information. Parent nodes: Rule Child nodes: Bucket and Location |
|
Bucket |
String |
destbucket |
Destination bucket to which data is replicated. Parent nodes: Destination Child nodes: none |
|
Location |
String |
oss-cn-beijing |
Region of the destination bucket. Parent nodes: Destination Child nodes: none |
|
TransferType |
String |
oss_acc |
Data transfer type used for replication. Returned only when TransferType is set to oss_acc in the request. Default: internal. Valid values:
|
|
HistoricalObjectReplication |
String |
disabled |
Whether historical data from the source bucket is replicated to the destination bucket before replication is enabled. Default value: enabled. Default: disabled. Valid values:
Parent nodes: Rule Child nodes: none |
|
SyncRole |
String |
aliyunramrole |
Role used for data replication. Returned only when the destination object is encrypted with SSE-KMS. |
|
RTC |
Container |
N/A |
Container for the Replication Time Control (RTC) feature status. Parent nodes: Rule Child nodes: Status |
|
Status |
String |
enbaled |
Status of the RTC feature. Returned only when RTC is in the enabling or enabled state. Default: disabled. Valid values:
Parent nodes: RTC Child nodes: none |
Examples
-
Sample request
GET /?replication HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Thu, 24 Sep 2015 15:39:15 GMT
Authorization: OSS qn6q**************:77Dv****************
-
Sample response
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>source1</Prefix>
<Prefix>video</Prefix>
</PrefixSet>
<Action>PUT</Action>
<Destination>
<Bucket>destbucket</Bucket>
<Location>oss-cn-beijing</Location>
<TransferType>oss_acc</TransferType>
</Destination>
<Status>doing</Status>
<HistoricalObjectReplication>enabled</HistoricalObjectReplication>
<SyncRole>aliyunramrole</SyncRole>
<RTC>
<Status>enabled</Status>
</RTC>
</Rule>
</ReplicationConfiguration>
OSS SDKs
Call GetBucketReplication with the following OSS SDKs:
ossutil
For information about the ossutil command that corresponds to the GetBucketReplication operation, see get-bucket-replication.
Error codes
|
Error code |
HTTP status code |
Description |
|
NoSuchBucket |
404 NotFound |
The specified bucket does not exist. |
|
NoSuchReplicationConfiguration |
404 NotFound |
No data replication rules are configured for the specified bucket. |