All Products
Search
Document Center

Object Storage Service:delete-bucket-replication

Last Updated:Aug 14, 2024

Disables data replication for a bucket and deletes the data replication rules of the bucket. In this case, any operations on the source bucket are not synchronized to the destination bucket.

Usage notes

  • To delete a data replication rule of a bucket, you must have the oss:DeleteBucketReplication permission. For more information, see Attach a custom policy to a RAM user.

  • The delete-bucket-replication command does not immediately delete a data replication rule. Object Storage Service (OSS) takes a specific period of time to clear the data replication tasks that are executed based on the data replication rule. During the process, the data replication tasks are in the Closing state. After the data replication tasks are cleared, the data replication rule is deleted.

  • Only the bucket owner can delete the data replication rules of a bucket. You can delete the data replication rules of a bucket from an OSS endpoint.

Command syntax

ossutil api delete-bucket-replication --bucket value --replication-rules value [flags]

Parameter

Type

Description

--bucket

string

The name of the bucket whose data replication rules you want to delete.

--replication-rules

string

The container that is used to store the data replication rule that you want to delete.

Note

You can delete data replication rules in the same manner in which you call the DeleteBucketReplication operation. For more information about the parameters in the DeleteBucketReplication operation, see DeleteBucketReplication.

--replication-rules

The -- replication-rules option supports both the XML and JSON formats. If the value of the option contains the file:// prefix, ossutil reads configurations from a specific file.

  • XML format:

    <ReplicationRules>
      <ID>string</ID>
    </ReplicationRules>
  • JSON format:

    {
      "ID": "string"
    }
    Note

    For more information about supported global command-line options, see Command-line options.

Examples

  • You can disable data replication for a bucket named examplebucket and delete a data replication rule whose ID is rule_id in the bucket by using one of the following methods:

    • Create a replication-rules.xml configuration file and add the following code to the configuration file:

      <?xml version="1.0" encoding="UTF-8"?>
      <ReplicationRules>
        <ID>rule_id</ID>
      </ReplicationRules>

      Sample command:

      ossutil api delete-bucket-replication --bucket examplebucket --replication-rules file://replication-rules.xml
    • Create a replication-rules.json configuration file and add the following code to the configuration file:

      {
        "ID": "rule_id"
      }

      Sample command:

      ossutil api delete-bucket-replication --bucket examplebucket --replication-rules file://replication-rules.json
    • Configure parameters in the following command in the JSON format:

      ossutil api delete-bucket-replication --bucket examplebucket --replication-rules "{\"ID\":\"rule_id\"}"