slm-execute.asciidoc 2.1 KB

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