Closed
Description
The PUT Lifecycle Endpoint send the name as a property in the body, which is not accepted by Elasticsearch.
This causes a 400 Bad Request Response.
Therefore this method is not usable.
Code
Application
client.ilm().putLifecycle(it -> {
it.name(policy.name())
it.policy(policy)
});
Request
Endpoint: PUT /_ilm/policy/{id}
{
"policy": {
"phases": {...},
"name": "{id}"
}
}
Response
Status: 400 Bad Request
{
"error": {
"root_cause": [
{
"type": "x_content_parse_exception",
"reason": "[1:94] [lifecycle_policy] unknown field [name]"
}
],
"type": "x_content_parse_exception",
"reason": "[1:101] [put_lifecycle_request] failed to parse field [policy]",
"caused_by": {
"type": "x_content_parse_exception",
"reason": "[1:94] [lifecycle_policy] unknown field [name]"
}
},
"status": 400
}