Add API to execute SLM retention on-demand (#47405)

* Add API to execute SLM retention on-demand

This commit adds the `/_slm/_execute_retention` API endpoint. This
endpoint kicks off SLM retention and then returns immediately.

This in particular allows us to run retention without scheduling it
(for entirely manual invocation) or perform a one-off cleanup.

This commit also includes HLRC for the new API, and fixes an issue
in SLMSnapshotBlockingIntegTests where retention invoked prior to the
test completing could resurrect an index the internal test cluster
cleanup had already deleted.

Resolves #46508
Relates to #43663
This commit is contained in:
Lee Hinman 2019-10-02 10:28:39 -06:00 committed by GitHub
parent b1cc72786e
commit 17dc095606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 476 additions and 58 deletions

View file

@ -0,0 +1,35 @@
--
:api: slm-execute-snapshot-lifecycle-retention
:request: ExecuteSnapshotLifecycleRetentionRequest
:response: AcknowledgedResponse
--
[role="xpack"]
[id="{upid}-{api}"]
=== Execute Snapshot Lifecycle Retention API
[id="{upid}-{api}-request"]
==== Request
The Execute Snapshot Lifecycle Retention API allows you to execute Snapshot Lifecycle Management
Retention immediately, rather than waiting for its regularly scheduled execution.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
[id="{upid}-{api}-response"]
==== Response
The returned +{response}+ contains a boolean for whether the request was
acknowledged by the master node.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
include::../execution.asciidoc[]