API очистки кэша ролей
Удаляет роли из кэша ролей.
Запрос
POST /_security/role/<roles>/_clear_cache
Предварительные условия
- Для использования этого API необходимо обладать привилегией кластера
manage_security.
Описание
Дополнительную информацию о собственном домене см. в Разделах и Разделах об аутентификации пользователей по умолчанию.
Параметры пути
-
<roles> - (Обязательно, строка) Список ролей, разделенных запятыми, которые необходимо удалить из кэша ролей. Чтобы удалить все роли, используйте
*. Другие шаблоны подстановок не поддерживаются.
Примеры
API очистки кэша ролей удаляет роли из кэша ролей. Например, чтобы очистить кэш для my_admin_role:
resp = client.security.clear_cached_roles(
name="my_admin_role",
)
print(resp) const response = await client.security.clearCachedRoles({
name: "my_admin_role",
});
console.log(response); POST /_security/role/my_admin_role/_clear_cache
Укажите несколько ролей через запятую.
resp = client.security.clear_cached_roles(
name="my_admin_role,my_test_role",
)
print(resp) const response = await client.security.clearCachedRoles({
name: "my_admin_role,my_test_role",
});
console.log(response); POST /_security/role/my_admin_role,my_test_role/_clear_cache
Чтобы очистить все роли в кэше, используйте *.
resp = client.security.clear_cached_roles(
name="*",
)
print(resp) const response = await client.security.clearCachedRoles({
name: "*",
});
console.log(response); POST /_security/role/*/_clear_cache
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/security-api-clear-role-cache.html