Yang Wang 7969fbb4ab
Cache API key doc to reduce traffic to the security index () ()
Getting the API key document form the security index is the most time consuing part
of the API Key authentication flow (>60% if index is local and >90% if index is remote).
This traffic is now avoided by caching added with this PR.

Additionally, we add a cache invalidator registry so that clearing of different caches will
be managed in a single place (requires follow-up PRs).
2020-10-06 23:49:23 +11:00

35 lines
1.0 KiB
Plaintext

--
:api: clear-api-key-cache
:request: ClearApiKeyCacheRequest
:response: ClearSecurityCacheResponse
--
[role="xpack"]
[id="{upid}-{api}"]
=== Clear API Key Cache API
[id="{upid}-{api}-request"]
==== Clear API Key Cache Request
A +{request}+ supports clearing API key cache for the given IDs.
It can also clear the entire cache if no ID is specified.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
<1> the IDs(s) for the API keys to be evicted from the cache
include::../execution.asciidoc[]
[id="{upid}-{api}-response"]
==== Clear API Key Cache Response
The returned +{response}+ allows to retrieve information about where the cache was cleared.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> the list of nodes that the cache was cleared on