slm-execute.asciidoc 2.0 KB

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