cross-cluster-replication icon indicating copy to clipboard operation
cross-cluster-replication copied to clipboard

[BUG] Inconsistent usage of POST vs. PUT

Open dblock opened this issue 1 year ago • 2 comments

What is the bug?

Plugin uses PUT to start replication, but POST to pause, resume and stop. Seems inconsistent.

POST /_plugins/_replication/{index}/_pause POST /_plugins/_replication/{index}/_resume PUT /_plugins/_replication/{index}/_start POST /_plugins/_replication/{index}/_stop

What is the expected behavior?

All these APIs should be either PUT or POST. Feels like POST.

dblock avatar Dec 10 '24 12:12 dblock

[Catch All Triage - 1, 2, 3, 4, 5, 6]

dblock avatar Jan 06 '25 17:01 dblock

PUT method is used to create or update the resource. Here PUT is used for start replication as it "creates" the replication tasks and adds the replication metadata in the replication system index.

soosinha avatar Jan 07 '25 03:01 soosinha