Add Searchable Snapshots Cache Stats API to HLRC (#71858)

In #71701 we added a new REST API that provides statistics 
about the searchable snapshots cache on Frozen Tier.

This commit adds the necessary plumbing to expose this API 
in the High Level REST Client. It also exposes the documentation 
of the Mount Snapshot API that was created in #68949 but not 
made accessible.
This commit is contained in:
Tanguy Leroux 2021-04-20 13:35:21 +02:00 committed by GitHub
parent c919981a20
commit 571acfe3e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 472 additions and 11 deletions

View file

@ -0,0 +1,33 @@
--
:api: searchable-snapshots-caches-stats
:request: CachesStatsRequest
:response: CachesStatsResponse
--
[role="xpack"]
[id="{upid}-{api}"]
=== Cache Stats API
[id="{upid}-{api}-request"]
==== Request
The Cache Stats API provides statistics about searchable snapshot shared cache.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
<1> Example of a request targeting all data nodes.
<2> Example of a request targeting two specific nodes.
[id="{upid}-{api}-response"]
==== Response
The returned +{response}+ provides the following statistics:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> The list of cache statistics for all nodes involved in the request.
include::../execution.asciidoc[]

View file

@ -689,6 +689,20 @@ include::ilm/snapshot_lifecycle_management_status.asciidoc[]
include::ilm/execute_snapshot_lifecycle_policy.asciidoc[]
include::ilm/execute_snapshot_lifecycle_retention.asciidoc[]
[role="xpack"]
== Searchable Snapshots APIs
:upid: {mainid}-searchable-snapshots
:doc-tests-file: {doc-tests}/SearchableSnapshotsDocumentationIT.java
The Java High Level REST Client supports the following Searchable Snapshots APIs:
* <<{upid}-searchable-snapshots-mount-snapshot>>
* <<{upid}-searchable-snapshots-caches-stats>>
include::searchable_snapshots/mount_snapshot.asciidoc[]
include::searchable_snapshots/caches_stats.asciidoc[]
[role="xpack"]
[[transform_apis]]