Obtaining the Cross-Region Replication Configuration of a Bucket
Functions
This API is used to obtain the cross-region replication configuration of a bucket. For more information about cross-region replication, see Cross-Region Replication Within an Account Using OBS.
Authorization Information
To call this API, you must be the bucket owner or have the permission to obtain the cross-region replication configuration of a bucket. You are advised to use IAM or bucket policies for authorization. For details about OBS authorization methods, see Differences Between OBS Permissions Control Methods.
- If you use IAM for authorization, you need to use either role/policy-based authorization or identity policy-based authorization and configure the required permissions:
- If you use role/policy-based authorization (IAM v3 APIs in the old IAM version), you need to grant the obs:bucket:GetReplicationConfiguration permission. For details, see Creating a Custom IAM Policy.
- If you use identity policy-based authorization (IAM v5 APIs in the new IAM version), you need to grant the obs:bucket:getReplicationConfiguration permission, as shown in the following table. For details, see Creating a Custom IAM Identity Policy.
Action
Access Level
Resource Type (*: Required)
Dependencies
obs:bucket:getReplicationConfiguration
Read
bucket *
-
-
-
- obs:EpochTime
- obs:SourceIp
- obs:TlsVersion
- obs:CustomDomain
- If you use bucket policies for authorization, you need to grant the obs:bucket:GetReplicationConfiguration permission. For details, see Creating a Custom Bucket Policy.
Request Syntax
1 2 3 4 | GET /?replication HTTP/1.1 Host: bucketname.obs.region.myhuaweicloud.com Date: date Authorization:authorization string |
URI Parameters
This request contains no message parameters.
Request Headers
This request uses common headers. For details, see Table 3.
Request Body
This request contains no request body parameters.
Response Syntax
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | HTTP/1.1 status_code Date: date Server:OBS Content-Length: contentlength <?xml version="1.0" encoding="UTF-8"?> <ReplicationConfiguration xmlns="http://obs.ap-southeast-1.myhuaweicloud.com/doc/2006-03-01/"> <Agency>testAcy</Agency> <Rule> <ID>rule1</ID> <Status>Enabled</Status> <Prefix></Prefix> <Destination> <Bucket>exampletargetbucket</Bucket> <StorageClass>WARM</StorageClass> <DeleteData>Enabled</DeleteData> </Destination> <HistoricalObjectReplication>Enabled</HistoricalObjectReplication> </Rule> </ReplicationConfiguration> |
Response Headers
This response uses common headers. For details, see Table 1.
Response Body
This response contains elements to detail the configuration. The following table describes the elements.
| Parameter | Type | Description |
|---|---|---|
| ReplicationConfiguration | Container | Definition Container of cross-region replication rules. ReplicationConfiguration is the parent node of Rule and Agency. Range N/A |
| Rule | Container | Definition Container of a specified cross-region replication rule. Range For details, see Table 2. |
| Agency | String | Definition Name of the agency created by the user. Range The value is a string of 0 to 64 characters. |
| Parameter | Type | Description |
|---|---|---|
| ID | String | Definition ID of the cross-region replication rule. Range The value is a string of 0 to 255 characters. |
| Status | String | Definition Whether to enable the cross-region replication rule. Range
|
| Prefix | String | Definition Prefix of an object name. Range The value is a UTF-8-encoded character sequence containing 1 to 1024 characters. The prefix characters of different rules cannot overlap. For example, two rules are configured, the prefix of rule 1 is object, and the prefix of rule 2 is obj. Both prefixes contain obj. |
| Destination | Container | Definition Container for the destination bucket information. Range For details, see Table 3. |
| HistoricalObjectReplication | String | Definition Whether to replicate historical objects that meet the cross-region replication rule. Range
|
| Parameter | Type | Description |
|---|---|---|
| Bucket | String | Definition Bucket used to store object copies that are marked by rules. Range The value can contain 3 to 63 characters. |
| StorageClass | String | Definition The storage class to which objects replicated to the destination bucket will be changed. Range
|
| DeleteData | String | Definition Whether to synchronously delete objects with the same names in the destination bucket through cross-region replication after the objects in the source bucket are deleted. Range
|
Error Responses
The following table describes the error response for this request.
| Error Code | Description | HTTP Response Code | SOAP Error Code Prefix |
|---|---|---|---|
| NoSuchReplicationConfiguration | Cross-region 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.myhuaweicloud.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 23 24 | 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.ap-southeast-1.myhuaweicloud.com/doc/2006-03-01/"> <Rule> <ID>Rule-1</ID> <Status>Enabled</Status> <Prefix></Prefix> <Destination> <Bucket>dstbucket</Bucket> <StorageClass>STANDARD</StorageClass> <DeleteData>Enabled</DeleteData> </Destination> <HistoricalObjectReplication>Enabled</HistoricalObjectReplication> </Rule> <Agency>testAcy</Agency> </ReplicationConfiguration> |
References
- To use obsutil to obtain the cross-region replication configuration of a bucket, see Using obsutil to Replicate Data Across Regions on the Client Side.
- For details about the billing items involved in API operations, see Billing Items.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot