slm-execute.asciidoc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. [[slm-api-execute-lifecycle]]
  2. === Execute snapshot lifecycle policy API
  3. ++++
  4. <titleabbrev>Execute snapshot lifecycle policy</titleabbrev>
  5. ++++
  6. Immediately creates a snapshot according to the lifecycle policy,
  7. without waiting for the scheduled time.
  8. [[slm-api-execute-lifecycle-request]]
  9. ==== {api-request-title}
  10. `PUT /_slm/policy/<snapshot-lifecycle-policy-id>/_execute`
  11. [[slm-api-execute-lifecycle-prereqs]]
  12. ==== {api-prereq-title}
  13. If the {es} {security-features} are enabled, you must have the `manage_slm`
  14. cluster privilege to use this API. For more information, see
  15. <<security-privileges>>.
  16. [[slm-api-execute-lifecycle-desc]]
  17. ==== {api-description-title}
  18. Manually applies the snapshot policy to immediately create a snapshot.
  19. The snapshot policy is normally applied according to its schedule,
  20. but you might want to manually execute a policy before performing an upgrade
  21. or other maintenance.
  22. [[slm-api-execute-lifecycle-path-params]]
  23. ==== {api-path-parms-title}
  24. `<policy-id>`::
  25. (Required, string)
  26. ID of the snapshot lifecycle policy to execute.
  27. [[slm-api-execute-lifecycle-example]]
  28. ==== {api-examples-title}
  29. To take an immediate snapshot according to the `daily-snapshots` policy:
  30. [source,console]
  31. --------------------------------------------------
  32. POST /_slm/policy/daily-snapshots/_execute
  33. --------------------------------------------------
  34. // TEST[skip:we can't easily handle snapshots from docs tests]
  35. If successful, this request returns the generated snapshot name:
  36. [source,console-result]
  37. --------------------------------------------------
  38. {
  39. "snapshot_name": "daily-snap-2019.04.24-gwrqoo2xtea3q57vvg0uea"
  40. }
  41. --------------------------------------------------
  42. // TESTRESPONSE[skip:we can't handle snapshots from docs tests]
  43. The snapshot is taken in the background.
  44. You can use the<<modules-snapshots,snapshot APIs>> to monitor the status of the snapshot.
  45. To see the status of a policy's most recent snapshot, you can use the <<slm-api-get-policy>>.