Deleting a Replication
- reference
To delete an XDCR replication, use the DELETE /controller/cancelXDCR
HTTP method and URI.
Description
When a replication is deleted, replication of data from the source to the target cluster is stopped. For replication of data to be resumed, a new replication must be created.
The Full Admin, Cluster Admin, or XDCR Admin role is required.
HTTP method and URI
DELETE /controller/cancelXDCR/<replication_id>
The replication_id
must take the form [UUID]/[local-bucket-name]/[remote-bucket-name]
, and must be URL-encoded.
Note that it can be obtained, in encoded format, by means of the GET
method and /pools/default/tasks
endpoint, applied to the source cluster: in the output, the encoded id is provided as the value of the cancelURI
key.
See Getting Cluster Tasks.
Curl Syntax
curl -v -X DELETE -u <username>:<password> http://[ip-address-or-domain-name]:8091/controller/cancelXDCR/<replication_id>
Responses
Failure to specify the replication_id
correctly returns 400 Bad Request
and the following error message: {"errors":{"_":"requested resource not found"}}
.
Failure to authenticate returns 401 Unauthorized
.
Example
In the following example, the existing replication from source bucket travel-sample
to target bucket ts
is deleted.
curl -v -X DELETE http://localhost:8091/controller/cancelXDCR/2b5dcd1b0101a9d52f31a802d8c4231e%2Ftravel-sample%2Fts -u Administrator:password
If deletion succeeds, an empty array is returned:
[]
See Also
A complete overview of XDCR is provided in Cross Data Center Replication (XDCR). Further examples of reference deletion — by means of UI, CLI, and REST API — are provided in Delete a Replication. Information on retrieving the uuid for a defined reference is provided in Getting Cluster Tasks.