Enables or disables Replication Time Control (RTC) for an existing cross-region replication (CRR) rule.
Prerequisites
Before you begin, make sure you have:
An OSS bucket with at least one CRR rule configured
The ID of the CRR rule you want to update
The
oss:PutBucketRtcpermission (Alibaba Cloud root accounts have this permission by default; RAM users and Security Token Service (STS) credentials require explicit authorization)
To grant a RAM user the oss:PutBucketRtc permission, see Attach a custom policy to a RAM user.
Syntax
ossutil api put-bucket-rtc --bucket <value> --rtc-configuration <value> [flags]Parameters
| Parameter | Type | Description |
|---|---|---|
--bucket | string | The name of the bucket |
--rtc-configuration | string | The RTC configuration, in XML or JSON format |
For all available flags, see Command-line options.
This command maps to the PutBucketRTC API operation. For a full description of all parameters, see the API reference.
--rtc-configuration
Pass the configuration inline or from a file using the file:// prefix.
XML schema
<RtcConfiguration>
<RTC>
<Status>enabled|disabled</Status>
</RTC>
<ID>string</ID>
</RtcConfiguration>JSON schema
{
"RTC": {
"Status": "enabled|disabled"
},
"ID": "string"
}| Field | Type | Description |
|---|---|---|
Status | string | RTC status. Valid values: enabled, disabled |
ID | string | The ID of the CRR rule to update |
Examples
Enable RTC using an XML file
Create
rtc-configuration.xml:<?xml version="1.0" encoding="UTF-8"?> <RtcConfiguration> <RTC> <Status>enabled</Status> </RTC> <ID>rtc-configuration</ID> </RtcConfiguration>Run the command:
ossutil api put-bucket-rtc --bucket examplebucket --rtc-configuration file://rtc-configuration.xml
Enable RTC using a JSON file
Create
rtc-configuration.json:{ "RTC": { "Status": "enabled" }, "ID": "rtc-configuration" }Run the command:
ossutil api put-bucket-rtc --bucket examplebucket --rtc-configuration file://rtc-configuration.json
Enable RTC with inline JSON
ossutil api put-bucket-rtc --bucket examplebucket --rtc-configuration "{\"RTC\":{\"Status\":\"enabled\"},\"ID\":\"rtc-configuration\"}"What's next
PutBucketRTC — Full API reference for this operation
Command-line options — All flags supported by ossutil