Help Center/ Object Storage Service/ API Reference (Ankara Region)/ APIs/ Advanced Bucket Settings/ Obtaining the Cross-Cluster Replication Configuration of a Bucket
Updated on 2024-04-15 GMT+08:00

Obtaining the Cross-Cluster Replication Configuration of a Bucket

Functions

This operation obtains the replication configuration information of a specified bucket. To perform this operation, you must have the GetReplicationConfiguration permission.

Request Syntax

1
2
3
4
GET /?replication HTTP/1.1 
Host: bucketname.obs.region.example.com
Date: date 
Authorization:authorization string

Request Parameters

This request contains no message parameters.

Request Headers

This request uses common headers. For details, see Table 3.

Request Elements

This request involves no elements.

Response Syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
HTTP/1.1 status_code 
Date: date 
Server:OBS 
Content-Length: contentlength 
<?xml version="1.0" encoding="UTF-8"?> 
<ReplicationConfiguration xmlns="http://obs.example.com/doc/2006-03-01/"> 
  <Agency>testAcy</Agency>
  <Rule> 
      <ID>rule1</ID> 
      <Status>Enabled</Status> 
      <Prefix></Prefix> 
      <Destination> 
         <Bucket>exampletargetbucket</Bucket> 
         <DeleteData>Enabled</DeleteData>
      </Destination> 
      <HistoricalObjectReplication>Enabled</HistoricalObjectReplication>
  </Rule> 
</ReplicationConfiguration>

Response Headers

The response to the request uses common headers. For details, see Table 1.

Response Elements

This response contains elements to detail the configuration. The following table describes the elements.

Table 1 Bucket replication configuration elements

Element

Description

ReplicationConfiguration

Container for the replication rules. A maximum of 100 rules can be configured. The size of the XML file can reach 50 KB.

Type: container

Child: Rule

Parent: none

Rule

Container of a specified replication rule.

There must be at least one rule for the replication configuration. A maximum of 100 rules can be configured.

Type: container

Parent: ReplicationConfiguration

ID

Unique identifier of a rule, with a maximum length of 255 characters.

Type: string

Parent: Rule

Status

If the value of this element is Disabled, this rule will be ignored.

Type: string

Parent: Rule

Value options: Enabled, Disabled

Prefix

Prefix of an object key name, applicable to one or more objects.

The maximum length of a prefix is 1,024 bytes. Duplicated prefixes are not supported.

Type: string

Parent: Rule

Destination

Container for the destination bucket information.

Type: container

Parent: Rule

Bucket

Bucket used to store object copies that are marked by rules.

If the replication configuration contains multiple rules, the rules must specify the same bucket as the destination bucket.

Type: string

Parent: Destination

DeleteData

Keyword for synchronizing object deletion operations. If the value is Enabled, the object deletion for the source bucket will be replicated to the destination bucket.

Type: string

Parent: Destination

Value options: Enabled, Disabled

HistoricalObjectReplication

Keyword for copying a historical object. If the value is Enabled, historical objects meeting this rule are copied.

Type: string

Parent: Rule

Value options: Enabled, Disabled

Error Responses

The following table describes the error response for this request.

Table 2 Error response elements

Error Code

Description

HTTP Response Code

SOAP Error Code Prefix

NoSuchReplicationConfiguration

Replication configuration does not exist.

404 not found

Client

Sample Request

1
2
3
4
5
6
GET /?replication HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.region.example.com
Accept: */*
Date: Wed, 27 Jun 2018 13:42:40 +0000
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:jGHviInfRyOkT/EpySpua1hlBuY=

Sample Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: B59500000164417B57D02F7EF8823152
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSHu6lz4vgk5G3E32OFcIPEZZgdOEYE/
Content-Type: application/xml
Date: Wed, 27 Jun 2018 13:42:39 GMT
Content-Length: 337

<?xml version="1.0" encoding="utf-8"?>
<ReplicationConfiguration xmlns="http://obs.example.com/doc/2006-03-01/"> 
  <Rule> 
    <ID>Rule-1</ID>  
    <Status>Enabled</Status>  
    <Prefix></Prefix>  
    <Destination> 
      <Bucket>dstbucket</Bucket>  
      <DeleteData>Enabled</DeleteData>
    </Destination>
    <HistoricalObjectReplication>Enabled</HistoricalObjectReplication> 
  </Rule>  
  <Agency>testAcy</Agency> 
</ReplicationConfiguration>