Skip to content

Conversation

@delvedor
Copy link
Member

Hello!

In the spec both /_slm/policy/{name}/_execute and /_enrich/policy/{name}/_execute declare PUT as the only method supported, but in the code POST is supported as well.

public RestExecuteSnapshotLifecycleAction(RestController controller) {
controller.registerHandler(RestRequest.Method.PUT, "/_slm/policy/{name}/_execute", this);
controller.registerHandler(RestRequest.Method.POST, "/_slm/policy/{name}/_execute", this);
}

public RestExecuteEnrichPolicyAction(final RestController controller) {
controller.registerHandler(RestRequest.Method.PUT, "/_enrich/policy/{name}/_execute", this);
controller.registerHandler(RestRequest.Method.POST, "/_enrich/policy/{name}/_execute", this);
}

cc @elastic/es-clients

@pgomulka pgomulka added the :Data Management/ILM+SLM Index and Snapshot lifecycle management label Nov 18, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/ILM+SLM)

@dakrone
Copy link
Member

dakrone commented Dec 2, 2019

As mentioned in #47061, we might be deprecating and removing support for PUT.

@gwbrown do you think we should make that change for 8.0 or stick with supporting both for the long term?

@gwbrown
Copy link
Contributor

gwbrown commented Dec 2, 2019

PUT is the wrong verb for these actions, but 1) we support both for similar APIs (_watcher/watch/_execute for example) and 2) breaking changes always kind of suck, especially as there will never be a need to use PUT for anything else with this path, so the only reason for removing it is, in the words of Jason:

leniency is abhorrent and should be eschewed

and/or REST pedantry (which is kind of already out the window considering our main API is a GET with a body). I'm conflicted on this one. We should definitely encourage the use of POST here, but I'm not sure it's worth deprecating PUT anymore given the low cost of maintaining it and the low benefit of removing it.

{
"path": "/_enrich/policy/{name}/_execute",
"methods": [ "PUT" ],
"methods": [ "PUT", "POST" ],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"methods": [ "PUT", "POST" ],
"methods": [ "POST", "PUT" ],

SInce POST is preferred list it first.

@Mpdreamz
Copy link
Member

Mpdreamz commented Dec 9, 2019

Clients take the listed http methods in order of preference so listing POST before PUT would go along way already.

codebrain added a commit to elastic/elasticsearch-net that referenced this pull request Dec 13, 2019
@rjernst rjernst added the Team:Data Management Meta label for data/management team label May 4, 2020
@elasticsearchmachine elasticsearchmachine changed the base branch from master to main July 22, 2022 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants