get-bucket-replication-location

更新时间:
复制 MD 格式

Queries the region of the destination bucket to which the data in the source bucket can be replicated. Use the response to determine which region to target when setting up a replication rule.

Prerequisites

Before you begin, ensure that you have:

  • The oss:GetBucketReplicationLocation permission. For setup instructions, see Attach a custom policy to a RAM user

  • Bucket owner access — only the bucket owner can query replication information for a bucket

  • You can initiate a get-bucket-replication-location request from an OSS endpoint.

Command syntax

ossutil api get-bucket-replication-location --bucket <value> [flags]
ParameterTypeRequiredDescription
--bucketstringYesThe name of the source bucket.
This command maps to the GetBucketReplicationLocation API operation. For the full parameter reference, see GetBucketReplicationLocation. For all supported global flags, see Global command-line options.

Examples

Query the available destination regions for `examplebucket`:

ossutil api get-bucket-replication-location --bucket examplebucket

Get the response in JSON format:

ossutil api get-bucket-replication-location --bucket examplebucket --output-format json

Get the response in YAML format:

ossutil api get-bucket-replication-location --bucket examplebucket --output-format yaml