Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ilm] change remove-policy-from-index http method from DELETE to POST #35268

Merged
merged 2 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static Request deleteLifecyclePolicy(DeleteLifecyclePolicyRequest deleteLifecycl
static Request removeIndexLifecyclePolicy(RemoveIndexLifecyclePolicyRequest removePolicyRequest) {
String[] indices = removePolicyRequest.indices() == null ?
Strings.EMPTY_ARRAY : removePolicyRequest.indices().toArray(new String[] {});
Request request = new Request(HttpDelete.METHOD_NAME,
Request request = new Request(HttpPost.METHOD_NAME,
talevy marked this conversation as resolved.
Show resolved Hide resolved
new RequestConverters.EndpointBuilder()
.addCommaSeparatedPathParts(indices)
.addPathPartAsIs("_ilm")
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ilm/apis/remove-policy.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Unassigns a policy from a specified index pattern

==== Request

`DELETE <index>/_ilm`
`POST <index>/_ilm`

==== Description

Expand Down Expand Up @@ -80,7 +80,7 @@ PUT my_index

[source,js]
--------------------------------------------------
DELETE my_index/_ilm
POST my_index/_ilm
--------------------------------------------------
// CONSOLE
// TEST[continued]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class RestRemoveIndexLifecyclePolicyAction extends BaseRestHandler {

public RestRemoveIndexLifecyclePolicyAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.DELETE, "/{index}/_ilm", this);
controller.registerHandler(RestRequest.Method.POST, "/{index}/_ilm", this);
}

@Override
Expand All @@ -40,4 +40,4 @@ protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient
return channel ->
client.execute(RemoveIndexLifecyclePolicyAction.INSTANCE, changePolicyRequest, new RestToXContentListener<>(channel));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ilm.remove_policy": {
"documentation": "http://www.elastic.co/guide/en/index_lifecycle/current/index_lifecycle.html",
"methods": [ "DELETE" ],
"methods": [ "POST" ],
"url": {
"path": "/{index}/_ilm",
"paths": ["/{index}/_ilm", "/_ilm"],
Expand Down