OpenSearch/docs/reference/slm/apis/slm-execute.asciidoc
debadair c0156cbb5d
Backporting updates to ILM org, overview, & GS (#51898)
* [DOCS] Align with ILM API docs (#48705)

* [DOCS] Reconciled with Snapshot/Restore reorg

* [DOCS] Split off ILM overview to a separate topic. (#51287)

* [DOCS} Split off overview to a separate topic.

* [DOCS] Incorporated feedback from @jrodewig.

* [DOCS] Edit ILM GS tutorial (#51513)

* [DOCS] Edit ILM GS tutorial

* [DOCS] Incorporated review feedback from @andreidan.

* [DOCS] Removed test link & fixed anchor & title.

* Update docs/reference/ilm/getting-started-ilm.asciidoc

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>

* Fixed glossary merge error.

Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2020-02-04 16:45:18 -08:00

61 lines
1.9 KiB
Plaintext

[[slm-api-execute-lifecycle]]
=== Execute snapshot lifecycle policy API
++++
<titleabbrev>Execute snapshot lifecycle policy</titleabbrev>
++++
Immediately creates a snapshot according to the lifecycle policy,
without waiting for the scheduled time.
[[slm-api-execute-lifecycle-request]]
==== {api-request-title}
`PUT /_slm/policy/<snapshot-lifecycle-policy-id>/_execute`
[[slm-api-execute-lifecycle-prereqs]]
==== {api-prereq-title}
If the {es} {security-features} are enabled, you must have the `manage_slm`
cluster privilege to use this API. For more information, see
<<security-privileges>>.
[[slm-api-execute-lifecycle-desc]]
==== {api-description-title}
Manually applies the snapshot policy to immediately create a snapshot.
The snapshot policy is normally applied according to its schedule,
but you might want to manually execute a policy before performing an upgrade
or other maintenance.
[[slm-api-execute-lifecycle-path-params]]
==== {api-path-parms-title}
`<policy-id>`::
(Required, string)
ID of the snapshot lifecycle policy to execute.
[[slm-api-execute-lifecycle-example]]
==== {api-examples-title}
To take an immediate snapshot according to the `daily-snapshots` policy:
[source,console]
--------------------------------------------------
POST /_slm/policy/daily-snapshots/_execute
--------------------------------------------------
// TEST[skip:we can't easily handle snapshots from docs tests]
If successful, this request returns the generated snapshot name:
[source,console-result]
--------------------------------------------------
{
"snapshot_name": "daily-snap-2019.04.24-gwrqoo2xtea3q57vvg0uea"
}
--------------------------------------------------
// TESTRESPONSE[skip:we can't handle snapshots from docs tests]
The snapshot is taken in the background.
You can use the<<modules-snapshots,snapshot APIs>> to monitor the status of the snapshot.
To see the status of a policy's most recent snapshot, you can use the <<slm-api-get-policy>>.