Disables data replication for a bucket and deletes its replication rules. After deletion, changes to the source bucket are no longer synchronized to the destination bucket.
Deletion is not immediate. Object Storage Service (OSS) clears all replication tasks associated with the rule before removing it. During this process, the replication tasks remain in the Closing state. The rule is deleted only after all tasks are cleared.
Prerequisites
Before you begin, ensure that you have:
The
oss:DeleteBucketReplicationpermission. For setup instructions, see Attach a custom policy to a RAM userAccess to an OSS endpoint
Bucket owner privileges (only the bucket owner can delete replication rules)
Command syntax
ossutil api delete-bucket-replication --bucket <value> --replication-rules <value> [flags]Parameters
Required parameters
| Parameter | Type | Description |
|---|---|---|
--bucket | string | The name of the bucket whose replication rules you want to delete. |
--replication-rules | string | The replication rule to delete, specified in XML or JSON format. |
--replication-rules format
The --replication-rules parameter accepts XML or JSON. Use the file:// prefix to read the value from a file instead of passing it inline.
XML format:
<ReplicationRules>
<ID>string</ID>
</ReplicationRules>JSON format:
{
"ID": "string"
}The parameters for this command correspond to those of the DeleteBucketReplication API operation. For the full parameter reference, see DeleteBucketReplication. For supported global flags, see Command-line options.Examples
The following examples delete the replication rule with ID rule_id from a bucket named examplebucket.
Inline JSON:
ossutil api delete-bucket-replication --bucket examplebucket --replication-rules "{\"ID\":\"rule_id\"}"From an XML file:
Create replication-rules.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ReplicationRules>
<ID>rule_id</ID>
</ReplicationRules>Run:
ossutil api delete-bucket-replication --bucket examplebucket --replication-rules file://replication-rules.xmlFrom a JSON file:
Create replication-rules.json:
{
"ID": "rule_id"
}Run:
ossutil api delete-bucket-replication --bucket examplebucket --replication-rules file://replication-rules.json