put-bucket-rtc

Updated at:

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 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.

Note

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 option supports both XML and JSON formats. If the value of the option contains the file:// prefix, the configuration is read from a file.

  • XML format:

    <RtcConfiguration>
      <RTC>
        <Status>string</Status>
      </RTC>
      <ID>string</ID>
    </RtcConfiguration>
  • JSON format:

    {
      "RTC": {
        "Status": "string"
      },
      "ID": "string"
    }
Note

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.

  • The XML configuration file rtc-configuration.xml has the following content:

    <?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
  • The JSON configuration file, rtc-configuration.json, contains the following:

    {
        "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\"}"