Update the user-configurable settings for the security internal index (.security and associated indices). Only a subset of settings are allowed to be modified. This includes index.auto_expand_replicas and index.number_of_replicas.
NOTE: If index.auto_expand_replicas is set, index.number_of_replicas will be ignored during updates.
If a specific index is not in use on the system and settings are provided for it, the request will be rejected. This API does not yet support configuring the settings for indices before they are in use.
manage_securityThe period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
PUT /_security/settings
{
"security": {
"index.auto_expand_replicas": "0-all"
},
"security-tokens": {
"index.auto_expand_replicas": "0-all"
},
"security-profile": {
"index.auto_expand_replicas": "0-all"
}
}
resp = client.security.update_settings(
security={
"index.auto_expand_replicas": "0-all"
},
security-tokens={
"index.auto_expand_replicas": "0-all"
},
security-profile={
"index.auto_expand_replicas": "0-all"
},
)
const response = await client.security.updateSettings({
security: {
"index.auto_expand_replicas": "0-all",
},
"security-tokens": {
"index.auto_expand_replicas": "0-all",
},
"security-profile": {
"index.auto_expand_replicas": "0-all",
},
});
response = client.security.update_settings(
body: {
"security": {
"index.auto_expand_replicas": "0-all"
},
"security-tokens": {
"index.auto_expand_replicas": "0-all"
},
"security-profile": {
"index.auto_expand_replicas": "0-all"
}
}
)
$resp = $client->security()->updateSettings([
"body" => [
"security" => [
"index.auto_expand_replicas" => "0-all",
],
"security-tokens" => [
"index.auto_expand_replicas" => "0-all",
],
"security-profile" => [
"index.auto_expand_replicas" => "0-all",
],
],
]);
curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"security":{"index.auto_expand_replicas":"0-all"},"security-tokens":{"index.auto_expand_replicas":"0-all"},"security-profile":{"index.auto_expand_replicas":"0-all"}}' "$ELASTICSEARCH_URL/_security/settings"
client.security().updateSettings(u -> u
.security(s -> s)
.securityProfile(s -> s)
.securityTokens(s -> s)
);
{
"security": {
"index.auto_expand_replicas": "0-all"
},
"security-tokens": {
"index.auto_expand_replicas": "0-all"
},
"security-profile": {
"index.auto_expand_replicas": "0-all"
}
}