cross-cluster-replication
cross-cluster-replication copied to clipboard
[BUG] Inconsistent usage of POST vs. PUT
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.
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.