Hi everyone,
this page says we can update cluster settings with a PUT request, like below
PUT /_cluster/settings
{
"persistent" : {
"indices.recovery.max_bytes_per_sec" : "50mb"
}
}
link to the page
Since it's PUT request, does it mean we have to pass all the settings in the request even we just need change a single value? That's not reasonable and risky for production.
How can we only update a single setting value? Thanks.
When you send PUT request it will only update the settings that you write in the query body. Others will be remain untouched.
If you would like to reset more than one value you can use wildcards.
Thank you Musab for the quick response.
I think it's just the answer I was looking for!! Appreciate it.
Although we might not be able to change it, I really want to say it's not correct for this API to be PUT when it actually only update parts of the settings instead of the entire set of settings. It should be a PATCH request instead. (I will be happy if more developers/ES users see this post and agree with me on this ^_^)
I second this statement about the purpose of PUT method.
A [PUT request] is used to update an entire resource on the server. When you use a PUT request, you are telling the server to completely replace the existing data with the new data you provide.
(hyperlink is not allowed here, but everyone can google it in seconds~)
1 Like