Enables or disables Replication Time Control (RTC) for existing cross-region replication (CRR) rules.
Usage notes
By default, an Alibaba Cloud account has the permissions to enable or disable RTC for existing CRR rules. To enable or disable RTC for existing CRR rules by using a RAM user or Security Token Service (STS), you must have the oss:PutBucketRtc
permission. For more information, see Attach a custom policy to a RAM user.
Command syntax
ossutil api put-bucket-rtc --bucket value --rtc-configuration value [flags]
Parameter | Type | Description |
--bucket | string | The name of the bucket. |
--rtc-configuration | string | The RTC configurations. |
The put-bucket-rtc command corresponds to the PutBucketRTC operation. For more information about the parameters in the PutBucketRTC operation, see PutBucketRTC.
--rtc-configuration
The --rtc-configuration configuration option supports both the XML and JSON formats. If the value of the option contains the file:// prefix, ossutil reads configurations from a configuration file.
XML format:
<RtcConfiguration> <RTC> <Status>string</Status> </RTC> <ID>string</ID> </RtcConfiguration>
JSON format:
{ "RTC": { "Status": "string" }, "ID": "string" }
For more information, see Command-line options.
Examples
The following examples show how to enable RTC for a CRR rule whose ID is rtc-configuration configured for the examplebucket bucket.
Create a configuration file named rtc-configuration.xml and add the following code to the configuration file:
<?xml version="1.0" encoding="UTF-8"?> <RtcConfiguration> <RTC> <Status>enabled</Status> </RTC> <ID>rtc-configuration</ID> </RtcConfiguration>
ossutil api put-bucket-rtc --bucket examplebucket --rtc-configuration file://rtc-configuration.xml
Create a configuration file named rtc-configuration.json and add the following code to the configuration file:
{ "RTC": { "Status": "enabled" }, "ID": "rtc-configuratione" }
ossutil api put-bucket-rtc --bucket examplebucket --rtc-configuration file://rtc-configuration.json
Configure parameters in the following command in the JSON format:
ossutil api put-bucket-rtc --bucket examplebucket --rtc-configuration "{\"RTC\":{\"Status\":\"enabled\"},\"ID\":\"rtc-configuration\"}"