Queries the data replication rules of a bucket. Object Storage Service (OSS) supports cross-region replication (CRR) and same-region replication (SRR).
Prerequisites
Before you begin, ensure that you have:
The
oss:GetBucketReplicationpermission. For details, see Attach a custom policy to a RAM userBucket owner access — only the bucket owner can query replication rules on a bucket
You can initiate a GetBucketReplication request from an OSS endpoint.
Syntax
ossutil api get-bucket-replication --bucket <value> [flags]Parameters
| Parameter | Type | Description |
|---|---|---|
--bucket | string | The name of the bucket to query. |
For supported global flags, see Command-line options.
This command calls the GetBucketReplication API operation.
Examples
Query the replication rules on examplebucket:
ossutil api get-bucket-replication --bucket examplebucketQuery the replication rules and display the output in JSON format:
ossutil api get-bucket-replication --bucket examplebucket --output-format jsonQuery the replication rules and display the output in YAML format:
ossutil api get-bucket-replication --bucket examplebucket --output-format yamlWhat's next
put-bucket-replication — Add a replication rule to a bucket.
delete-bucket-replication — Remove a replication rule from a bucket.