elasticsearch/docs/reference/rest-api/security/clear-privileges-cache.asciidoc
James Rodewig 255c9a7f95
[DOCS] Move x-pack docs to docs/reference dir (#99209)
**Problem:**
For historical reasons, source files for the Elasticsearch Guide's security, watcher, and Logstash API docs are housed in the `x-pack/docs` directory. This can confuse new contributors who expect Elasticsearch Guide docs to be located in `docs/reference`. 

**Solution:**
- Move the security, watcher, and Logstash API doc source files to the `docs/reference` directory
- Update doc snippet tests to use security

Rel: https://github.com/elastic/platform-docs-team/issues/208
2023-09-12 14:53:41 -04:00

59 lines
1.7 KiB
Text

[role="xpack"]
[[security-api-clear-privilege-cache]]
=== Clear privileges cache API
++++
<titleabbrev>Clear privileges cache</titleabbrev>
++++
Evicts privileges from the native application privilege cache.
The cache is also automatically cleared for applications that have their privileges updated.
[[security-api-clear-privilege-cache-request]]
==== {api-request-title}
`POST /_security/privilege/<applications>/_clear_cache`
[[security-api-clear-privilege-cache-prereqs]]
==== {api-prereq-title}
* To use this API, you must have at least the `manage_security` cluster
privilege.
[[security-api-clear-privilege-cache-desc]]
==== {api-description-title}
For more information about the native realm, see
<<realms>> and <<native-realm>>.
[[security-api-clear-privilege-cache-path-params]]
==== {api-path-parms-title}
`<applications>`::
(Required, string)
Comma-separated list of applications to clear. To clear all applications, use
`*`. Does not support other wildcard patterns.
[[security-api-clear-privilege-cache-example]]
==== {api-examples-title}
The clear privileges cache API evicts privileges from the native application privilege cache.
For example, to clear the cache for `myapp`:
[source,console]
--------------------------------------------------
POST /_security/privilege/myapp/_clear_cache
--------------------------------------------------
Specify multiple applications as a comma-separated list.
[source,console]
--------------------------------------------------
POST /_security/privilege/myapp,my-other-app/_clear_cache
--------------------------------------------------
To clear the cache for all applications, use `*`.
[source,console]
----
POST /_security/privilege/*/_clear_cache
----