slm-execute.asciidoc 2.1 KB

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